Class ConciseSet
java.lang.Object
org.apache.druid.extendedset.intset.AbstractIntSet
org.apache.druid.extendedset.intset.ConciseSet
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IntSet>,IntSet
This is CONCISE: COmpressed 'N' Composable Integer SEt.
This class is an instance of
IntSet internally represented by
compressed bitmaps though a RLE (Run-Length Encoding) compression algorithm.
See
http://ricerca.mat.uniroma3.it/users/dipietro/publications/0020-0190.pdf
for more details.
Notice that the iterator by iterator() is fail-fast,
similar to most Collection-derived classes. If the set is
structurally modified at any time after the iterator is created, the iterator
will throw a ConcurrentModificationException. Thus, in the face of
concurrent modification, the iterator fails quickly and cleanly, rather than
risking arbitrary, non-deterministic behavior at an undetermined time in the
future. The iterator throws a ConcurrentModificationException on a
best-effort basis. Therefore, it would be wrong to write a program that
depended on this exception for its correctness: the fail-fast behavior of
iterators should be used only to detect bugs.- Version:
- $Id$
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.extendedset.intset.IntSet
IntSet.IntIterator -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty integer setConciseSet(boolean simulateWAH) Creates an empty integer setConciseSet(int[] words, boolean simulateWAH) -
Method Summary
Methods inherited from class org.apache.druid.extendedset.intset.AbstractIntSet
toString
-
Constructor Details
-
ConciseSet
public ConciseSet()Creates an empty integer set -
ConciseSet
public ConciseSet(boolean simulateWAH) Creates an empty integer set- Parameters:
simulateWAH-trueif the class must simulate the behavior of WAH
-
ConciseSet
public ConciseSet(int[] words, boolean simulateWAH)
-
-
Method Details
-
clone
See theclone()ofObject- Specified by:
clonein interfaceIntSet- Specified by:
clonein classAbstractIntSet- Returns:
- cloned object
-
getWords
public int[] getWords() -
intersection
-
iterator
- Specified by:
iteratorin interfaceIntSet- Specified by:
iteratorin classAbstractIntSet- Returns:
- a
IntSet.IntIteratorinstance to iterate over the set
-
descendingIterator
- Specified by:
descendingIteratorin interfaceIntSet- Specified by:
descendingIteratorin classAbstractIntSet- Returns:
- a
IntSet.IntIteratorinstance to iterate over the set in descending order
-
clear
public void clear() -
convert
-
add
public boolean add(int e) -
remove
public boolean remove(int o) -
contains
public boolean contains(int o) -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIntSet- Specified by:
isEmptyin classAbstractIntSet- Returns:
- true if this set contains no elements
-
addAll
-
size
public int size()- Specified by:
sizein interfaceIntSet- Specified by:
sizein classAbstractIntSet- Returns:
- the number of elements in this set (its cardinality)
-
empty
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractIntSet
-
equals
- Overrides:
equalsin classAbstractIntSet
-
compareTo
- Specified by:
compareToin interfaceComparable<IntSet>- Overrides:
compareToin classAbstractIntSet
-