public final class MappeableBitmapContainer extends MappeableContainer implements Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_CAPACITY |
| Constructor and Description |
|---|
MappeableBitmapContainer()
Create a bitmap container with all bits set to false
|
MappeableBitmapContainer(int firstOfRun,
int lastOfRun)
Create a bitmap container with a run of ones from firstOfRun to
lastOfRun, inclusive caller must ensure that the range isn't so small
that an ArrayContainer should have been created instead
|
MappeableBitmapContainer(LongBuffer array,
int initCardinality)
Construct a new BitmapContainer backed by the provided LongBuffer.
|
| Modifier and Type | Method and Description |
|---|---|
MappeableContainer |
add(short i)
Add a short to the container.
|
MappeableArrayContainer |
and(MappeableArrayContainer value2)
Computes the bitwise AND of this container with another (intersection).
|
MappeableContainer |
and(MappeableBitmapContainer value2)
Computes the bitwise AND of this container with another (intersection).
|
MappeableContainer |
andNot(MappeableArrayContainer value2)
Computes the bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
andNot(MappeableBitmapContainer value2)
Computes the bitwise ANDNOT of this container with another (difference).
|
void |
clear()
Empties the container
|
MappeableBitmapContainer |
clone() |
protected void |
computeCardinality() |
boolean |
contains(short i)
Checks whether the contain contains the provided value
|
boolean |
equals(Object o) |
protected void |
fillArray(short[] array)
Fill the array with set bits
|
void |
fillLeastSignificant16bits(int[] x,
int i,
int mask)
Fill the least significant 16 bits of the integer array, starting at
index index, with the short values from this container.
|
protected int |
getArraySizeInBytes()
Size of the underlying array
|
int |
getCardinality()
Computes the distinct number of short values in the container.
|
ShortIterator |
getShortIterator()
Iterator to visit the short values in the container
|
int |
getSizeInBytes()
Computes an estimate of the memory usage of this container.
|
int |
hashCode() |
MappeableContainer |
iand(MappeableArrayContainer b2)
Computes the in-place bitwise AND of this container with another
(intersection).
|
MappeableContainer |
iand(MappeableBitmapContainer b2)
Computes the in-place bitwise AND of this container with another
(intersection).
|
MappeableContainer |
iandNot(MappeableArrayContainer b2)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
MappeableContainer |
iandNot(MappeableBitmapContainer b2)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
protected MappeableContainer |
ilazyor(MappeableArrayContainer value2) |
protected MappeableContainer |
ilazyor(MappeableBitmapContainer x) |
MappeableContainer |
inot(int firstOfRange,
int lastOfRange)
Computes the in-place bitwise NOT of this container (complement).
|
MappeableBitmapContainer |
ior(MappeableArrayContainer value2)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
ior(MappeableBitmapContainer b2)
Computes the in-place bitwise OR of this container with another (union).
|
Iterator<Short> |
iterator() |
MappeableContainer |
ixor(MappeableArrayContainer value2)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
ixor(MappeableBitmapContainer b2)
Computes the in-place bitwise OR of this container with another (union).
|
protected MappeableContainer |
lazyor(MappeableArrayContainer value2) |
protected MappeableContainer |
lazyor(MappeableBitmapContainer x) |
MappeableContainer |
limit(int maxcardinality)
Create a new MappeableContainer containing at most maxcardinality integers.
|
protected void |
loadData(MappeableArrayContainer arrayContainer) |
int |
nextSetBit(int i)
Find the index of the next set bit greater or equal to i, returns -1 if
none found.
|
short |
nextUnsetBit(int i)
Find the index of the next unset bit greater or equal to i, returns -1 if
none found.
|
MappeableContainer |
not(int firstOfRange,
int lastOfRange)
Computes the bitwise NOT of this container (complement).
|
MappeableBitmapContainer |
or(MappeableArrayContainer value2)
Computes the bitwise OR of this container with another (union).
|
MappeableContainer |
or(MappeableBitmapContainer value2)
Computes the bitwise OR of this container with another (union).
|
int |
rank(short lowbits)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).
|
void |
readExternal(ObjectInput in) |
MappeableContainer |
remove(short i)
Remove the short from this container.
|
short |
select(int j)
Return the jth value
|
MappeableArrayContainer |
toArrayContainer()
Copies the data to an array container
|
String |
toString() |
void |
trim()
If possible, recover wasted memory.
|
protected void |
writeArray(DataOutput out)
Write just the underlying array.
|
void |
writeExternal(ObjectOutput out) |
MappeableContainer |
xor(MappeableArrayContainer value2)
Computes the bitwise OR of this container with another (union).
|
MappeableContainer |
xor(MappeableBitmapContainer value2)
Computes the bitwise OR of this container with another (union).
|
and, andNot, iand, iandNot, ior, ixor, lazyIOR, lazyOR, or, rangeOfOnes, xorfinalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected static final int MAX_CAPACITY
public MappeableBitmapContainer()
public MappeableBitmapContainer(int firstOfRun,
int lastOfRun)
firstOfRun - first indexlastOfRun - last index (range is inclusive)public MappeableBitmapContainer(LongBuffer array, int initCardinality)
array - LongBuffer where the data is storedinitCardinality - cardinality (number of values stored)public MappeableContainer add(short i)
MappeableContaineradd in class MappeableContaineri - short to be addedpublic MappeableArrayContainer and(MappeableArrayContainer value2)
MappeableContainerand in class MappeableContainervalue2 - other containerpublic MappeableContainer and(MappeableBitmapContainer value2)
MappeableContainerand in class MappeableContainervalue2 - other containerpublic MappeableContainer andNot(MappeableArrayContainer value2)
MappeableContainerandNot in class MappeableContainervalue2 - other containerpublic MappeableContainer andNot(MappeableBitmapContainer value2)
MappeableContainerandNot in class MappeableContainervalue2 - other containerpublic void clear()
MappeableContainerclear in class MappeableContainerpublic MappeableBitmapContainer clone()
clone in class MappeableContainerpublic boolean contains(short i)
MappeableContainercontains in class MappeableContaineri - value to checkprotected void fillArray(short[] array)
array - container (should be sufficiently large)public void fillLeastSignificant16bits(int[] x,
int i,
int mask)
MappeableContainerfillLeastSignificant16bits in class MappeableContainerx - provided arrayi - starting indexmask - indicates most significant bitsprotected int getArraySizeInBytes()
MappeableContainergetArraySizeInBytes in class MappeableContainerpublic int getCardinality()
MappeableContainergetCardinality in class MappeableContainerpublic ShortIterator getShortIterator()
MappeableContainergetShortIterator in class MappeableContainerpublic int getSizeInBytes()
MappeableContainergetSizeInBytes in class MappeableContainerpublic MappeableContainer iand(MappeableArrayContainer b2)
MappeableContaineriand in class MappeableContainerb2 - other containerpublic MappeableContainer iand(MappeableBitmapContainer b2)
MappeableContaineriand in class MappeableContainerb2 - other containerpublic MappeableContainer iandNot(MappeableArrayContainer b2)
MappeableContaineriandNot in class MappeableContainerb2 - other containerpublic MappeableContainer iandNot(MappeableBitmapContainer b2)
MappeableContaineriandNot in class MappeableContainerb2 - other containerpublic MappeableContainer inot(int firstOfRange, int lastOfRange)
MappeableContainerinot in class MappeableContainerfirstOfRange - beginning of range (inclusive); 0 is beginning of this
container.lastOfRange - ending of range (exclusive)public MappeableBitmapContainer ior(MappeableArrayContainer value2)
MappeableContainerior in class MappeableContainervalue2 - other containerpublic MappeableContainer ior(MappeableBitmapContainer b2)
MappeableContainerior in class MappeableContainerb2 - other containerpublic MappeableContainer ixor(MappeableArrayContainer value2)
MappeableContainerixor in class MappeableContainervalue2 - other containerpublic MappeableContainer ixor(MappeableBitmapContainer b2)
MappeableContainerixor in class MappeableContainerb2 - other containerprotected void loadData(MappeableArrayContainer arrayContainer)
public int nextSetBit(int i)
i - starting indexpublic short nextUnsetBit(int i)
i - starting indexpublic MappeableContainer not(int firstOfRange, int lastOfRange)
MappeableContainernot in class MappeableContainerfirstOfRange - beginning of range (inclusive); 0 is beginning of this
container.lastOfRange - ending of range (exclusive)public MappeableBitmapContainer or(MappeableArrayContainer value2)
MappeableContaineror in class MappeableContainervalue2 - other containerpublic MappeableContainer or(MappeableBitmapContainer value2)
MappeableContaineror in class MappeableContainervalue2 - other containerpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic MappeableContainer remove(short i)
MappeableContainerremove in class MappeableContaineri - to be removedpublic MappeableArrayContainer toArrayContainer()
public void trim()
MappeableContainertrim in class MappeableContainerprotected void writeArray(DataOutput out) throws IOException
MappeableContainerwriteArray in class MappeableContainerout - output streamIOException - in case of failurepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic MappeableContainer xor(MappeableArrayContainer value2)
MappeableContainerxor in class MappeableContainervalue2 - other containerpublic MappeableContainer xor(MappeableBitmapContainer value2)
MappeableContainerxor in class MappeableContainervalue2 - other containerprotected MappeableContainer ilazyor(MappeableArrayContainer value2)
protected MappeableContainer ilazyor(MappeableBitmapContainer x)
protected MappeableContainer lazyor(MappeableArrayContainer value2)
protected MappeableContainer lazyor(MappeableBitmapContainer x)
protected void computeCardinality()
public int rank(short lowbits)
MappeableContainerrank in class MappeableContainerlowbits - upper limitpublic short select(int j)
MappeableContainerselect in class MappeableContainerj - index of the valuepublic MappeableContainer limit(int maxcardinality)
MappeableContainerlimit in class MappeableContainermaxcardinality - maximal cardinalityCopyright © 2014. All Rights Reserved.