Class MultiIntSet
- java.lang.Object
-
- org.processmining.plugins.inductiveminer2.helperclasses.MultiIntSet
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>
public class MultiIntSet extends java.lang.Object implements java.lang.Iterable<java.lang.Integer>
-
-
Field Summary
Fields Modifier and Type Field Description protected gnu.trove.map.hash.TIntLongHashMapcardinalitiesprotected longsize
-
Constructor Summary
Constructors Constructor Description MultiIntSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(int element)booleanadd(int element, long cardinality)booleanaddAll(gnu.trove.TIntCollection collection)booleanaddAll(java.util.Collection<java.lang.Integer> collection)Add each element of the collection, each with cardinality 1.booleanaddAll(java.util.Collection<java.lang.Integer> collection, long cardinality)Add each element of the collection, each with cardinality as given.booleanaddAll(MultiIntSet collection)voidclear()MultiIntSetclone()booleancontains(int a)MultiIntSetcopy()voidempty()booleanequals(java.lang.Object obj)longgetCardinalityOf(int e)intgetElementWithHighestCardinality()Get an element with the highest cardinality of all elements.inthashCode()booleanisEmpty()java.util.Iterator<java.lang.Integer>iterator()Iterator over the elements of the multiset as if it were a set.booleanremove(int element)booleanremove(int element, long cardinality)intsetSize()longsize()int[]sortByCardinality()Returns a list of the elements, sorted by their cardinality.gnu.trove.set.TIntSettoSet()java.lang.StringtoString()
-
-
-
Method Detail
-
clear
public void clear()
-
add
public boolean add(int element)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
add
public boolean add(int element, long cardinality)
-
remove
public boolean remove(int element, long cardinality)
-
remove
public boolean remove(int element)
-
addAll
public boolean addAll(java.util.Collection<java.lang.Integer> collection)
Add each element of the collection, each with cardinality 1.- Parameters:
collection-- Returns:
-
addAll
public boolean addAll(java.util.Collection<java.lang.Integer> collection, long cardinality)Add each element of the collection, each with cardinality as given.- Parameters:
collection-cardinality-- Returns:
-
addAll
public boolean addAll(gnu.trove.TIntCollection collection)
-
addAll
public boolean addAll(MultiIntSet collection)
-
empty
public void empty()
-
size
public long size()
-
isEmpty
public boolean isEmpty()
-
setSize
public int setSize()
-
toSet
public gnu.trove.set.TIntSet toSet()
-
contains
public boolean contains(int a)
-
getCardinalityOf
public long getCardinalityOf(int e)
-
iterator
public java.util.Iterator<java.lang.Integer> iterator()
Iterator over the elements of the multiset as if it were a set. Get cardinalities using getCardinality().- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Integer>
-
copy
public MultiIntSet copy()
-
getElementWithHighestCardinality
public int getElementWithHighestCardinality()
Get an element with the highest cardinality of all elements.- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public MultiIntSet clone()
- Overrides:
clonein classjava.lang.Object
-
sortByCardinality
public int[] sortByCardinality()
Returns a list of the elements, sorted by their cardinality.- Returns:
-
-