public class HNSubSet extends java.lang.Object implements java.lang.Comparable<HNSubSet>
int that is used to represent subsets in the
input and output sets of HeuristicsNet objects.| Constructor and Description |
|---|
HNSubSet()
Constructs a
HNSubSet object |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value)
Adds a given value to this
HNSubSet object |
void |
addAll(HNSubSet toAdd)
Adds all the values in a given
HNSubSet object to this
HNSubSet object |
int |
compareTo(HNSubSet set)
Compares a given
HNSubSet object with this
HNSubSet object. |
boolean |
contains(int value)
Checks if a certain value is already contained in this
HNSubSet object |
HNSubSet |
deepCopy()
Creates a deep copy of this
HNSubSet object |
HNSubSet |
deepCopy(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap) |
boolean |
equals(java.lang.Object o)
Compares if the given
HNSubSet object contains the same
values of this HNSubSet object |
int |
get(int index)
Retrieves the value at a given position in this
HNSubSet
object |
int |
hashCode()
Retrieves the hash code of this
HNSubSet object |
void |
remove(int value)
Removes a given value of this
HNSubSet object |
void |
removeAll(HNSubSet toRemove)
Removes from this
HNSubSet object all the values that are
contained in a given HNSubSet object |
int |
size()
Retrieves the number of values contained in this
HNSubSet
object |
java.lang.String |
toString()
Builds a string representation of this
HNSubSet object |
public final int size()
HNSubSet
object HNSubSet objectpublic final int get(int index)
HNSubSet
objectindex - element's positionpublic final boolean contains(int value)
HNSubSet objectvalue - number that may be contained in this HNSubSet
objecttrue if this HNSubSet object contains
the given value, false otherwise.public final HNSubSet deepCopy()
HNSubSet object HNSubSet object with the same contents of the
this HNSubSet objectpublic HNSubSet deepCopy(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
public void addAll(HNSubSet toAdd)
HNSubSet object to this
HNSubSet objecttoAdd - subset contains the values to addpublic void add(int value)
HNSubSet objectvalue - integer to be added to this HNSubSet objectpublic java.lang.String toString()
HNSubSet objecttoString in class java.lang.Object HNSubSet objectpublic void remove(int value)
HNSubSet objectvalue - integer to be removed from this HNSubSet objectpublic void removeAll(HNSubSet toRemove)
HNSubSet object all the values that are
contained in a given HNSubSet objecttoRemove - subset with values to be removed from this
HNSubSet objectpublic int hashCode()
HNSubSet objecthashCode in class java.lang.Object HNSubSet objectpublic int compareTo(HNSubSet set)
HNSubSet object with this
HNSubSet object. The comparison occurs in the following
way:
HNSubSet object is always 'less than' a
null objectHNSubSet object with smaller size is always 'less
than' a HNSubSet object with bigger sizecompareTo in interface java.lang.Comparable<HNSubSet>set - heuristics net subset to compare with this
HNSubSet object-1 if the other HNSubSet object if
smaller than this HNSubSet object, 0 if
both objects are the equal, and 1 otherwise.public boolean equals(java.lang.Object o)
HNSubSet object contains the same
values of this HNSubSet objectequals in class java.lang.Objecttrue - if the two HNSubSet objects are the
same, false otherwise