public class MultiIntSet
extends java.lang.Object
implements java.lang.Iterable<java.lang.Integer>
Modifier and Type | Field and Description |
---|---|
protected gnu.trove.map.hash.TIntLongHashMap |
cardinalities |
protected long |
size |
Constructor and Description |
---|
MultiIntSet() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int element) |
boolean |
add(int element,
long cardinality) |
boolean |
addAll(java.util.Collection<java.lang.Integer> collection)
Add each element of the collection, each with cardinality 1.
|
boolean |
addAll(java.util.Collection<java.lang.Integer> collection,
long cardinality)
Add each element of the collection, each with cardinality as given.
|
boolean |
addAll(MultiIntSet collection) |
boolean |
addAll(gnu.trove.TIntCollection collection) |
void |
clear() |
MultiIntSet |
clone() |
boolean |
contains(int a) |
MultiIntSet |
copy() |
void |
empty() |
boolean |
equals(java.lang.Object obj) |
long |
getCardinalityOf(int e) |
int |
getElementWithHighestCardinality()
Get an element with the highest cardinality of all elements.
|
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<java.lang.Integer> |
iterator()
Iterator over the elements of the multiset as if it were a set.
|
boolean |
remove(int element) |
boolean |
remove(int element,
long cardinality) |
int |
setSize() |
long |
size() |
int[] |
sortByCardinality()
Returns a list of the elements, sorted by their cardinality.
|
gnu.trove.set.TIntSet |
toSet() |
java.lang.String |
toString() |
protected gnu.trove.map.hash.TIntLongHashMap cardinalities
protected long size
public void clear()
public boolean add(int element)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean add(int element, long cardinality)
public boolean remove(int element, long cardinality)
public boolean remove(int element)
public boolean addAll(java.util.Collection<java.lang.Integer> collection)
collection
- public boolean addAll(java.util.Collection<java.lang.Integer> collection, long cardinality)
collection
- cardinality
- public boolean addAll(gnu.trove.TIntCollection collection)
public boolean addAll(MultiIntSet collection)
public void empty()
public long size()
public boolean isEmpty()
public int setSize()
public gnu.trove.set.TIntSet toSet()
public boolean contains(int a)
public long getCardinalityOf(int e)
public java.util.Iterator<java.lang.Integer> iterator()
iterator
in interface java.lang.Iterable<java.lang.Integer>
public MultiIntSet copy()
public int getElementWithHighestCardinality()
public java.lang.String toString()
toString
in class java.lang.Object
public MultiIntSet clone()
clone
in class java.lang.Object
public int[] sortByCardinality()