public final class ArrayContainer extends Container implements java.lang.Cloneable
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
cardinality |
ContainerNames| 构造器和说明 |
|---|
ArrayContainer()
Create an array container with default capacity
|
ArrayContainer(char[] newContent) |
ArrayContainer(int capacity)
Create an array container with specified capacity
|
ArrayContainer(int newCard,
char[] newContent)
Create a new container from existing values array.
|
ArrayContainer(int firstOfRun,
int lastOfRun)
Create an array container with a run of ones from firstOfRun to lastOfRun, inclusive.
|
ArrayContainer(MappeableArrayContainer bc)
Creates a new non-mappeable container from a mappeable one.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Container |
add(char x)
running time is in O(n) time if insert is not in order.
|
Container |
add(int begin,
int end)
Return a new container with all shorts in [begin,end) added using an unsigned interpretation.
|
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).
|
ArrayContainer |
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) |
boolean |
contains(char x)
Checks whether the contain contains the provided value
|
boolean |
contains(int minimum,
int supremum)
Checks whether the container contains the entire range
|
protected boolean |
contains(RunContainer runContainer) |
void |
deserialize(java.io.DataInput in)
Deserialize (recover) the container.
|
static ArrayContainer |
empty() |
boolean |
equals(java.lang.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(char x)
Add a short to the container if it is not present, otherwise remove it.
|
void |
forAll(int offset,
RelativeRangeConsumer rrc)
Consume presence information for all values in this container.
|
void |
forAllFrom(char startValue,
RelativeRangeConsumer rrc)
Consume presence information for all values greater or equal to
startValue in this container.
|
void |
forAllInRange(char startValue,
char endValue,
RelativeRangeConsumer rrc)
Consumer presence information for all values in the
range [startValue, endValue) in this container.
|
void |
forAllUntil(int offset,
char endValue,
RelativeRangeConsumer rrc)
Consume presence information for all values smaller than endValue
in this container.
|
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.
|
int |
getArraySizeInBytes()
Size of the underlying array
|
ContainerBatchIterator |
getBatchIterator()
Gets an iterator to visit the contents of the container in batches
|
int |
getCardinality()
Computes the distinct number of char values in the container.
|
PeekableCharIterator |
getCharIterator()
Iterator to visit the char values in the container in ascending order.
|
PeekableCharRankIterator |
getCharRankIterator()
Iterator to visit the short values in container and pre-compute ranks
|
PeekableCharIterator |
getReverseCharIterator()
Iterator to visit the char values in the container in descending 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(int minimum,
int supremum)
Checks if the container intersects with a range
|
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.
|
boolean |
isEmpty()
Checks whether the container is empty or not.
|
boolean |
isFull()
Checks whether the container is full or not.
|
java.util.Iterator<java.lang.Character> |
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.
|
int |
nextAbsentValue(char fromValue)
Gets the first absent value greater than or equal to the lower bound.
|
int |
nextValue(char fromValue)
Gets the first value greater than or equal to the lower bound, or -1 if no such value exists.
|
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).
|
protected Container |
or(CharIterator it) |
Container |
or(RunContainer x)
Computes the bitwise OR of this container with another (union).
|
int |
previousAbsentValue(char fromValue)
Gets the last value less than or equal to the upper bound.
|
int |
previousValue(char fromValue)
Gets the last value less than or equal to the upper bound, or -1 if no such value exists.
|
int |
rank(char lowbits)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be
GetCardinality()).
|
void |
readExternal(java.io.ObjectInput in) |
Container |
remove(char x)
Remove the char from this container.
|
Container |
remove(int begin,
int end)
Return a new container with all chars in [begin,end) remove using an unsigned interpretation.
|
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.
|
char |
select(int j)
Return the jth value
|
void |
serialize(java.io.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.
|
java.nio.CharBuffer |
toCharBuffer()
Return the content of this container as a ShortBuffer.
|
MappeableContainer |
toMappeableContainer()
Convert to a mappeable container.
|
java.lang.String |
toString() |
void |
trim()
If possible, recover wasted memory.
|
void |
writeArray(java.nio.ByteBuffer buffer)
Write just the underlying array.
|
void |
writeArray(java.io.DataOutput out)
Write just the underlying array.
|
void |
writeExternal(java.io.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).
|
protected Container |
xor(CharIterator it) |
Container |
xor(RunContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
and, andCardinality, andNot, assertNonEmpty, contains, getContainerName, iand, iandNot, intersects, ior, iorNot, ixor, lazyIOR, lazyOR, or, orNot, rangeOfOnes, xor, xorCardinalitypublic 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,
char[] newContent)
newCard - desired cardinalitynewContent - actual values (length should equal or exceed cardinality)public ArrayContainer(MappeableArrayContainer bc)
bc - the original containerpublic ArrayContainer(char[] newContent)
protected static int serializedSizeInBytes(int cardinality)
public static ArrayContainer empty()
public Container add(int begin, int end)
Containerpublic Container add(char x)
add 在接口中 WordStorage<Container>add 在类中 Containerx - short to be addedpublic ArrayContainer and(ArrayContainer value2)
Containerpublic Container and(BitmapContainer x)
Containerpublic Container and(RunContainer x)
Containerpublic int andCardinality(ArrayContainer value2)
andCardinality 在类中 Containerpublic int andCardinality(BitmapContainer x)
andCardinality 在类中 Containerpublic int andCardinality(RunContainer x)
andCardinality 在类中 Containerpublic ArrayContainer andNot(ArrayContainer value2)
Containerpublic ArrayContainer andNot(BitmapContainer value2)
Containerpublic ArrayContainer andNot(RunContainer x)
Containerpublic ArrayContainer clone()
public boolean isEmpty()
ContainerisEmpty 在接口中 WordStorage<Container>isEmpty 在类中 Containerpublic boolean isFull()
Containerpublic boolean contains(char x)
Containerpublic boolean contains(int minimum,
int supremum)
Containerprotected boolean contains(RunContainer runContainer)
protected boolean contains(ArrayContainer arrayContainer)
protected boolean contains(BitmapContainer bitmapContainer)
public void deserialize(java.io.DataInput in)
throws java.io.IOException
Containerdeserialize 在类中 Containerin - the DataInput streamjava.io.IOException - Signals that an I/O exception has occurred.public boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic void fillLeastSignificant16bits(int[] x,
int i,
int mask)
ContainerfillLeastSignificant16bits 在类中 Containerx - provided arrayi - starting indexmask - indicates most significant bitspublic Container flip(char x)
Containerpublic int getArraySizeInBytes()
ContainergetArraySizeInBytes 在类中 Containerpublic int getCardinality()
ContainergetCardinality 在类中 Containerpublic PeekableCharIterator getReverseCharIterator()
ContainergetReverseCharIterator 在类中 Containerpublic PeekableCharIterator getCharIterator()
ContainergetCharIterator 在类中 Containerpublic PeekableCharRankIterator getCharRankIterator()
ContainergetCharRankIterator 在类中 Containerpublic ContainerBatchIterator getBatchIterator()
ContainergetBatchIterator 在类中 Containerpublic int getSizeInBytes()
ContainergetSizeInBytes 在类中 Containerpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic 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 在类中 Containervalue2 - other containerpublic boolean intersects(BitmapContainer x)
Containerintersects 在类中 Containerx - other containerpublic boolean intersects(RunContainer x)
Containerintersects 在类中 Containerx - other containerpublic boolean intersects(int minimum,
int supremum)
Containerintersects 在类中 Containerminimum - the inclusive unsigned lower bound of the rangesupremum - the exclusive unsigned upper bound of the rangepublic Container ior(ArrayContainer value2)
Containerpublic Container ior(BitmapContainer x)
Containerpublic Container ior(RunContainer x)
Containerpublic Container iremove(int begin, int end)
Containerpublic java.util.Iterator<java.lang.Character> iterator()
iterator 在接口中 java.lang.Iterable<java.lang.Character>public Container ixor(ArrayContainer value2)
Containerpublic Container ixor(BitmapContainer x)
Containerpublic Container ixor(RunContainer x)
Containerpublic Container limit(int maxcardinality)
Containerpublic Container not(int firstOfRange, int lastOfRange)
Containerpublic Container or(ArrayContainer value2)
Containerpublic Container or(BitmapContainer x)
Containerpublic Container or(RunContainer x)
Containerprotected Container or(CharIterator it)
public int rank(char lowbits)
Containerpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic Container remove(int begin, int end)
Containerpublic Container remove(char x)
Containerpublic Container repairAfterLazy()
ContainerrepairAfterLazy 在类中 Containerpublic Container runOptimize()
ContainerrunOptimize 在接口中 WordStorage<Container>runOptimize 在类中 Containerpublic char select(int j)
Containerpublic void serialize(java.io.DataOutput out)
throws java.io.IOException
Containerpublic int serializedSizeInBytes()
ContainerserializedSizeInBytes 在类中 Containerpublic BitmapContainer toBitmapContainer()
toBitmapContainer 在类中 Containerpublic int nextValue(char fromValue)
Containerpublic int previousValue(char fromValue)
ContainerpreviousValue 在类中 ContainerfromValue - the upper bound (inclusive)public int nextAbsentValue(char fromValue)
ContainernextAbsentValue 在类中 ContainerfromValue - the lower bound (inclusive)public int previousAbsentValue(char fromValue)
ContainerpreviousAbsentValue 在类中 ContainerfromValue - the upper bound (inclusive)public int first()
Containerpublic int last()
Containerpublic MappeableContainer toMappeableContainer()
ContainertoMappeableContainer 在类中 Containerpublic java.nio.CharBuffer toCharBuffer()
public java.lang.String toString()
toString 在类中 java.lang.Objectpublic void trim()
Containerpublic void writeArray(java.io.DataOutput out)
throws java.io.IOException
ContainerwriteArray 在类中 Containerout - output streamjava.io.IOException - in case of failurepublic void writeArray(java.nio.ByteBuffer buffer)
ContainerwriteArray 在类中 Containerbuffer - ByteBuffer to write topublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic Container xor(ArrayContainer value2)
Containerpublic Container xor(BitmapContainer x)
Containerpublic Container xor(RunContainer x)
Containerprotected Container xor(CharIterator it)
public void forEach(char msb,
IntConsumer ic)
Containerpublic void forAll(int offset,
RelativeRangeConsumer rrc)
Containerpublic void forAllFrom(char startValue,
RelativeRangeConsumer rrc)
ContainerforAllFrom 在类中 ContainerstartValue - First value to consume. Corresponds to relativePos=0 in the range consumer.rrc - consumerpublic void forAllUntil(int offset,
char endValue,
RelativeRangeConsumer rrc)
ContainerforAllUntil 在类中 Containeroffset - First value in this container corresponds to this
relativePos in the range consumer.endValue - First value greater than last value to consume.rrc - consumerpublic void forAllInRange(char startValue,
char endValue,
RelativeRangeConsumer rrc)
ContainerforAllInRange 在类中 ContainerstartValue - First value to consume. Corresponds to relativePos=0 in the range consumer.endValue - First value greater than last value to consume.rrc - consumerprotected Container lazyor(ArrayContainer value2)