public abstract class Container extends java.lang.Object implements java.lang.Iterable<java.lang.Character>, java.lang.Cloneable, java.io.Externalizable, WordStorage<Container>
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String[] |
ContainerNames
Name of the various possible containers
|
| 构造器和说明 |
|---|
Container() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract Container |
add(char x)
Add a short to the container.
|
abstract Container |
add(int begin,
int end)
Return a new container with all shorts in [begin,end) added using an unsigned interpretation.
|
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).
|
protected abstract int |
andCardinality(ArrayContainer x) |
protected abstract int |
andCardinality(BitmapContainer x) |
int |
andCardinality(Container x)
Computes the bitwise AND of this container with another (intersection).
|
protected abstract int |
andCardinality(RunContainer x) |
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).
|
protected void |
assertNonEmpty(boolean condition)
Throw if the container is empty
|
abstract void |
clear()
Empties the container
|
abstract Container |
clone() |
protected abstract boolean |
contains(ArrayContainer arrayContainer) |
protected abstract boolean |
contains(BitmapContainer bitmapContainer) |
abstract boolean |
contains(char x)
Checks whether the contain contains the provided value
|
boolean |
contains(Container subset)
Checks whether the container is a subset of this container or not
|
abstract boolean |
contains(int minimum,
int supremum)
Checks whether the container contains the entire range
|
protected abstract boolean |
contains(RunContainer runContainer) |
abstract void |
deserialize(java.io.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 int |
first()
Get the first integer held in the container
|
abstract Container |
flip(char x)
Add a short to the container if it is not present, otherwise remove it.
|
abstract void |
forAll(int offset,
RelativeRangeConsumer rrc)
Consume presence information for all values in this container.
|
abstract void |
forAllFrom(char startValue,
RelativeRangeConsumer rrc)
Consume presence information for all values greater or equal to
startValue in this container.
|
abstract void |
forAllInRange(char startValue,
char endValue,
RelativeRangeConsumer rrc)
Consumer presence information for all values in the
range [startValue, endValue) in this container.
|
abstract void |
forAllUntil(int offset,
char endValue,
RelativeRangeConsumer rrc)
Consume presence information for all values smaller than endValue
in this container.
|
abstract void |
forEach(char 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.
|
abstract int |
getArraySizeInBytes()
Size of the underlying array
|
abstract ContainerBatchIterator |
getBatchIterator()
Gets an iterator to visit the contents of the container in batches
|
abstract int |
getCardinality()
Computes the distinct number of char values in the container.
|
abstract PeekableCharIterator |
getCharIterator()
Iterator to visit the char values in the container in ascending order.
|
abstract PeekableCharRankIterator |
getCharRankIterator()
Iterator to visit the short values in container and pre-compute ranks
|
java.lang.String |
getContainerName()
Get the name of this container.
|
abstract PeekableCharIterator |
getReverseCharIterator()
Iterator to visit the char values in the container in descending 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(int minimum,
int supremum)
Checks if the container intersects with a range
|
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).
|
Container |
iorNot(Container x,
int endOfRange)
Computes the in-place bitwise ORNOT of this container with another.
|
abstract Container |
iremove(int begin,
int end)
Remove shorts in [begin,end) using an unsigned interpretation.
|
abstract boolean |
isEmpty()
Checks whether the container is empty or not.
|
abstract boolean |
isFull()
Checks whether the container is full or not.
|
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).
|
abstract int |
last()
Get the last integer held in the container
|
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 int |
nextAbsentValue(char fromValue)
Gets the first absent value greater than or equal to the lower bound.
|
abstract int |
nextValue(char fromValue)
Gets the first value greater than or equal to the lower bound, or -1 if no such value exists.
|
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).
|
Container |
orNot(Container x,
int endOfRange)
Computes the bitwise ORNOT of this container with another.
|
abstract int |
previousAbsentValue(char fromValue)
Gets the last value less than or equal to the upper bound.
|
abstract int |
previousValue(char fromValue)
Gets the last value less than or equal to the upper bound, or -1 if no such value exists.
|
static Container |
rangeOfOnes(int start,
int last)
Create a container initialized with a range of consecutive values
|
abstract int |
rank(char lowbits)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be
GetCardinality()).
|
abstract Container |
remove(char x)
Remove the char from this container.
|
abstract Container |
remove(int begin,
int end)
Return a new container with all chars in [begin,end) remove using an unsigned interpretation.
|
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 char |
select(int j)
Return the jth value
|
abstract void |
serialize(java.io.DataOutput out)
Serialize the container.
|
abstract int |
serializedSizeInBytes()
Report the number of bytes required to serialize this container.
|
abstract BitmapContainer |
toBitmapContainer()
Convert the current container to a BitmapContainer, if a conversion is needed.
|
abstract MappeableContainer |
toMappeableContainer()
Convert to a mappeable container.
|
abstract void |
trim()
If possible, recover wasted memory.
|
abstract void |
writeArray(java.nio.ByteBuffer buffer)
Write just the underlying array.
|
abstract void |
writeArray(java.io.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 XOR of this container with another (symmetric difference).
|
abstract Container |
xor(RunContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
int |
xorCardinality(Container other)
Returns the cardinality of the XOR between the passed container and this
container without materialising a temporary container.
|
public static final java.lang.String[] ContainerNames
public static Container rangeOfOnes(int start, int last)
start - first indexlast - last index (range is exclusive)public abstract Container add(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container add(char x)
add 在接口中 WordStorage<Container>x - short to be addedpublic abstract Container and(ArrayContainer x)
x - other containerpublic abstract Container and(BitmapContainer x)
x - other containerpublic Container and(Container x)
x - other containerpublic abstract Container and(RunContainer x)
x - other containerprotected abstract int andCardinality(ArrayContainer x)
protected abstract int andCardinality(BitmapContainer x)
protected abstract int andCardinality(RunContainer x)
public int andCardinality(Container x)
x - other containerpublic int xorCardinality(Container other)
other - other containerpublic abstract Container andNot(ArrayContainer x)
x - other containerpublic abstract Container andNot(BitmapContainer x)
x - other containerpublic Container andNot(Container x)
x - other containerpublic abstract Container andNot(RunContainer x)
x - other containerpublic Container orNot(Container x, int endOfRange)
x - other containerendOfRange - end of range (size of the universe)public abstract void clear()
public abstract Container clone()
clone 在类中 java.lang.Objectpublic abstract boolean isEmpty()
isEmpty 在接口中 WordStorage<Container>public abstract boolean isFull()
public abstract boolean contains(char x)
x - value to checkpublic abstract boolean contains(int minimum,
int supremum)
minimum - the inclusive lower bound of the rangesupremum - the exclusive upper bound of the rangepublic boolean contains(Container subset)
subset - the container to be testedprotected abstract boolean contains(RunContainer runContainer)
protected abstract boolean contains(ArrayContainer arrayContainer)
protected abstract boolean contains(BitmapContainer bitmapContainer)
public abstract void deserialize(java.io.DataInput in)
throws java.io.IOException
in - the DataInput streamjava.io.IOException - 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(char x)
x - short to be addedpublic abstract int getArraySizeInBytes()
public abstract int getCardinality()
public java.lang.String getContainerName()
public abstract void forEach(char msb,
IntConsumer ic)
msb - 16 most significant bitsic - consumerpublic abstract void forAll(int offset,
RelativeRangeConsumer rrc)
offset - First value in this container corresponds to this
relativePos in the range consumer.rrc - consumerpublic abstract void forAllFrom(char startValue,
RelativeRangeConsumer rrc)
startValue - First value to consume. Corresponds to relativePos=0 in the range consumer.rrc - consumerpublic abstract void forAllUntil(int offset,
char endValue,
RelativeRangeConsumer rrc)
offset - First value in this container corresponds to this
relativePos in the range consumer.endValue - First value greater than last value to consume.rrc - consumerpublic abstract void forAllInRange(char startValue,
char endValue,
RelativeRangeConsumer rrc)
startValue - First value to consume. Corresponds to relativePos=0 in the range consumer.endValue - First value greater than last value to consume.rrc - consumerpublic abstract PeekableCharIterator getReverseCharIterator()
public abstract PeekableCharIterator getCharIterator()
public abstract PeekableCharRankIterator getCharRankIterator()
public abstract ContainerBatchIterator getBatchIterator()
public abstract int getSizeInBytes()
public abstract Container iadd(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container iand(ArrayContainer x)
x - other containerpublic abstract Container iand(BitmapContainer x)
x - other containerpublic Container iand(Container x)
x - other containerpublic abstract Container iand(RunContainer x)
x - other containerpublic abstract Container iandNot(ArrayContainer x)
x - other containerpublic abstract Container iandNot(BitmapContainer x)
x - other containerpublic Container iandNot(Container x)
x - other containerpublic abstract Container iandNot(RunContainer x)
x - other containerpublic Container iorNot(Container x, int endOfRange)
x - other containerendOfRange - the exclusive endpublic abstract Container inot(int rangeStart, int rangeEnd)
rangeStart - beginning of range (inclusive); 0 is beginning of this container.rangeEnd - ending of range (exclusive)public abstract boolean intersects(ArrayContainer x)
x - other containerpublic abstract boolean intersects(BitmapContainer x)
x - other containerpublic boolean intersects(Container x)
x - other containerpublic abstract boolean intersects(RunContainer x)
x - other containerpublic abstract boolean intersects(int minimum,
int supremum)
minimum - the inclusive unsigned lower bound of the rangesupremum - the exclusive unsigned upper bound of the rangepublic abstract Container ior(ArrayContainer x)
x - other containerpublic abstract Container ior(BitmapContainer x)
x - other containerpublic Container ior(Container x)
x - other containerpublic abstract Container ior(RunContainer x)
x - other containerpublic abstract Container iremove(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container ixor(ArrayContainer x)
x - other containerpublic abstract Container ixor(BitmapContainer x)
x - other containerpublic Container ixor(Container x)
x - other containerpublic abstract Container ixor(RunContainer x)
x - other containerpublic Container lazyIOR(Container x)
x - other containerpublic Container lazyOR(Container x)
x - other containerpublic abstract Container limit(int maxcardinality)
maxcardinality - maximal cardinalitypublic 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 Container or(Container x)
x - other containerpublic abstract Container or(RunContainer x)
x - other containerpublic abstract int rank(char lowbits)
lowbits - upper limitpublic abstract Container remove(int begin, int end)
begin - start of range (inclusive)end - end of range (exclusive)public abstract Container remove(char x)
x - to be removedpublic abstract Container repairAfterLazy()
public abstract Container runOptimize()
runOptimize 在接口中 WordStorage<Container>public abstract char select(int j)
j - index of the valuepublic abstract void serialize(java.io.DataOutput out)
throws java.io.IOException
out - the DataOutput streamjava.io.IOException - Signals that an I/O exception has occurred.public abstract int serializedSizeInBytes()
public abstract MappeableContainer toMappeableContainer()
public abstract void trim()
public abstract void writeArray(java.io.DataOutput out)
throws java.io.IOException
out - output streamjava.io.IOException - in case of failurepublic abstract void writeArray(java.nio.ByteBuffer buffer)
buffer - ByteBuffer to write topublic abstract Container xor(ArrayContainer x)
x - other containerpublic abstract Container xor(BitmapContainer x)
x - other containerpublic Container xor(Container x)
x - other parameterpublic abstract Container xor(RunContainer x)
x - other containerpublic abstract BitmapContainer toBitmapContainer()
public abstract int nextValue(char fromValue)
fromValue - the lower bound (inclusive)public abstract int previousValue(char fromValue)
fromValue - the upper bound (inclusive)public abstract int nextAbsentValue(char fromValue)
fromValue - the lower bound (inclusive)public abstract int previousAbsentValue(char fromValue)
fromValue - the upper bound (inclusive)public abstract int first()
java.util.NoSuchElementException - if emptypublic abstract int last()
java.util.NoSuchElementException - if emptyprotected void assertNonEmpty(boolean condition)
condition - a boolean expressionjava.util.NoSuchElementException - if empty