Package jgromacs.data
Class IndexSet
java.lang.Object
jgromacs.data.IndexSet
- All Implemented Interfaces:
Cloneable
Objects of this class represent a single index set
-
Constructor Summary
ConstructorsConstructorDescriptionIndexSet()
Constructs a new IndexSet objectConstructs a new IndexSet object of a given nameConstructs a new IndexSet object and loads data from an ArrayListConstructs a new IndexSet object of a given name and loads data from an ArrayListConstructs a new IndexSet object and loads data from a TreeSetConstructs a new IndexSet object of a given name and loads data from a TreeSetConstructs a new IndexSet object identical to a given IndexSet -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIndex
(int index) Adds a new index to the index setclone()
Returns an identical IndexSet objectboolean
Returns true if this index sets is identical to anotherReturns index set as an ArrayListReturns index set as a TreeSetgetName()
Returns the name of index setint
Returns the number of indices in this index setint
hashCode()
Returns hash codeReturns the intersection of this index set and anotherboolean
isIndexIn
(int index) Returns true if the index set contains a given indexvoid
removeIndex
(int index) Removes an index from the index setvoid
Sets the name of index setReturns the subtraction of another index set from this index settoString()
Returns the String representation of index setReturns summary information about the index setReturns the union of this index set and another
-
Constructor Details
-
IndexSet
public IndexSet()Constructs a new IndexSet object -
IndexSet
Constructs a new IndexSet object of a given name -
IndexSet
Constructs a new IndexSet object and loads data from an ArrayList -
IndexSet
Constructs a new IndexSet object of a given name and loads data from an ArrayList -
IndexSet
Constructs a new IndexSet object and loads data from a TreeSet -
IndexSet
Constructs a new IndexSet object of a given name and loads data from a TreeSet -
IndexSet
Constructs a new IndexSet object identical to a given IndexSet
-
-
Method Details
-
getName
Returns the name of index set- Returns:
- Name of index set
-
setName
Sets the name of index set -
getAsTreeSet
Returns index set as a TreeSet- Returns:
- index set as a TreeSet
-
getAsArrayList
Returns index set as an ArrayList- Returns:
- index set as an ArrayList
-
getNumberOfIndices
public int getNumberOfIndices()Returns the number of indices in this index set- Returns:
- number of indices
-
isIndexIn
public boolean isIndexIn(int index) Returns true if the index set contains a given index -
addIndex
public void addIndex(int index) Adds a new index to the index set -
removeIndex
public void removeIndex(int index) Removes an index from the index set -
intersect
Returns the intersection of this index set and another- Returns:
- intersection of two index sets
-
subtract
Returns the subtraction of another index set from this index set- Returns:
- subtraction of two index sets
-
union
Returns the union of this index set and another- Returns:
- union of two index sets
-
toString
Returns the String representation of index set -
toStringInfo
Returns summary information about the index set- Returns:
- summary information
-
equals
Returns true if this index sets is identical to another -
hashCode
public int hashCode()Returns hash code -
clone
Returns an identical IndexSet object
-