org.processmining.models.heuristics.impl
Class HNSet

java.lang.Object
  extended by org.processmining.models.heuristics.impl.HNSet

public class HNSet
extends java.lang.Object

Ordered set of HNSubSet objects that is used to represent sets in the input and output sets of HeuristicsNet objects.

Author:
Peter van den Brand and Ana Karla Alves de Medeiros

Constructor Summary
HNSet()
          Constructs a HNSet object
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HNSet

public HNSet()
Constructs a HNSet object

Method Detail

size

public final int size()
Retrieves the number of subsets contained in this HNSet object

Returns:
size of this HNSet object

get

public final HNSubSet get(int index)
Retrieves the HNSubSet object at a given position in this HNSet object

Parameters:
index - subset's position
Returns:
HNSubSet object of at this position

deepCopy

public final HNSet deepCopy()
Creates a deep copy of this HNSet object

Returns:
a new HNSet object with the same contents of the this HNSet object

deepCopy

public HNSet deepCopy(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)

add

public void add(HNSubSet subset)
Adds a given subset to this HNSet object

Parameters:
subset - subset to be added to this HNSet object
Throws:
RuntimeException - if subset to add is null

addAll

public void addAll(HNSet setToInclude)
Adds all the subsets in a given HNSet object to this HNSet object

Parameters:
toAdd - set contains the subsets to add

contains

public boolean contains(HNSubSet subset)
Checks if a certain subset is already contained in this HNSet object

Parameters:
subset - subset that may be contained in this HNSet object
Returns:
true if this HNSet object contains the given subset, false otherwise.

remove

public void remove(HNSubSet subset)
Removes a given subset of this HNSet object

Parameters:
subset - subset to be removed from this HNSet object

removeAll

public void removeAll(HNSet toRemove)
Removes from this HNSet object all the subsets that are contained in a given HNSet object

Parameters:
toRemove - set with subsets to be removed from this HNSet object

hashCode

public int hashCode()
Retrieves the hash code of this HNSet object

Overrides:
hashCode in class java.lang.Object
Returns:
hash code of this HNSet object

equals

public boolean equals(java.lang.Object o)
Compares if the given HNSet object contains the same values of this HNSet object

Overrides:
equals in class java.lang.Object
Parameters:
true - if the two HNSet objects are the same, false otherwise

toString

public java.lang.String toString()
Builds a string representation of this HNSet object

Overrides:
toString in class java.lang.Object
Returns:
string representing this HNSet object

getUnionSet

public static final HNSubSet getUnionSet(HNSet set)
Calculates the union set of all the subsets contained in the given HNSet object

Parameters:
set - set contains all the subset to be united
Returns:
union set of all the subsets in the given set

removeElementFromSubsets

public static HNSet removeElementFromSubsets(HNSet set,
                                             int element)
Removes a given element from all the subsets contained in the provided HNSet object

Parameters:
set - provided subset
element - value to be removed from subsets
Returns:
set where all the subsets do not contain element