public final class MappeableRunContainer extends MappeableContainer implements java.lang.Cloneable
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
nbrruns |
protected java.nio.CharBuffer |
valueslength |
ContainerNames| 限定符 | 构造器和说明 |
|---|---|
|
MappeableRunContainer()
Create a container with default capacity
|
|
MappeableRunContainer(java.nio.CharBuffer array,
int numRuns)
Construct a new RunContainer backed by the provided CharBuffer.
|
|
MappeableRunContainer(int capacity)
Create an array container with specified capacity
|
|
MappeableRunContainer(int firstOfRun,
int lastOfRun)
Create an run container with a run of ones from firstOfRun to lastOfRun.
|
protected |
MappeableRunContainer(MappeableArrayContainer arr,
int nbrRuns) |
protected |
MappeableRunContainer(MappeableBitmapContainer bc,
int nbrRuns) |
|
MappeableRunContainer(RunContainer bc)
Creates a new container from a non-mappeable one.
|
| 限定符和类型 | 方法和说明 |
|---|---|
MappeableContainer |
add(char k)
Add a char to the container.
|
MappeableContainer |
add(int begin,
int end)
Return a new container with all chars in [begin,end) added using an unsigned interpretation.
|
MappeableContainer |
and(MappeableArrayContainer x)
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 x)
Computes the bitwise AND of this container with another (intersection).
|
int |
andCardinality(MappeableArrayContainer x) |
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.
|
MappeableContainer |
andNot(MappeableArrayContainer x)
Computes the bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
andNot(MappeableBitmapContainer x)
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
|
MappeableContainer |
clone() |
static boolean |
contains(java.nio.ByteBuffer buf,
int position,
char x,
int numRuns)
Checks whether the run container contains 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) |
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.
|
static MappeableRunContainer |
full() |
protected int |
getArraySizeInBytes()
Size of the underlying array
|
protected static int |
getArraySizeInBytes(int nbrruns) |
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.
|
char |
getLength(int index)
Gets the length of the run at the index.
|
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.
|
char |
getValue(int index)
Gets the value of the first element of the run at the index.
|
int |
hashCode() |
MappeableContainer |
iadd(int begin,
int end)
Add all chars in [begin,end) using an unsigned interpretation.
|
MappeableContainer |
iand(MappeableArrayContainer x)
Computes the in-place bitwise AND of this container with another (intersection).
|
MappeableContainer |
iand(MappeableBitmapContainer x)
Computes the in-place bitwise AND of this container with another (intersection).
|
MappeableContainer |
iand(MappeableRunContainer x)
Computes the in-place bitwise AND of this container with another (intersection).
|
MappeableContainer |
iandNot(MappeableArrayContainer x)
Computes the in-place bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
iandNot(MappeableBitmapContainer x)
Computes the in-place bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
iandNot(MappeableRunContainer x)
Computes the in-place bitwise ANDNOT of this container with another (difference).
|
MappeableContainer |
inot(int rangeStart,
int rangeEnd)
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 x)
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 x)
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 x)
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 x)
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 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 MappeableContainer |
lazyor(MappeableArrayContainer x) |
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 rangeStart,
int rangeEnd)
Computes the bitwise NOT of this container (complement).
|
int |
numberOfRuns() |
MappeableContainer |
or(MappeableArrayContainer x)
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 x)
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 Array or Bitmap container if the serialized form would be shorter
|
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 numberOfRuns) |
MappeableBitmapContainer |
toBitmapContainer()
Convert the current container to a BitmapContainer, if a conversion is needed.
|
char[] |
toCharArray()
Create a copy of the content of this container as a char array.
|
Container |
toContainer()
Convert to a non-mappeable container.
|
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) |
MappeableContainer |
xor(MappeableArrayContainer x)
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 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 MappeableRunContainer()
public MappeableRunContainer(int capacity)
capacity - The capacity of the containerprotected MappeableRunContainer(MappeableArrayContainer arr, int nbrRuns)
public MappeableRunContainer(int firstOfRun,
int lastOfRun)
firstOfRun - first indexlastOfRun - last index (range is exclusive)protected MappeableRunContainer(MappeableBitmapContainer bc, int nbrRuns)
public MappeableRunContainer(RunContainer bc)
bc - the original containerpublic MappeableRunContainer(java.nio.CharBuffer array,
int numRuns)
array - CharBuffer where the data is storednumRuns - number of runs (each using 2 chars in the buffer)protected static int getArraySizeInBytes(int nbrruns)
protected static int serializedSizeInBytes(int numberOfRuns)
public MappeableContainer add(int begin, int end)
MappeableContaineradd 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer add(char k)
MappeableContaineradd 在接口中 WordStorage<MappeableContainer>add 在类中 MappeableContainerk - char to be addedpublic boolean isEmpty()
MappeableContainerisEmpty 在接口中 WordStorage<MappeableContainer>isEmpty 在类中 MappeableContainerpublic MappeableContainer and(MappeableArrayContainer x)
MappeableContainerand 在类中 MappeableContainerx - other containerpublic MappeableContainer and(MappeableBitmapContainer x)
MappeableContainerand 在类中 MappeableContainerx - other containerpublic MappeableContainer and(MappeableRunContainer x)
MappeableContainerand 在类中 MappeableContainerx - other containerpublic MappeableContainer andNot(MappeableArrayContainer x)
MappeableContainerandNot 在类中 MappeableContainerx - other containerpublic MappeableContainer andNot(MappeableBitmapContainer x)
MappeableContainerandNot 在类中 MappeableContainerx - other containerpublic MappeableContainer andNot(MappeableRunContainer x)
MappeableContainerandNot 在类中 MappeableContainerx - other containerpublic void clear()
MappeableContainerclear 在类中 MappeableContainerpublic MappeableContainer clone()
clone 在类中 MappeableContainerpublic boolean contains(char x)
MappeableContainercontains 在类中 MappeableContainerx - value to checkpublic static boolean contains(java.nio.ByteBuffer buf,
int position,
char x,
int numRuns)
buf - underlying ByteBufferposition - starting position of the container in the ByteBufferx - target 16-bit valuenumRuns - number of runspublic 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 char getLength(int index)
index - the index of the run.java.lang.ArrayIndexOutOfBoundsException - if index is negative or larger than the index of the
last run.public CharIterator getReverseCharIterator()
MappeableContainergetReverseCharIterator 在类中 MappeableContainerpublic PeekableCharIterator getCharIterator()
MappeableContainergetCharIterator 在类中 MappeableContainerpublic ContainerBatchIterator getBatchIterator()
MappeableContainergetBatchIterator 在类中 MappeableContainerpublic int getSizeInBytes()
MappeableContainergetSizeInBytes 在类中 MappeableContainerpublic char getValue(int index)
index - the index of the run.java.lang.ArrayIndexOutOfBoundsException - if index is negative or larger than the index of the
last run.public int hashCode()
hashCode 在类中 java.lang.Objectpublic MappeableContainer iadd(int begin, int end)
MappeableContaineriadd 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer iand(MappeableArrayContainer x)
MappeableContaineriand 在类中 MappeableContainerx - other containerpublic MappeableContainer iand(MappeableBitmapContainer x)
MappeableContaineriand 在类中 MappeableContainerx - other containerpublic MappeableContainer iand(MappeableRunContainer x)
MappeableContaineriand 在类中 MappeableContainerx - other containerpublic MappeableContainer iandNot(MappeableArrayContainer x)
MappeableContaineriandNot 在类中 MappeableContainerx - other containerpublic MappeableContainer iandNot(MappeableBitmapContainer x)
MappeableContaineriandNot 在类中 MappeableContainerx - other containerpublic MappeableContainer iandNot(MappeableRunContainer x)
MappeableContaineriandNot 在类中 MappeableContainerx - other containerpublic MappeableContainer inot(int rangeStart, int rangeEnd)
MappeableContainerinot 在类中 MappeableContainerrangeStart - beginning of range (inclusive); 0 is beginning of this container.rangeEnd - ending of range (exclusive)public boolean intersects(MappeableArrayContainer x)
MappeableContainerintersects 在类中 MappeableContainerx - other containerpublic boolean intersects(MappeableBitmapContainer x)
MappeableContainerintersects 在类中 MappeableContainerx - other containerpublic boolean intersects(MappeableRunContainer x)
MappeableContainerintersects 在类中 MappeableContainerx - other containerpublic MappeableContainer ior(MappeableArrayContainer x)
MappeableContainerior 在类中 MappeableContainerx - other containerpublic MappeableContainer ior(MappeableBitmapContainer x)
MappeableContainerior 在类中 MappeableContainerx - other containerpublic MappeableContainer ior(MappeableRunContainer x)
MappeableContainerior 在类中 MappeableContainerx - other containerpublic MappeableContainer iremove(int begin, int end)
MappeableContaineriremove 在类中 MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)protected boolean isArrayBacked()
isArrayBacked 在类中 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 static MappeableRunContainer full()
public java.util.Iterator<java.lang.Character> iterator()
iterator 在接口中 java.lang.Iterable<java.lang.Character>public MappeableContainer ixor(MappeableArrayContainer x)
MappeableContainerixor 在类中 MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableBitmapContainer x)
MappeableContainerixor 在类中 MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableRunContainer x)
MappeableContainerixor 在类中 MappeableContainerx - other containerprotected MappeableContainer lazyor(MappeableArrayContainer x)
public MappeableContainer limit(int maxcardinality)
MappeableContainerlimit 在类中 MappeableContainermaxcardinality - maximal cardinalitypublic MappeableContainer not(int rangeStart, int rangeEnd)
MappeableContainernot 在类中 MappeableContainerrangeStart - beginning of range (inclusive); 0 is beginning of this container.rangeEnd - ending of range (exclusive)public int numberOfRuns()
public MappeableContainer or(MappeableArrayContainer x)
MappeableContaineror 在类中 MappeableContainerx - other containerpublic MappeableContainer or(MappeableBitmapContainer x)
MappeableContaineror 在类中 MappeableContainerx - other containerpublic MappeableContainer or(MappeableRunContainer x)
MappeableContaineror 在类中 MappeableContainerx - other containerpublic 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()
runOptimize 在接口中 WordStorage<MappeableContainer>runOptimize 在类中 MappeableContainerpublic char select(int j)
MappeableContainerselect 在类中 MappeableContainerj - index of the valuepublic int serializedSizeInBytes()
MappeableContainerserializedSizeInBytes 在类中 MappeableContainerpublic Container toContainer()
MappeableContainertoContainer 在类中 MappeableContainerpublic char[] toCharArray()
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 x)
MappeableContainerxor 在类中 MappeableContainerx - other containerpublic MappeableContainer xor(MappeableBitmapContainer x)
MappeableContainerxor 在类中 MappeableContainerx - other containerpublic MappeableContainer xor(MappeableRunContainer x)
MappeableContainerxor 在类中 MappeableContainerx - other parameterpublic void forEach(char msb,
IntConsumer ic)
MappeableContainerforEach 在类中 MappeableContainermsb - 16 most significant bitsic - consumerpublic int andCardinality(MappeableArrayContainer x)
andCardinality 在类中 MappeableContainerpublic int andCardinality(MappeableBitmapContainer x)
andCardinality 在类中 MappeableContainerpublic int andCardinality(MappeableRunContainer x)
andCardinality 在类中 MappeableContainerpublic MappeableBitmapContainer toBitmapContainer()
MappeableContainertoBitmapContainer 在类中 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)protected 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