public final class ArrayContainer extends Container implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
cardinality |
protected ShortBuffer |
content |
protected static int |
DEFAULTMAXSIZE |
Constructor and Description |
---|
ArrayContainer()
Create an array container with default capacity
|
ArrayContainer(int capacity)
Create an array container with specified capacity
|
ArrayContainer(int firstOfRun,
int lastOfRun)
Create an array container with a run of ones from firstOfRun to
lastOfRun, inclusive.
|
ArrayContainer(ShortBuffer array,
int cardinality)
Construct a new ArrayContainer backed by the provided ShortBuffer.
|
Modifier and Type | Method and Description |
---|---|
Container |
add(short x)
running time is in O(n) time if insert is not in order.
|
ArrayContainer |
and(ArrayContainer value2)
Computes the bitwise AND of this container with another
(intersection).
|
Container |
and(BitmapContainer x)
Computes the bitwise AND of this container with another
(intersection).
|
ArrayContainer |
andNot(ArrayContainer value2)
Computes the bitwise ANDNOT of this container with another
(difference).
|
ArrayContainer |
andNot(BitmapContainer value2)
Computes the bitwise ANDNOT of this container with another
(difference).
|
void |
clear()
Empties the container
|
ArrayContainer |
clone() |
boolean |
contains(short x)
Checks whether the contain contains the provided value
|
boolean |
equals(Object o) |
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() |
ArrayContainer |
iand(ArrayContainer value2)
Computes the in-place bitwise AND of this container with another
(intersection).
|
Container |
iand(BitmapContainer value2)
Computes the in-place bitwise AND of this container with another
(intersection).
|
ArrayContainer |
iandNot(ArrayContainer value2)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
ArrayContainer |
iandNot(BitmapContainer value2)
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).
|
Container |
ior(ArrayContainer value2)
Computes the in-place bitwise OR of this container with another
(union).
|
Container |
ior(BitmapContainer x)
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 x)
Computes the in-place bitwise OR of this container with another
(union).
|
protected void |
loadData(BitmapContainer bitmapContainer) |
Container |
not(int firstOfRange,
int lastOfRange)
Computes the bitwise NOT of this container (complement).
|
Container |
or(ArrayContainer value2)
Computes the bitwise OR of this container with another (union).
|
Container |
or(BitmapContainer x)
Computes the bitwise OR of this container with another (union).
|
void |
readExternal(ObjectInput in) |
Container |
remove(short x)
Remove the short from this container.
|
BitmapContainer |
toBitmapContainer()
Copies the data in a bitmap 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 x)
Computes the bitwise OR of this container with another (union).
|
and, andNot, iand, iandNot, ior, ixor, or, rangeOfOnes, xor
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected static final int DEFAULTMAXSIZE
protected int cardinality
protected ShortBuffer content
public ArrayContainer()
public ArrayContainer(int capacity)
capacity
- public ArrayContainer(int firstOfRun, int lastOfRun)
firstOfRun
- first indexlastOfRun
- last index (range is inclusive)public ArrayContainer(ShortBuffer array, int cardinality)
array
- ShortBuffer where the data is storedcardinality
- cardinality (number of values stored)public Container add(short x)
public ArrayContainer and(ArrayContainer value2)
Container
public Container and(BitmapContainer x)
Container
public ArrayContainer andNot(ArrayContainer value2)
Container
public ArrayContainer andNot(BitmapContainer value2)
Container
public void clear()
Container
public ArrayContainer clone()
public boolean contains(short x)
Container
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 ArrayContainer iand(ArrayContainer value2)
Container
public Container iand(BitmapContainer value2)
Container
public ArrayContainer iandNot(ArrayContainer value2)
Container
public ArrayContainer iandNot(BitmapContainer value2)
Container
public Container inot(int firstOfRange, int lastOfRange)
Container
public Container ior(ArrayContainer value2)
Container
public Container ior(BitmapContainer x)
Container
public Container ixor(ArrayContainer value2)
Container
public Container ixor(BitmapContainer x)
Container
protected void loadData(BitmapContainer bitmapContainer)
public Container not(int firstOfRange, int lastOfRange)
Container
public Container or(ArrayContainer value2)
Container
public Container or(BitmapContainer x)
Container
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public Container remove(short x)
Container
public BitmapContainer toBitmapContainer()
public void trim()
Container
protected void writeArray(DataOutput out) throws IOException
Container
writeArray
in class Container
out
- output streamIOException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public Container xor(ArrayContainer value2)
Container
public Container xor(BitmapContainer x)
Container
Copyright © 2014. All Rights Reserved.