|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.roaringbitmap.buffer.Container
org.roaringbitmap.buffer.BitmapContainer
public final class BitmapContainer
Simple bitset-like container. Unlike org.roaringbitmap.BitmapContainer, this class uses a LongBuffer to store data.
Field Summary | |
---|---|
protected static int |
maxcapacity
|
Constructor Summary | |
---|---|
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 |
|
BitmapContainer(LongBuffer array,
int cardinality)
Construct a new BitmapContainer backed by the provided LongBuffer. |
Method Summary | |
---|---|
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()
|
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()
|
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). |
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 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). |
void |
readExternal(ObjectInput in)
|
Container |
remove(short i)
Remove the short from 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). |
Methods inherited from class org.roaringbitmap.buffer.Container |
---|
and, andNot, iand, iandNot, ior, ixor, or, rangeOfOnes, xor |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static int maxcapacity
Constructor Detail |
---|
public BitmapContainer()
public BitmapContainer(int firstOfRun, int lastOfRun)
firstOfRun
- first indexlastOfRun
- last index (range is inclusive)public BitmapContainer(LongBuffer array, int cardinality)
array
- LongBuffer where the data is storedcardinality
- cardinality (number of values stored)Method Detail |
---|
public Container add(short i)
Container
add
in class Container
i
- short to be added
public ArrayContainer and(ArrayContainer value2)
Container
and
in class Container
value2
- other container
public Container and(BitmapContainer value2)
Container
and
in class Container
value2
- other container
public Container andNot(ArrayContainer value2)
Container
andNot
in class Container
value2
- other container
public Container andNot(BitmapContainer value2)
Container
andNot
in class Container
value2
- other container
public void clear()
Container
clear
in class Container
public BitmapContainer clone()
clone
in class Container
public boolean contains(short i)
Container
contains
in class Container
i
- value to check
public boolean equals(Object o)
equals
in class Object
protected void fillArray(short[] array)
array
- container (should be sufficiently large)public void fillLeastSignificant16bits(int[] x, int i, int mask)
Container
fillLeastSignificant16bits
in class Container
x
- provided arrayi
- starting indexmask
- indicates most significant bitsprotected int getArraySizeInBytes()
Container
getArraySizeInBytes
in class Container
public int getCardinality()
Container
getCardinality
in class Container
public ShortIterator getShortIterator()
Container
getShortIterator
in class Container
public int getSizeInBytes()
Container
getSizeInBytes
in class Container
public int hashCode()
hashCode
in class Object
public Container iand(ArrayContainer B2)
Container
iand
in class Container
B2
- other container
public Container iand(BitmapContainer B2)
Container
iand
in class Container
B2
- other container
public Container iandNot(ArrayContainer B2)
Container
iandNot
in class Container
B2
- other container
public Container iandNot(BitmapContainer B2)
Container
iandNot
in class Container
B2
- other container
public Container inot(int firstOfRange, int lastOfRange)
Container
inot
in class Container
firstOfRange
- beginning of range (inclusive); 0 is beginning of this
container.lastOfRange
- ending of range (exclusive)
public BitmapContainer ior(ArrayContainer value2)
Container
ior
in class Container
value2
- other container
public Container ior(BitmapContainer B2)
Container
ior
in class Container
B2
- other container
public Iterator<Short> iterator()
iterator
in interface Iterable<Short>
public Container ixor(ArrayContainer value2)
Container
ixor
in class Container
value2
- other container
public Container ixor(BitmapContainer B2)
Container
ixor
in class Container
B2
- other container
protected void loadData(ArrayContainer arrayContainer)
public int nextSetBit(int i)
i
- starting index
public short nextUnsetBit(int i)
i
- starting index
public Container not(int firstOfRange, int lastOfRange)
Container
not
in class Container
firstOfRange
- beginning of range (inclusive); 0 is beginning of this
container.lastOfRange
- ending of range (exclusive)
public BitmapContainer or(ArrayContainer value2)
Container
or
in class Container
value2
- other container
public Container or(BitmapContainer value2)
Container
or
in class Container
value2
- other container
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public Container remove(short i)
Container
remove
in class Container
i
- to be removed
public ArrayContainer toArrayContainer()
public String toString()
toString
in class Object
public void trim()
Container
trim
in class Container
protected void writeArray(DataOutput out) throws IOException
Container
writeArray
in class Container
out
- output stream
IOException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public Container xor(ArrayContainer value2)
Container
xor
in class Container
value2
- other container
public Container xor(BitmapContainer value2)
Container
xor
in class Container
value2
- other container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |