public class HNSet
extends java.lang.Object
HNSubSet
objects that is used to represent sets
in the input and output sets of HeuristicsNet
objects.Constructor and Description |
---|
HNSet()
Constructs a
HNSet object |
Modifier and Type | Method and Description |
---|---|
void |
add(HNSubSet subset)
Adds a given subset to this
HNSet object |
void |
addAll(HNSet setToInclude)
Adds all the subsets in a given
HNSet object to this
HNSet object |
boolean |
contains(HNSubSet subset)
Checks if a certain subset is already contained in this
HNSet object |
HNSet |
deepCopy()
Creates a deep copy of this
HNSet object |
HNSet |
deepCopy(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap) |
boolean |
equals(java.lang.Object o)
Compares if the given
HNSet object contains the same values
of this HNSet object |
HNSubSet |
get(int index)
Retrieves the
HNSubSet object at a given position in this
HNSet object |
static HNSubSet |
getUnionSet(HNSet set)
Calculates the union set of all the subsets contained in the given
HNSet object |
int |
hashCode()
Retrieves the hash code of this
HNSet object |
void |
remove(HNSubSet subset)
Removes a given subset of this
HNSet object |
void |
removeAll(HNSet toRemove)
Removes from this
HNSet object all the subsets that are
contained in a given HNSet object |
static HNSet |
removeElementFromSubsets(HNSet set,
int element)
Removes a given element from all the subsets contained in the provided
HNSet object |
int |
size()
Retrieves the number of subsets contained in this
HNSet
object |
java.lang.String |
toString()
Builds a string representation of this
HNSet object |
public final int size()
HNSet
objectHNSet
objectpublic final HNSubSet get(int index)
HNSubSet
object at a given position in this
HNSet
objectindex
- subset's positionHNSubSet
object of at this positionpublic final HNSet deepCopy()
HNSet
objectHNSet
object with the same contents of the
this HNSet
objectpublic HNSet deepCopy(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
public void add(HNSubSet subset)
HNSet
objectsubset
- subset to be added to this HNSet
objectRuntimeException
- if subset to add is
null
public void addAll(HNSet setToInclude)
HNSet
object to this
HNSet
objecttoAdd
- set contains the subsets to addpublic boolean contains(HNSubSet subset)
HNSet
objectsubset
- subset that may be contained in this HNSet
objecttrue
if this HNSet
object contains the
given subset
, false
otherwise.public void remove(HNSubSet subset)
HNSet
objectsubset
- subset to be removed from this HNSet
objectpublic void removeAll(HNSet toRemove)
HNSet
object all the subsets that are
contained in a given HNSet
objecttoRemove
- set with subsets to be removed from this HNSet
objectpublic int hashCode()
HNSet
objecthashCode
in class java.lang.Object
HNSet
objectpublic boolean equals(java.lang.Object o)
HNSet
object contains the same values
of this HNSet
objectequals
in class java.lang.Object
true
- if the two HNSet
objects are the
same, false
otherwisepublic java.lang.String toString()
HNSet
objecttoString
in class java.lang.Object
HNSet
objectpublic static final HNSubSet getUnionSet(HNSet set)
HNSet
objectset
- set contains all the subset to be unitedset
public static HNSet removeElementFromSubsets(HNSet set, int element)
HNSet
objectset
- provided subsetelement
- value to be removed from subsetselement