public abstract class Container extends Object implements Iterable<Short>, Cloneable, Externalizable
| Constructor and Description |
|---|
Container() |
| Modifier and Type | Method and Description |
|---|---|
abstract Container |
add(int begin,
int end)
Return a new container with all shorts in [begin,end)
added using an unsigned interpretation.
|
abstract Container |
add(short x)
Add a short to the container.
|
abstract Container |
and(ArrayContainer x)
Computes the bitwise AND of this container with another
(intersection).
|
abstract Container |
and(BitmapContainer x)
Computes the bitwise AND of this container with another
(intersection).
|
Container |
and(Container x)
Computes the bitwise AND of this container with another
(intersection).
|
abstract Container |
and(RunContainer x)
Computes the bitwise AND of this container with another
(intersection).
|
abstract Container |
andNot(ArrayContainer x)
Computes the bitwise ANDNOT of this container with another
(difference).
|
abstract Container |
andNot(BitmapContainer x)
Computes the bitwise ANDNOT of this container with another
(difference).
|
Container |
andNot(Container x)
Computes the bitwise ANDNOT of this container with another
(difference).
|
abstract Container |
andNot(RunContainer x)
Computes the bitwise ANDNOT of this container with another
(difference).
|
abstract void |
clear()
Empties the container
|
abstract Container |
clone() |
abstract boolean |
contains(short x)
Checks whether the contain contains the provided value
|
abstract void |
deserialize(DataInput in)
Deserialize (recover) the container.
|
abstract 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.
|
abstract Container |
flip(short x)
Add a short to the container if it is not present, otherwise remove it.
|
protected abstract int |
getArraySizeInBytes()
Size of the underlying array
|
abstract int |
getCardinality()
Computes the distinct number of short values in the container.
|
String |
getContainerName()
Get the name of this container.
|
abstract ShortIterator |
getReverseShortIterator()
Iterator to visit the short values in the container in descending order.
|
abstract ShortIterator |
getShortIterator()
Iterator to visit the short values in the container in ascending order.
|
abstract int |
getSizeInBytes()
Computes an estimate of the memory usage of this container.
|
abstract Container |
iadd(int begin,
int end)
Add all shorts in [begin,end) using an unsigned interpretation.
|
abstract Container |
iand(ArrayContainer x)
Computes the in-place bitwise AND of this container with another
(intersection).
|
abstract Container |
iand(BitmapContainer x)
Computes the in-place bitwise AND of this container with another
(intersection).
|
Container |
iand(Container x)
Computes the in-place bitwise AND of this container with another
(intersection).
|
abstract Container |
iand(RunContainer x)
Computes the in-place bitwise AND of this container with another
(intersection).
|
abstract Container |
iandNot(ArrayContainer x)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
abstract Container |
iandNot(BitmapContainer x)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
Container |
iandNot(Container x)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
abstract Container |
iandNot(RunContainer x)
Computes the in-place bitwise ANDNOT of this container with another
(difference).
|
abstract Container |
inot(int rangeStart,
int rangeEnd)
Computes the in-place bitwise NOT of this container (complement).
|
abstract boolean |
intersects(ArrayContainer x)
Returns true if the current container intersects the other container.
|
abstract boolean |
intersects(BitmapContainer x)
Returns true if the current container intersects the other container.
|
boolean |
intersects(Container x)
Returns true if the current container intersects the other container.
|
abstract boolean |
intersects(RunContainer x)
Returns true if the current container intersects the other container.
|
abstract Container |
ior(ArrayContainer x)
Computes the in-place bitwise OR of this container with another
(union).
|
abstract Container |
ior(BitmapContainer x)
Computes the in-place bitwise OR of this container with another
(union).
|
Container |
ior(Container x)
Computes the in-place bitwise OR of this container with another
(union).
|
abstract Container |
ior(RunContainer x)
Computes the in-place bitwise OR of this container with another
(union).
|
abstract Container |
iremove(int begin,
int end)
Remove shorts in [begin,end) using an unsigned interpretation.
|
abstract Container |
ixor(ArrayContainer x)
Computes the in-place bitwise XOR of this container with another
(symmetric difference).
|
abstract Container |
ixor(BitmapContainer x)
Computes the in-place bitwise XOR of this container with another
(symmetric difference).
|
Container |
ixor(Container x)
Computes the in-place bitwise OR of this container with another
(union).
|
abstract Container |
ixor(RunContainer x)
Computes the in-place bitwise XOR of this container with another
(symmetric difference).
|
Container |
lazyIOR(Container x)
Computes the in-place bitwise OR of this container with another
(union).
|
Container |
lazyOR(Container x)
Computes the bitwise OR of this container with another (union).
|
abstract Container |
limit(int maxcardinality)
Create a new Container containing at most maxcardinality integers.
|
abstract Container |
not(int rangeStart,
int rangeEnd)
Computes the bitwise NOT of this container (complement).
|
abstract Container |
or(ArrayContainer x)
Computes the bitwise OR of this container with another (union).
|
abstract Container |
or(BitmapContainer x)
Computes the bitwise OR of this container with another (union).
|
Container |
or(Container x)
Computes the bitwise OR of this container with another (union).
|
abstract Container |
or(RunContainer x)
Computes the bitwise OR of this container with another (union).
|
static Container |
rangeOfOnes(int start,
int last)
Create a container initialized with a range of consecutive values
|
abstract int |
rank(short lowbits)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).
|
abstract Container |
remove(int begin,
int end)
Return a new container with all shorts in [begin,end)
remove using an unsigned interpretation.
|
abstract Container |
remove(short x)
Remove the short from this container.
|
abstract Container |
repairAfterLazy()
The output of a lazyOR or lazyIOR might be an invalid container, this
should be called on it.
|
abstract Container |
runOptimize()
Convert to RunContainers, when the result is smaller.
|
abstract short |
select(int j)
Return the jth value
|
abstract void |
serialize(DataOutput out)
Serialize the container.
|
abstract int |
serializedSizeInBytes()
Report the number of bytes required to serialize this container.
|
abstract void |
trim()
If possible, recover wasted memory.
|
protected abstract void |
writeArray(DataOutput out)
Write just the underlying array.
|
abstract Container |
xor(ArrayContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
abstract Container |
xor(BitmapContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
Container |
xor(Container x)
Computes the bitwise OR of this container with another (symmetric difference).
|
abstract Container |
xor(RunContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, iterator, spliteratorreadExternal, writeExternalpublic String getContainerName()
public static Container rangeOfOnes(int start, int last)
start - first indexlast - last index (range is exclusive)public abstract Container add(short x)
x - short to be addedpublic abstract Container and(ArrayContainer x)
x - other containerpublic abstract Container and(BitmapContainer x)
x - other containerpublic abstract Container and(RunContainer x)
x - other containerpublic Container and(Container x)
x - other containerpublic abstract Container andNot(ArrayContainer x)
x - other containerpublic abstract Container andNot(BitmapContainer x)
x - other containerpublic abstract Container andNot(RunContainer x)
x - other containerpublic Container andNot(Container x)
x - other containerpublic abstract void clear()
public abstract boolean contains(short x)
x - value to checkpublic abstract void deserialize(DataInput in) throws IOException
in - the DataInput streamIOException - Signals that an I/O exception has occurred.public abstract void fillLeastSignificant16bits(int[] x,
int i,
int mask)
x - provided arrayi - starting indexmask - indicates most significant bitspublic abstract Container flip(short x)
x - short to be addedprotected abstract int getArraySizeInBytes()
public abstract int getCardinality()
public abstract ShortIterator getShortIterator()
public abstract ShortIterator getReverseShortIterator()
public abstract int getSizeInBytes()
public abstract Container iand(ArrayContainer x)
x - other containerpublic abstract Container iand(BitmapContainer x)
x - other containerpublic abstract Container iand(RunContainer x)
x - other containerpublic Container iand(Container x)
x - other containerpublic abstract Container iandNot(ArrayContainer x)
x - other containerpublic abstract Container iandNot(BitmapContainer x)
x - other containerpublic abstract Container iandNot(RunContainer x)
x - other containerpublic Container iandNot(Container x)
x - other containerpublic abstract Container inot(int rangeStart, int rangeEnd)
rangeStart - beginning of range (inclusive); 0 is beginning of this
container.rangeEnd - ending of range (exclusive)public boolean intersects(Container x)
x - other containerpublic abstract boolean intersects(ArrayContainer x)
x - other containerpublic abstract boolean intersects(BitmapContainer x)
x - other containerpublic abstract boolean intersects(RunContainer x)
x - other containerpublic abstract Container ior(ArrayContainer x)
x - other containerpublic abstract Container ior(BitmapContainer x)
x - other containerpublic abstract Container ior(RunContainer x)
x - other containerpublic Container ior(Container x)
x - other containerpublic abstract Container ixor(ArrayContainer x)
x - other containerpublic abstract Container ixor(BitmapContainer x)
x - other containerpublic abstract Container ixor(RunContainer x)
x - other containerpublic Container ixor(Container x)
x - other containerpublic Container lazyOR(Container x)
x - other containerpublic Container lazyIOR(Container x)
x - other containerpublic abstract Container repairAfterLazy()
public abstract Container not(int rangeStart, int rangeEnd)
rangeStart - beginning of range (inclusive); 0 is beginning of this
container.rangeEnd - ending of range (exclusive)public abstract Container or(ArrayContainer x)
x - other containerpublic abstract Container or(BitmapContainer x)
x - other containerpublic abstract Container or(RunContainer x)
x - other containerpublic Container or(Container x)
x - other containerpublic abstract Container remove(short x)
x - to be removedpublic abstract void serialize(DataOutput out) throws IOException
out - the DataOutput streamIOException - Signals that an I/O exception has occurred.public abstract int serializedSizeInBytes()
public abstract void trim()
protected abstract void writeArray(DataOutput out) throws IOException
out - output streamIOException - in case of failurepublic abstract Container xor(ArrayContainer x)
x - other containerpublic abstract Container xor(BitmapContainer x)
x - other containerpublic abstract Container xor(RunContainer x)
x - other containerpublic Container xor(Container x)
x - other parameterpublic abstract int rank(short lowbits)
lowbits - upper limitpublic abstract short select(int j)
j - index of the valuepublic abstract Container limit(int maxcardinality)
maxcardinality - maximal cardinalitypublic abstract Container iadd(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container iremove(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container add(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container remove(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container runOptimize()
Copyright © 2015. All Rights Reserved.