public final class BitmapContainer extends Container implements Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_CAPACITY |
| Modifier | Constructor and Description |
|---|---|
|
BitmapContainer()
Create a bitmap container with all bits set to false
|
|
BitmapContainer(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
|
protected |
BitmapContainer(long[] newBitmap,
int newCardinality) |
| Modifier and Type | Method and Description |
|---|---|
Container |
add(short i)
Add a short to the container.
|
ArrayContainer |
and(ArrayContainer value2)
Computes the bitwise AND of this container with another
(intersection).
|
Container |
and(BitmapContainer value2)
Computes the bitwise AND of this container with another
(intersection).
|
Container |
andNot(ArrayContainer value2)
Computes the bitwise ANDNOT of this container with another
(difference).
|
Container |
andNot(BitmapContainer value2)
Computes the bitwise ANDNOT of this container with another
(difference).
|
void |
clear()
Empties the container
|
BitmapContainer |
clone() |
protected void |
computeCardinality() |
boolean |
contains(short i)
Checks whether the contain contains the provided value
|
void |
deserialize(DataInput in)
Deserialize (recover) the container.
|
boolean |
equals(Object o) |
protected void |
fillArray(int[] array)
Fill the array with set bits
|
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() |
Container |
iand(ArrayContainer b2)
Computes the in-place bitwise AND of this container with another
(intersection).
|
Container |
iand(BitmapContainer b2)
Computes the in-place bitwise AND of this container with another
(intersection).
|
Container |
iandNot(ArrayContainer b2)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
Container |
iandNot(BitmapContainer b2)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
protected Container |
ilazyor(ArrayContainer value2) |
protected Container |
ilazyor(BitmapContainer x) |
Container |
inot(int firstOfRange,
int lastOfRange)
Computes the in-place bitwise NOT of this container (complement).
|
BitmapContainer |
ior(ArrayContainer value2)
Computes the in-place bitwise OR of this container with another
(union).
|
Container |
ior(BitmapContainer b2)
Computes the in-place bitwise OR of this container with another
(union).
|
Iterator<Short> |
iterator() |
Container |
ixor(ArrayContainer value2)
Computes the in-place bitwise OR of this container with another
(union).
|
Container |
ixor(BitmapContainer b2)
Computes the in-place bitwise OR of this container with another
(union).
|
protected Container |
lazyor(ArrayContainer value2) |
protected Container |
lazyor(BitmapContainer x) |
Container |
limit(int maxcardinality)
Create a new Container containing at most maxcardinality integers.
|
protected void |
loadData(ArrayContainer 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.
|
Container |
not(int firstOfRange,
int lastOfRange)
Computes the bitwise NOT of this container (complement).
|
BitmapContainer |
or(ArrayContainer value2)
Computes the bitwise OR of this container with another (union).
|
Container |
or(BitmapContainer 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) |
Container |
remove(short i)
Remove the short from this container.
|
short |
select(int j)
Return the jth value
|
void |
serialize(DataOutput out)
Serialize the container.
|
int |
serializedSizeInBytes()
Report the number of bytes required to serialize this container.
|
ArrayContainer |
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) |
Container |
xor(ArrayContainer value2)
Computes the bitwise OR of this container with another (union).
|
Container |
xor(BitmapContainer 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 BitmapContainer()
public BitmapContainer(int firstOfRun,
int lastOfRun)
firstOfRun - first indexlastOfRun - last index (range is inclusive)protected BitmapContainer(long[] newBitmap,
int newCardinality)
public Container add(short i)
Containerpublic ArrayContainer and(ArrayContainer value2)
Containerpublic Container and(BitmapContainer value2)
Containerpublic Container andNot(ArrayContainer value2)
Containerpublic Container andNot(BitmapContainer value2)
Containerpublic void clear()
Containerpublic BitmapContainer clone()
public boolean contains(short i)
Containerpublic void deserialize(DataInput in) throws IOException
Containerdeserialize in class Containerin - the DataInput streamIOException - Signals that an I/O exception has occurred.protected void fillArray(int[] array)
array - container (should be sufficiently large)protected void fillArray(short[] array)
array - container (should be sufficiently large)public void fillLeastSignificant16bits(int[] x,
int i,
int mask)
ContainerfillLeastSignificant16bits in class Containerx - provided arrayi - starting indexmask - indicates most significant bitsprotected int getArraySizeInBytes()
ContainergetArraySizeInBytes in class Containerpublic int getCardinality()
ContainergetCardinality in class Containerpublic ShortIterator getShortIterator()
ContainergetShortIterator in class Containerpublic int getSizeInBytes()
ContainergetSizeInBytes in class Containerpublic Container iand(ArrayContainer b2)
Containerpublic Container iand(BitmapContainer b2)
Containerpublic Container iandNot(ArrayContainer b2)
Containerpublic Container iandNot(BitmapContainer b2)
Containerpublic Container inot(int firstOfRange, int lastOfRange)
Containerpublic BitmapContainer ior(ArrayContainer value2)
Containerpublic Container ior(BitmapContainer b2)
Containerpublic Container ixor(ArrayContainer value2)
Containerpublic Container ixor(BitmapContainer b2)
Containerprotected void loadData(ArrayContainer arrayContainer)
public int nextSetBit(int i)
i - starting indexpublic short nextUnsetBit(int i)
i - starting indexpublic Container not(int firstOfRange, int lastOfRange)
Containerpublic BitmapContainer or(ArrayContainer value2)
Containerpublic Container or(BitmapContainer value2)
Containerpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic Container remove(short i)
Containerpublic void serialize(DataOutput out) throws IOException
Containerserialize in class Containerout - the DataOutput streamIOException - Signals that an I/O exception has occurred.public int serializedSizeInBytes()
ContainerserializedSizeInBytes in class Containerpublic ArrayContainer toArrayContainer()
public void trim()
Containerprotected void writeArray(DataOutput out) throws IOException
ContainerwriteArray in class Containerout - output streamIOException - in case of failurepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic Container xor(ArrayContainer value2)
Containerpublic Container xor(BitmapContainer value2)
Containerprotected Container ilazyor(ArrayContainer value2)
protected Container ilazyor(BitmapContainer x)
protected Container lazyor(ArrayContainer value2)
protected Container lazyor(BitmapContainer x)
protected void computeCardinality()
public int rank(short lowbits)
Containerpublic short select(int j)
ContainerCopyright © 2014. All Rights Reserved.