public final class MappeableArrayContainer extends MappeableContainer implements Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected int |
cardinality |
protected ShortBuffer |
content |
protected static int |
DEFAULT_MAX_SIZE |
| Constructor and Description |
|---|
MappeableArrayContainer()
Create an array container with default capacity
|
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, inclusive.
|
MappeableArrayContainer(ShortBuffer array,
int cardinality)
Construct a new ArrayContainer backed by the provided ShortBuffer.
|
| Modifier and Type | Method and Description |
|---|---|
MappeableContainer |
add(short x)
running time is in O(n) time if insert is not in order.
|
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).
|
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).
|
void |
clear()
Empties the container
|
MappeableArrayContainer |
clone() |
boolean |
contains(short x)
Checks whether the contain contains the provided value
|
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.
|
protected int |
getArraySizeInBytes()
Size of the underlying array
|
int |
getCardinality()
Computes the distinct number of short values in the container.
|
ShortIterator |
getShortIterator()
Iterator to visit the short values in the container
|
int |
getSizeInBytes()
Computes an estimate of the memory usage of this container.
|
int |
hashCode() |
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).
|
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 |
inot(int firstOfRange,
int lastOfRange)
Computes the in-place bitwise NOT of this container (complement).
|
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).
|
Iterator<Short> |
iterator() |
MappeableContainer |
ixor(MappeableArrayContainer value2)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
ixor(MappeableBitmapContainer x)
Computes the in-place bitwise OR of this container with another (union).
|
MappeableContainer |
limit(int maxcardinality)
Create a new MappeableContainer containing at most maxcardinality integers.
|
protected void |
loadData(MappeableBitmapContainer bitmapContainer) |
MappeableContainer |
not(int firstOfRange,
int lastOfRange)
Computes the bitwise NOT of this container (complement).
|
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).
|
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(short x)
Remove the short from this container.
|
short |
select(int j)
Return the jth value
|
MappeableBitmapContainer |
toBitmapContainer()
Copies the data in a bitmap container.
|
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 value2)
Computes the bitwise OR of this container with another (union).
|
MappeableContainer |
xor(MappeableBitmapContainer x)
Computes the bitwise OR of this container with another (union).
|
and, andNot, iand, iandNot, ior, ixor, lazyIOR, lazyOR, or, rangeOfOnes, xorfinalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected static final int DEFAULT_MAX_SIZE
protected int cardinality
protected ShortBuffer content
public MappeableArrayContainer()
public MappeableArrayContainer(int capacity)
capacity - The capacity of the containerpublic MappeableArrayContainer(int firstOfRun,
int lastOfRun)
firstOfRun - first indexlastOfRun - last index (range is inclusive)public MappeableArrayContainer(ShortBuffer array, int cardinality)
array - ShortBuffer where the data is storedcardinality - cardinality (number of values stored)public MappeableContainer add(short x)
add in class MappeableContainerx - short to be addedpublic MappeableArrayContainer and(MappeableArrayContainer value2)
MappeableContainerand in class MappeableContainervalue2 - other containerpublic MappeableContainer and(MappeableBitmapContainer x)
MappeableContainerand in class MappeableContainerx - other containerpublic MappeableArrayContainer andNot(MappeableArrayContainer value2)
MappeableContainerandNot in class MappeableContainervalue2 - other containerpublic MappeableArrayContainer andNot(MappeableBitmapContainer value2)
MappeableContainerandNot in class MappeableContainervalue2 - other containerpublic void clear()
MappeableContainerclear in class MappeableContainerpublic MappeableArrayContainer 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 MappeableContainerpublic int getCardinality()
MappeableContainergetCardinality in class MappeableContainerpublic ShortIterator getShortIterator()
MappeableContainergetShortIterator in class MappeableContainerpublic int getSizeInBytes()
MappeableContainergetSizeInBytes in class MappeableContainerpublic MappeableArrayContainer iand(MappeableArrayContainer value2)
MappeableContaineriand in class MappeableContainervalue2 - other containerpublic MappeableContainer iand(MappeableBitmapContainer value2)
MappeableContaineriand in class MappeableContainervalue2 - other containerpublic MappeableArrayContainer iandNot(MappeableArrayContainer value2)
MappeableContaineriandNot in class MappeableContainervalue2 - other containerpublic MappeableArrayContainer iandNot(MappeableBitmapContainer value2)
MappeableContaineriandNot in class MappeableContainervalue2 - other containerpublic MappeableContainer inot(int firstOfRange, int lastOfRange)
MappeableContainerinot in class MappeableContainerfirstOfRange - beginning of range (inclusive); 0 is beginning of this
container.lastOfRange - ending of range (exclusive)public MappeableContainer ior(MappeableArrayContainer value2)
MappeableContainerior in class MappeableContainervalue2 - other containerpublic MappeableContainer ior(MappeableBitmapContainer x)
MappeableContainerior in class MappeableContainerx - other containerpublic MappeableContainer ixor(MappeableArrayContainer value2)
MappeableContainerixor in class MappeableContainervalue2 - other containerpublic MappeableContainer ixor(MappeableBitmapContainer x)
MappeableContainerixor in class MappeableContainerx - other containerprotected void loadData(MappeableBitmapContainer bitmapContainer)
public MappeableContainer not(int firstOfRange, int lastOfRange)
MappeableContainernot in class MappeableContainerfirstOfRange - beginning of range (inclusive); 0 is beginning of this
container.lastOfRange - ending of range (exclusive)public MappeableContainer or(MappeableArrayContainer value2)
MappeableContaineror in class MappeableContainervalue2 - other containerpublic MappeableContainer or(MappeableBitmapContainer x)
MappeableContaineror in class MappeableContainerx - other containerpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic MappeableContainer remove(short x)
MappeableContainerremove in class MappeableContainerx - to be removedpublic MappeableBitmapContainer toBitmapContainer()
public void trim()
MappeableContainertrim in class MappeableContainerprotected void writeArray(DataOutput out) throws IOException
MappeableContainerwriteArray in class MappeableContainerout - output streamIOException - in case of failurepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic MappeableContainer xor(MappeableArrayContainer value2)
MappeableContainerxor in class MappeableContainervalue2 - 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 cardinalityCopyright © 2014. All Rights Reserved.