public final class MappeableRunContainer extends MappeableContainer implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected int |
nbrruns |
protected ShortBuffer |
valueslength |
| Modifier | Constructor and Description |
|---|---|
|
MappeableRunContainer()
Create a container with default capacity
|
|
MappeableRunContainer(int capacity)
Create an array container with specified capacity
|
protected |
MappeableRunContainer(MappeableArrayContainer arr,
int nbrRuns) |
protected |
MappeableRunContainer(MappeableBitmapContainer bc,
int nbrRuns) |
|
MappeableRunContainer(ShortBuffer array,
int numRuns)
Construct a new RunContainer backed by the provided ShortBuffer.
|
protected |
MappeableRunContainer(ShortIterator sIt,
int nbrRuns) |
| Modifier and Type | Method and Description |
|---|---|
MappeableContainer |
add(int begin,
int end)
Return a new container with all shorts in [begin,end)
added using an unsigned interpretation.
|
MappeableContainer |
add(short k)
Add a short to the container.
|
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).
|
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() |
boolean |
contains(short x)
Checks whether the contain contains the provided value
|
protected void |
ensureCapacity(int minNbRuns) |
boolean |
equals(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 short values from this container.
|
MappeableContainer |
flip(short x)
Add a short to the container if it is not present, otherwise remove it.
|
protected int |
getArraySizeInBytes()
Size of the underlying array
|
protected static int |
getArraySizeInBytes(int nbrruns) |
int |
getCardinality()
Computes the distinct number of short values in the container.
|
ShortIterator |
getReverseShortIterator()
Iterator to visit the short values in the container in descending order.
|
ShortIterator |
getShortIterator()
Iterator to visit the short values in the container in ascending order.
|
int |
getSizeInBytes()
Computes an estimate of the memory usage of this container.
|
int |
hashCode() |
MappeableContainer |
iadd(int begin,
int end)
Add all shorts 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).
|
protected MappeableContainer |
ilazyor(MappeableArrayContainer x) |
MappeableContainer |
inot(int rangeStart,
int rangeEnd)
Computes the in-place bitwise NOT of this container (complement).
|
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 shorts in [begin,end) using an unsigned interpretation.
|
protected boolean |
isArrayBacked() |
protected boolean |
isFull() |
Iterator<Short> |
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).
|
protected MappeableContainer |
lazyor(MappeableArrayContainer x) |
MappeableContainer |
limit(int maxcardinality)
Create a new MappeableContainer containing at most maxcardinality integers.
|
MappeableContainer |
not(int rangeStart,
int rangeEnd)
Computes the bitwise NOT of this container (complement).
|
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).
|
int |
rank(short lowbits)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).
|
void |
readExternal(ObjectInput in) |
MappeableContainer |
remove(int begin,
int end)
Return a new container with all shorts in [begin,end)
remove using an unsigned interpretation.
|
MappeableContainer |
remove(short x)
Remove the short from this container.
|
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
|
short |
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) |
String |
toString() |
void |
trim()
If possible, recover wasted memory.
|
protected void |
writeArray(DataOutput out)
Write just the underlying array.
|
void |
writeExternal(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, andNot, getContainerName, iand, iandNot, intersects, ior, ixor, lazyIOR, lazyOR, or, rangeOfOnes, xorfinalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected ShortBuffer valueslength
protected int nbrruns
public MappeableRunContainer(ShortBuffer array, int numRuns)
array - ShortBuffer where the data is storednumRuns - number of runs (each using 2 shorts in the buffer)protected MappeableRunContainer(ShortIterator sIt, int nbrRuns)
protected MappeableRunContainer(MappeableArrayContainer arr, int nbrRuns)
protected MappeableRunContainer(MappeableBitmapContainer bc, int nbrRuns)
public MappeableRunContainer()
public MappeableRunContainer(int capacity)
capacity - The capacity of the containerpublic MappeableContainer runOptimize()
runOptimize in class MappeableContainerprotected void ensureCapacity(int minNbRuns)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic MappeableContainer flip(short x)
MappeableContainerflip in class MappeableContainerx - short to be addedpublic MappeableContainer add(short k)
MappeableContaineradd in class MappeableContainerk - short to be addedpublic MappeableContainer add(int begin, int end)
MappeableContaineradd in class MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer and(MappeableArrayContainer x)
MappeableContainerand in class MappeableContainerx - other containerpublic MappeableContainer and(MappeableBitmapContainer x)
MappeableContainerand in class MappeableContainerx - other containerpublic MappeableContainer andNot(MappeableBitmapContainer x)
MappeableContainerandNot in class MappeableContainerx - other containerpublic MappeableContainer andNot(MappeableArrayContainer x)
MappeableContainerandNot in class MappeableContainerx - other containerpublic void clear()
MappeableContainerclear in class MappeableContainerpublic MappeableContainer clone()
clone in class MappeableContainerpublic boolean contains(short x)
MappeableContainercontains in class MappeableContainerx - value to checkpublic void fillLeastSignificant16bits(int[] x,
int i,
int mask)
MappeableContainerfillLeastSignificant16bits in class MappeableContainerx - provided arrayi - starting indexmask - indicates most significant bitsprotected int getArraySizeInBytes()
MappeableContainergetArraySizeInBytes in class MappeableContainerprotected static int getArraySizeInBytes(int nbrruns)
public int getCardinality()
MappeableContainergetCardinality in class MappeableContainerpublic ShortIterator getShortIterator()
MappeableContainergetShortIterator in class MappeableContainerpublic ShortIterator getReverseShortIterator()
MappeableContainergetReverseShortIterator in class MappeableContainerpublic int getSizeInBytes()
MappeableContainergetSizeInBytes in class MappeableContainerpublic MappeableContainer iand(MappeableArrayContainer x)
MappeableContaineriand in class MappeableContainerx - other containerpublic MappeableContainer iand(MappeableBitmapContainer x)
MappeableContaineriand in class MappeableContainerx - other containerpublic MappeableContainer iandNot(MappeableArrayContainer x)
MappeableContaineriandNot in class MappeableContainerx - other containerpublic MappeableContainer iandNot(MappeableBitmapContainer x)
MappeableContaineriandNot in class MappeableContainerx - other containerpublic MappeableContainer inot(int rangeStart, int rangeEnd)
MappeableContainerinot in class MappeableContainerrangeStart - beginning of range (inclusive); 0 is beginning of this
container.rangeEnd - ending of range (exclusive)public MappeableContainer ior(MappeableArrayContainer x)
MappeableContainerior in class MappeableContainerx - other containerpublic MappeableContainer ior(MappeableBitmapContainer x)
MappeableContainerior in class MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableArrayContainer x)
MappeableContainerixor in class MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableBitmapContainer x)
MappeableContainerixor in class MappeableContainerx - other containerpublic MappeableContainer not(int rangeStart, int rangeEnd)
MappeableContainernot in class MappeableContainerrangeStart - beginning of range (inclusive); 0 is beginning of this
container.rangeEnd - ending of range (exclusive)public MappeableContainer or(MappeableArrayContainer x)
MappeableContaineror in class MappeableContainerx - other containerprotected boolean isFull()
protected MappeableContainer ilazyor(MappeableArrayContainer x)
protected MappeableContainer lazyor(MappeableArrayContainer x)
public MappeableContainer or(MappeableBitmapContainer x)
MappeableContaineror in class MappeableContainerx - other containerpublic MappeableContainer remove(short x)
MappeableContainerremove in class MappeableContainerx - to be removedpublic int serializedSizeInBytes()
MappeableContainerserializedSizeInBytes in class MappeableContainerprotected static int serializedSizeInBytes(int numberOfRuns)
public void trim()
MappeableContainertrim in class MappeableContainerprotected boolean isArrayBacked()
isArrayBacked in class MappeableContainerprotected void writeArray(DataOutput out) throws IOException
MappeableContainerwriteArray in class MappeableContainerout - output streamIOException - in case of failurepublic MappeableContainer xor(MappeableArrayContainer x)
MappeableContainerxor in class MappeableContainerx - other containerpublic MappeableContainer xor(MappeableBitmapContainer x)
MappeableContainerxor in class MappeableContainerx - other containerpublic int rank(short lowbits)
MappeableContainerrank in class MappeableContainerlowbits - upper limitpublic short select(int j)
MappeableContainerselect in class MappeableContainerj - index of the valuepublic MappeableContainer limit(int maxcardinality)
MappeableContainerlimit in class MappeableContainermaxcardinality - maximal cardinalitypublic MappeableContainer iadd(int begin, int end)
MappeableContaineriadd in class MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer iremove(int begin, int end)
MappeableContaineriremove in class MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer remove(int begin, int end)
MappeableContainerremove in class MappeableContainerbegin - start of range (inclusive)end - end of range (exclusive)public MappeableContainer and(MappeableRunContainer x)
MappeableContainerand in class MappeableContainerx - other containerpublic MappeableContainer andNot(MappeableRunContainer x)
MappeableContainerandNot in class MappeableContainerx - other containerpublic MappeableContainer iand(MappeableRunContainer x)
MappeableContaineriand in class MappeableContainerx - other containerpublic MappeableContainer iandNot(MappeableRunContainer x)
MappeableContaineriandNot in class MappeableContainerx - other containerpublic MappeableContainer ior(MappeableRunContainer x)
MappeableContainerior in class MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableRunContainer x)
MappeableContainerixor in class MappeableContainerx - other containerpublic MappeableContainer or(MappeableRunContainer x)
MappeableContaineror in class MappeableContainerx - other containerpublic MappeableContainer xor(MappeableRunContainer x)
MappeableContainerxor in class MappeableContainerx - other parameterpublic MappeableContainer repairAfterLazy()
MappeableContainerrepairAfterLazy in class MappeableContainerpublic boolean intersects(MappeableArrayContainer x)
MappeableContainerintersects in class MappeableContainerx - other containerpublic boolean intersects(MappeableBitmapContainer x)
MappeableContainerintersects in class MappeableContainerx - other containerpublic boolean intersects(MappeableRunContainer x)
MappeableContainerintersects in class MappeableContainerx - other containerCopyright © 2015. All Rights Reserved.