public final class ArrayContainer extends Container implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected int |
cardinality |
ContainerNames| Modifier | 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(int newCard,
short[] newContent)
Create a new container, no copy is made
|
|
ArrayContainer(MappeableArrayContainer bc)
Creates a new non-mappeable container from a mappeable one.
|
protected |
ArrayContainer(short[] newContent) |
| Modifier and Type | Method and Description |
|---|---|
Container |
add(int begin,
int end)
Return a new container with all shorts in [begin,end) added using an unsigned interpretation.
|
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).
|
Container |
and(RunContainer x)
Computes the bitwise AND of this container with another (intersection).
|
int |
andCardinality(ArrayContainer value2) |
int |
andCardinality(BitmapContainer x) |
int |
andCardinality(RunContainer x) |
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).
|
Container |
andNot(RunContainer x)
Computes the bitwise ANDNOT of this container with another (difference).
|
void |
clear()
Empties the container
|
ArrayContainer |
clone() |
protected boolean |
contains(ArrayContainer arrayContainer) |
protected boolean |
contains(BitmapContainer bitmapContainer) |
protected boolean |
contains(RunContainer runContainer) |
boolean |
contains(short x)
Checks whether the contain contains the provided value
|
void |
deserialize(DataInput in)
Deserialize (recover) the container.
|
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 i, with the short
values from this container.
|
int |
first()
Get the first integer held in the container
|
Container |
flip(short x)
Add a short to the container if it is not present, otherwise remove it.
|
void |
forEach(short msb,
IntConsumer ic)
Iterate through the values of this container and pass them
along to the IntConsumer, using msb as the 16 most significant bits.
|
protected int |
getArraySizeInBytes()
Size of the underlying array
|
int |
getCardinality()
Computes the distinct number of short values in the container.
|
ShortIterator |
getReverseShortIterator()
Iterator to visit the short values in the container in descending order.
|
PeekableShortIterator |
getShortIterator()
Iterator to visit the short values in the container in ascending order.
|
int |
getSizeInBytes()
Computes an estimate of the memory usage of this container.
|
int |
hashCode() |
Container |
iadd(int begin,
int end)
Add all shorts in [begin,end) using an unsigned interpretation.
|
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).
|
Container |
iand(RunContainer x)
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 |
iandNot(RunContainer x)
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).
|
boolean |
intersects(ArrayContainer value2)
Returns true if the current container intersects the other container.
|
boolean |
intersects(BitmapContainer x)
Returns true if the current container intersects the other container.
|
boolean |
intersects(RunContainer x)
Returns true if the current container intersects the other container.
|
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).
|
Container |
ior(RunContainer x)
Computes the in-place bitwise OR of this container with another (union).
|
Container |
iremove(int begin,
int end)
Remove shorts in [begin,end) using an unsigned interpretation.
|
Iterator<Short> |
iterator() |
Container |
ixor(ArrayContainer value2)
Computes the in-place bitwise XOR of this container with another (symmetric difference).
|
Container |
ixor(BitmapContainer x)
Computes the in-place bitwise XOR of this container with another (symmetric difference).
|
Container |
ixor(RunContainer x)
Computes the in-place bitwise XOR of this container with another (symmetric difference).
|
int |
last()
Get the last integer held in the container
|
protected Container |
lazyor(ArrayContainer value2) |
Container |
limit(int maxcardinality)
Create a new Container containing at most maxcardinality integers.
|
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).
|
Container |
or(RunContainer x)
Computes the bitwise OR of this container with another (union).
|
protected Container |
or(ShortIterator it) |
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(int begin,
int end)
Return a new container with all shorts in [begin,end) remove using an unsigned interpretation.
|
Container |
remove(short x)
Remove the short from this container.
|
protected void |
removeAtIndex(int loc) |
Container |
repairAfterLazy()
The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.
|
Container |
runOptimize()
Convert to RunContainers, when the result is smaller.
|
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.
|
protected static int |
serializedSizeInBytes(int cardinality) |
BitmapContainer |
toBitmapContainer()
Copies the data in a bitmap container.
|
MappeableContainer |
toMappeableContainer()
Convert to a mappeable container.
|
ShortBuffer |
toShortBuffer()
Return the content of this container as a ShortBuffer.
|
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 XOR of this container with another (symmetric difference).
|
Container |
xor(BitmapContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
Container |
xor(RunContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
protected Container |
xor(ShortIterator it) |
and, andCardinality, andNot, assertNonEmpty, contains, getContainerName, iand, iandNot, intersects, ior, ixor, lazyIOR, lazyOR, or, rangeOfOnes, xor, xorCardinalityfinalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic ArrayContainer()
public ArrayContainer(int capacity)
capacity - The capacity of the containerpublic ArrayContainer(int firstOfRun,
int lastOfRun)
firstOfRun - first indexlastOfRun - last index (range is exclusive)public ArrayContainer(int newCard,
short[] newContent)
newCard - desired cardinalitynewContent - actual values (length should equal or exceed cardinality)public ArrayContainer(MappeableArrayContainer bc)
bc - the original containerprotected ArrayContainer(short[] newContent)
protected static int serializedSizeInBytes(int cardinality)
public Container add(int begin, int end)
Containerpublic Container add(short x)
public ArrayContainer and(ArrayContainer value2)
Containerpublic Container and(BitmapContainer x)
Containerpublic Container and(RunContainer x)
Containerpublic int andCardinality(ArrayContainer value2)
andCardinality in class Containerpublic int andCardinality(BitmapContainer x)
andCardinality in class Containerpublic int andCardinality(RunContainer x)
andCardinality in class Containerpublic ArrayContainer andNot(ArrayContainer value2)
Containerpublic ArrayContainer andNot(BitmapContainer value2)
Containerpublic Container andNot(RunContainer x)
Containerpublic void clear()
Containerpublic ArrayContainer clone()
public boolean contains(short x)
Containerprotected boolean contains(RunContainer runContainer)
protected boolean contains(ArrayContainer arrayContainer)
protected boolean contains(BitmapContainer bitmapContainer)
public void deserialize(DataInput in) throws IOException
Containerdeserialize in class Containerin - the DataInput streamIOException - Signals that an I/O exception has occurred.public void fillLeastSignificant16bits(int[] x,
int i,
int mask)
ContainerfillLeastSignificant16bits in class Containerx - provided arrayi - starting indexmask - indicates most significant bitspublic Container flip(short x)
Containerprotected int getArraySizeInBytes()
ContainergetArraySizeInBytes in class Containerpublic int getCardinality()
ContainergetCardinality in class Containerpublic ShortIterator getReverseShortIterator()
ContainergetReverseShortIterator in class Containerpublic PeekableShortIterator getShortIterator()
ContainergetShortIterator in class Containerpublic int getSizeInBytes()
ContainergetSizeInBytes in class Containerpublic Container iadd(int begin, int end)
Containerpublic ArrayContainer iand(ArrayContainer value2)
Containerpublic Container iand(BitmapContainer value2)
Containerpublic Container iand(RunContainer x)
Containerpublic ArrayContainer iandNot(ArrayContainer value2)
Containerpublic ArrayContainer iandNot(BitmapContainer value2)
Containerpublic Container iandNot(RunContainer x)
Containerpublic Container inot(int firstOfRange, int lastOfRange)
Containerpublic boolean intersects(ArrayContainer value2)
Containerintersects in class Containervalue2 - other containerpublic boolean intersects(BitmapContainer x)
Containerintersects in class Containerx - other containerpublic boolean intersects(RunContainer x)
Containerintersects in class Containerx - other containerpublic Container ior(ArrayContainer value2)
Containerpublic Container ior(BitmapContainer x)
Containerpublic Container ior(RunContainer x)
Containerpublic Container iremove(int begin, int end)
Containerpublic Container ixor(ArrayContainer value2)
Containerpublic Container ixor(BitmapContainer x)
Containerpublic Container ixor(RunContainer x)
Containerpublic Container limit(int maxcardinality)
Containerprotected void loadData(BitmapContainer bitmapContainer)
public Container not(int firstOfRange, int lastOfRange)
Containerpublic Container or(ArrayContainer value2)
Containerpublic Container or(BitmapContainer x)
Containerpublic Container or(RunContainer x)
Containerprotected Container or(ShortIterator it)
public int rank(short lowbits)
Containerpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic Container remove(int begin, int end)
Containerprotected void removeAtIndex(int loc)
public Container remove(short x)
Containerpublic Container repairAfterLazy()
ContainerrepairAfterLazy in class Containerpublic Container runOptimize()
ContainerrunOptimize in class Containerpublic short select(int j)
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 BitmapContainer toBitmapContainer()
toBitmapContainer in class Containerpublic int first()
Containerpublic int last()
Containerpublic MappeableContainer toMappeableContainer()
ContainertoMappeableContainer in class Containerpublic ShortBuffer toShortBuffer()
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 x)
Containerpublic Container xor(RunContainer x)
Containerprotected Container xor(ShortIterator it)
public void forEach(short msb,
IntConsumer ic)
Containerprotected Container lazyor(ArrayContainer value2)
Copyright © 2017. All rights reserved.