public final class MappeableArrayContainer extends MappeableContainer implements java.lang.Cloneable
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
cardinality |
protected java.nio.CharBuffer |
content |
protected static int |
DEFAULT_MAX_SIZE |
ContainerNames| 构造器和说明 |
|---|
MappeableArrayContainer()
Create an array container with default capacity
|
MappeableArrayContainer(ArrayContainer bc)
Creates a new container from a non-mappeable one.
|
MappeableArrayContainer(java.nio.CharBuffer array,
int cardinality)
Construct a new ArrayContainer backed by the provided CharBuffer.
|
MappeableArrayContainer(int capacity)
Create an array container with specified capacity
|
MappeableArrayContainer(int firstOfRun,
int lastOfRun)
Create an array container with a run of ones from firstOfRun to lastOfRun, exclusive.
|
| 限定符和类型 | 方法和说明 |
|---|---|
MappeableContainer |
add(char x)
running time is in O(n) time if insert is not in order.
|
MappeableContainer |
add(int begin,
int end)
Return a new container with all chars in [begin,end) added using an unsigned interpretation.
|
MappeableArrayContainer |
and(MappeableArrayContainer value2)
Computes the bitwise AND of this container with another (intersection).
|
MappeableContainer |
and(MappeableBitmapContainer x)
Computes the bitwise AND of this container with another (intersection).
|
MappeableContainer |
and(MappeableRunContainer value2)
Computes the bitwise AND of this container with another (intersection).
|
int |
andCardinality(MappeableArrayContainer value2) |
int |
andCardinality(MappeableBitmapContainer x) |
int |
andCardinality(MappeableRunContainer x) |
void |
andInto(long[] bits)
Computes the intersection of this container with the bits present in the array,
modifying the array.
|
MappeableArrayContainer |
andNot(MappeableArrayContainer value2)
Computes the bitwise ANDNOT of this container with another (difference).
|
MappeableArrayContainer |
andNot(MappeableBitmapContainer value2)
Computes the bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
andNot(MappeableRunContainer x)
Computes the bitwise ANDNOT of this container with another (difference).
|
void |
clear()
Empties the container
|
MappeableArrayContainer |
clone() |
static boolean |
contains(java.nio.ByteBuffer buf,
int position,
char x,
int cardinality)
Checks whether the container contains the value x.
|
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(MappeableArrayContainer arrayContainer) |
protected boolean |
contains(MappeableBitmapContainer bitmapContainer) |
protected boolean |
contains(MappeableRunContainer runContainer) |
static MappeableArrayContainer |
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 index, with the
char values from this container.
|
int |
first()
Get the first integer held in the container
|
MappeableContainer |
flip(char x)
Add a char to the container if it is not present, otherwise remove it.
|
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.
|
protected int |
getArraySizeInBytes()
Size of the underlying array
|
protected static int |
getArraySizeInBytes(int cardinality) |
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.
|
CharIterator |
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() |
MappeableContainer |
iadd(int begin,
int end)
Add all chars in [begin,end) using an unsigned interpretation.
|
MappeableArrayContainer |
iand(MappeableArrayContainer value2)
Computes the in-place bitwise AND of this container with another (intersection).
|
MappeableContainer |
iand(MappeableBitmapContainer value2)
Computes the in-place bitwise AND of this container with another (intersection).
|
MappeableContainer |
iand(MappeableRunContainer value2)
Computes the in-place bitwise AND of this container with another (intersection).
|
MappeableArrayContainer |
iandNot(MappeableArrayContainer value2)
Computes the in-place bitwise ANDNOT of this container with another (difference).
|
MappeableArrayContainer |
iandNot(MappeableBitmapContainer value2)
Computes the in-place bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
iandNot(MappeableRunContainer value2)
Computes the in-place bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
inot(int firstOfRange,
int lastOfRange)
Computes the in-place bitwise NOT of this container (complement).
|
boolean |
intersects(int minimum,
int supremum)
Checks if the container intersects with a range
|
boolean |
intersects(MappeableArrayContainer value2)
Returns true if the current container intersects the other container.
|
boolean |
intersects(MappeableBitmapContainer x)
Returns true if the current container intersects the other container.
|
boolean |
intersects(MappeableRunContainer x)
Returns true if the current container intersects the other container.
|
MappeableContainer |
ior(MappeableArrayContainer value2)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
ior(MappeableBitmapContainer x)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
ior(MappeableRunContainer value2)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
iremove(int begin,
int end)
Remove chars in [begin,end) using an unsigned interpretation.
|
protected boolean |
isArrayBacked() |
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() |
MappeableContainer |
ixor(MappeableArrayContainer value2)
Computes the in-place bitwise XOR of this container with another (symmetric difference).
|
MappeableContainer |
ixor(MappeableBitmapContainer x)
Computes the in-place bitwise XOR of this container with another (symmetric difference).
|
MappeableContainer |
ixor(MappeableRunContainer value2)
Computes the in-place bitwise XOR of this container with another (symmetric difference).
|
int |
last()
Get the last integer held in the container
|
protected MappeableContainer |
lazyor(MappeableArrayContainer value2) |
MappeableContainer |
limit(int maxcardinality)
Create a new MappeableContainer 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.
|
MappeableContainer |
not(int firstOfRange,
int lastOfRange)
Computes the bitwise NOT of this container (complement).
|
protected MappeableContainer |
or(CharIterator it) |
MappeableContainer |
or(MappeableArrayContainer value2)
Computes the bitwise OR of this container with another (union).
|
MappeableContainer |
or(MappeableBitmapContainer x)
Computes the bitwise OR of this container with another (union).
|
MappeableContainer |
or(MappeableRunContainer value2)
Computes the bitwise OR of this container with another (union).
|
void |
orInto(long[] bits)
Computes the union of this container with the bits present in the array,
modifying the array.
|
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) |
MappeableContainer |
remove(char x)
Remove the char from this container.
|
MappeableContainer |
remove(int begin,
int end)
Return a new container with all chars in [begin,end) remove using an unsigned interpretation.
|
MappeableContainer |
repairAfterLazy()
The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.
|
MappeableContainer |
runOptimize()
Convert to MappeableRunContainers, when the result is smaller.
|
char |
select(int j)
Return the jth value
|
int |
serializedSizeInBytes()
Report the number of bytes required to serialize this container.
|
protected static int |
serializedSizeInBytes(int cardinality) |
MappeableBitmapContainer |
toBitmapContainer()
Copies the data in a bitmap container.
|
Container |
toContainer()
Convert to a non-mappeable container.
|
char[] |
toShortArray()
Create a copy of the content of this container as a char array.
|
java.lang.String |
toString() |
void |
trim()
If possible, recover wasted memory.
|
protected void |
writeArray(java.nio.ByteBuffer buffer)
Write just the underlying array.
|
protected void |
writeArray(java.io.DataOutput out)
Write just the underlying array.
|
void |
writeExternal(java.io.ObjectOutput out) |
protected MappeableContainer |
xor(CharIterator it) |
MappeableContainer |
xor(MappeableArrayContainer value2)
Computes the bitwise XOR of this container with another (symmetric difference).
|
MappeableContainer |
xor(MappeableBitmapContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).
|
MappeableContainer |
xor(MappeableRunContainer value2)
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, xorCardinalityprotected static final int DEFAULT_MAX_SIZE
protected int cardinality
protected java.nio.CharBuffer content
public MappeableArrayContainer()
public MappeableArrayContainer(ArrayContainer bc)
bc - the original containerpublic MappeableArrayContainer(int capacity)
capacity - The capacity of the containerpublic MappeableArrayContainer(int firstOfRun,
int lastOfRun)
firstOfRun - first indexlastOfRun - last index (range is exclusive)public MappeableArrayContainer(java.nio.CharBuffer array,
int cardinality)
array - CharBuffer where the data is storedcardinality - cardinality (number of values stored)protected static int getArraySizeInBytes(int cardinality)
protected static int serializedSizeInBytes(int cardinality)
public static MappeableArrayContainer empty()
public MappeableContainer add(int begin, int end)
MappeableContaineradd 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer add(char x)
add 在接口中 WordStorage<MappeableContainer>add 在类中 MappeableContainerx - char to be addedpublic boolean isEmpty()
MappeableContainerisEmpty 在接口中 WordStorage<MappeableContainer>isEmpty 在类中 MappeableContainerpublic boolean isFull()
MappeableContainerisFull 在类中 MappeableContainerpublic void orInto(long[] bits)
MappeableContainerorInto 在类中 MappeableContainerbits - a 1024 element array to be interpreted as a bit setpublic void andInto(long[] bits)
MappeableContainerandInto 在类中 MappeableContainerbits - a 1024 element array to be interpreted as a bit setpublic MappeableArrayContainer and(MappeableArrayContainer value2)
MappeableContainerand 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer and(MappeableBitmapContainer x)
MappeableContainerand 在类中 MappeableContainerx - other containerpublic MappeableContainer and(MappeableRunContainer value2)
MappeableContainerand 在类中 MappeableContainervalue2 - other containerpublic MappeableArrayContainer andNot(MappeableArrayContainer value2)
MappeableContainerandNot 在类中 MappeableContainervalue2 - other containerpublic MappeableArrayContainer andNot(MappeableBitmapContainer value2)
MappeableContainerandNot 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer andNot(MappeableRunContainer x)
MappeableContainerandNot 在类中 MappeableContainerx - other containerpublic void clear()
MappeableContainerclear 在类中 MappeableContainerpublic MappeableArrayContainer clone()
clone 在类中 MappeableContainerpublic boolean contains(char x)
MappeableContainercontains 在类中 MappeableContainerx - value to checkpublic static boolean contains(java.nio.ByteBuffer buf,
int position,
char x,
int cardinality)
buf - underlying bufferposition - starting position of the container in the ByteBufferx - target value xcardinality - container cardinalitypublic boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic void fillLeastSignificant16bits(int[] x,
int i,
int mask)
MappeableContainerfillLeastSignificant16bits 在类中 MappeableContainerx - provided arrayi - starting indexmask - indicates most significant bitspublic MappeableContainer flip(char x)
MappeableContainerflip 在类中 MappeableContainerx - char to be addedprotected int getArraySizeInBytes()
MappeableContainergetArraySizeInBytes 在类中 MappeableContainerpublic int getCardinality()
MappeableContainergetCardinality 在类中 MappeableContainerpublic CharIterator getReverseCharIterator()
MappeableContainergetReverseCharIterator 在类中 MappeableContainerpublic PeekableCharIterator getCharIterator()
MappeableContainergetCharIterator 在类中 MappeableContainerpublic ContainerBatchIterator getBatchIterator()
MappeableContainergetBatchIterator 在类中 MappeableContainerpublic int getSizeInBytes()
MappeableContainergetSizeInBytes 在类中 MappeableContainerpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic MappeableContainer iadd(int begin, int end)
MappeableContaineriadd 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableArrayContainer iand(MappeableArrayContainer value2)
MappeableContaineriand 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer iand(MappeableBitmapContainer value2)
MappeableContaineriand 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer iand(MappeableRunContainer value2)
MappeableContaineriand 在类中 MappeableContainervalue2 - other containerpublic MappeableArrayContainer iandNot(MappeableArrayContainer value2)
MappeableContaineriandNot 在类中 MappeableContainervalue2 - other containerpublic MappeableArrayContainer iandNot(MappeableBitmapContainer value2)
MappeableContaineriandNot 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer iandNot(MappeableRunContainer value2)
MappeableContaineriandNot 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer inot(int firstOfRange, int lastOfRange)
MappeableContainerinot 在类中 MappeableContainerfirstOfRange - beginning of range (inclusive); 0 is beginning of this container.lastOfRange - ending of range (exclusive)public boolean intersects(MappeableArrayContainer value2)
MappeableContainerintersects 在类中 MappeableContainervalue2 - other containerpublic boolean intersects(MappeableBitmapContainer x)
MappeableContainerintersects 在类中 MappeableContainerx - other containerpublic boolean intersects(MappeableRunContainer x)
MappeableContainerintersects 在类中 MappeableContainerx - other containerpublic MappeableContainer ior(MappeableArrayContainer value2)
MappeableContainerior 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer ior(MappeableBitmapContainer x)
MappeableContainerior 在类中 MappeableContainerx - other containerpublic MappeableContainer ior(MappeableRunContainer value2)
MappeableContainerior 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer iremove(int begin, int end)
MappeableContaineriremove 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)protected boolean isArrayBacked()
isArrayBacked 在类中 MappeableContainerpublic java.util.Iterator<java.lang.Character> iterator()
iterator 在接口中 java.lang.Iterable<java.lang.Character>public MappeableContainer ixor(MappeableArrayContainer value2)
MappeableContainerixor 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer ixor(MappeableBitmapContainer x)
MappeableContainerixor 在类中 MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableRunContainer value2)
MappeableContainerixor 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer limit(int maxcardinality)
MappeableContainerlimit 在类中 MappeableContainermaxcardinality - maximal cardinalitypublic MappeableContainer not(int firstOfRange, int lastOfRange)
MappeableContainernot 在类中 MappeableContainerfirstOfRange - beginning of range (inclusive); 0 is beginning of this container.lastOfRange - ending of range (exclusive)public MappeableContainer or(MappeableArrayContainer value2)
MappeableContaineror 在类中 MappeableContainervalue2 - other containerprotected MappeableContainer lazyor(MappeableArrayContainer value2)
public MappeableContainer or(MappeableBitmapContainer x)
MappeableContaineror 在类中 MappeableContainerx - other containerpublic MappeableContainer or(MappeableRunContainer value2)
MappeableContaineror 在类中 MappeableContainervalue2 - other containerprotected MappeableContainer or(CharIterator it)
public int rank(char lowbits)
MappeableContainerrank 在类中 MappeableContainerlowbits - upper limitpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic MappeableContainer remove(int begin, int end)
MappeableContainerremove 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer remove(char x)
MappeableContainerremove 在类中 MappeableContainerx - to be removedpublic MappeableContainer repairAfterLazy()
MappeableContainerrepairAfterLazy 在类中 MappeableContainerpublic MappeableContainer runOptimize()
MappeableContainerrunOptimize 在接口中 WordStorage<MappeableContainer>runOptimize 在类中 MappeableContainerpublic char select(int j)
MappeableContainerselect 在类中 MappeableContainerj - index of the valuepublic int serializedSizeInBytes()
MappeableContainerserializedSizeInBytes 在类中 MappeableContainerpublic MappeableBitmapContainer toBitmapContainer()
toBitmapContainer 在类中 MappeableContainerpublic int first()
MappeableContainerfirst 在类中 MappeableContainerpublic int last()
MappeableContainerlast 在类中 MappeableContainerpublic int nextValue(char fromValue)
MappeableContainernextValue 在类中 MappeableContainerfromValue - the lower bound (inclusive)public int previousValue(char fromValue)
MappeableContainerpreviousValue 在类中 MappeableContainerfromValue - the upper bound (inclusive)public int nextAbsentValue(char fromValue)
MappeableContainernextAbsentValue 在类中 MappeableContainerfromValue - the lower bound (inclusive)public int previousAbsentValue(char fromValue)
MappeableContainerpreviousAbsentValue 在类中 MappeableContainerfromValue - the upper bound (inclusive)public Container toContainer()
MappeableContainertoContainer 在类中 MappeableContainerpublic char[] toShortArray()
public java.lang.String toString()
toString 在类中 java.lang.Objectpublic void trim()
MappeableContainertrim 在类中 MappeableContainerprotected void writeArray(java.io.DataOutput out)
throws java.io.IOException
MappeableContainerwriteArray 在类中 MappeableContainerout - output streamjava.io.IOException - in case of failureprotected void writeArray(java.nio.ByteBuffer buffer)
MappeableContainerwriteArray 在类中 MappeableContainerbuffer - the buffer to write topublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic MappeableContainer xor(MappeableArrayContainer value2)
MappeableContainerxor 在类中 MappeableContainervalue2 - other containerpublic MappeableContainer xor(MappeableBitmapContainer x)
MappeableContainerxor 在类中 MappeableContainerx - other containerpublic MappeableContainer xor(MappeableRunContainer value2)
MappeableContainerxor 在类中 MappeableContainervalue2 - other parameterprotected MappeableContainer xor(CharIterator it)
public void forEach(char msb,
IntConsumer ic)
MappeableContainerforEach 在类中 MappeableContainermsb - 16 most significant bitsic - consumerpublic int andCardinality(MappeableArrayContainer value2)
andCardinality 在类中 MappeableContainerpublic int andCardinality(MappeableBitmapContainer x)
andCardinality 在类中 MappeableContainerpublic int andCardinality(MappeableRunContainer x)
andCardinality 在类中 MappeableContainerprotected boolean contains(MappeableRunContainer runContainer)
contains 在类中 MappeableContainerprotected boolean contains(MappeableArrayContainer arrayContainer)
contains 在类中 MappeableContainerprotected boolean contains(MappeableBitmapContainer bitmapContainer)
contains 在类中 MappeableContainerpublic boolean intersects(int minimum,
int supremum)
MappeableContainerintersects 在类中 MappeableContainerminimum - the inclusive unsigned lower bound of the rangesupremum - the exclusive unsigned upper bound of the rangepublic boolean contains(int minimum,
int supremum)
MappeableContainercontains 在类中 MappeableContainerminimum - the inclusive lower bound of the rangesupremum - the exclusive upper bound of the range