java.lang.Object
org.bitlap.roaringbitmap.Container
org.bitlap.roaringbitmap.BitmapContainer
- 所有已实现的接口:
Externalizable,Serializable,Cloneable,Iterable<Character>,WordStorage<Container>
Simple bitset-like container.
- 另请参阅:
-
字段概要
字段从类继承的字段 org.bitlap.roaringbitmap.Container
ContainerNames -
构造器概要
构造器构造器说明Create a bitmap container with all bits set to falseBitmapContainer(int firstOfRun, int lastOfRun) Create a bitmap container with a run of ones from firstOfRun to lastOfRun.BitmapContainer(long[] newBitmap, int newCardinality) Create a new container, no copy is made.Creates a new non-mappeable container from a mappeable one. -
方法概要
修饰符和类型方法说明add(char i) Add a short to the container.add(int begin, int end) Return a new container with all shorts in [begin,end) added using an unsigned interpretation.and(ArrayContainer value2) Computes the bitwise AND of this container with another (intersection).and(BitmapContainer value2) Computes the bitwise AND of this container with another (intersection).and(RunContainer x) Computes the bitwise AND of this container with another (intersection).intandCardinality(ArrayContainer value2) intandCardinality(BitmapContainer value2) intandNot(ArrayContainer value2) Computes the bitwise ANDNOT of this container with another (difference).andNot(BitmapContainer value2) Computes the bitwise ANDNOT of this container with another (difference).Computes the bitwise ANDNOT of this container with another (difference).voidclear()Empties the containerclone()booleancontains(char i) Checks whether the contain contains the provided valuebooleancontains(int minimum, int supremum) Checks whether the container contains the entire rangeprotected booleancontains(ArrayContainer arrayContainer) protected booleancontains(BitmapContainer bitmapContainer) protected booleancontains(RunContainer runContainer) voiddeserialize(DataInput in) Deserialize (recover) the container.booleanvoidfillLeastSignificant16bits(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.intfirst()Get the first integer held in the containerflip(char i) Add a short to the container if it is not present, otherwise remove it.voidforAll(int offset, RelativeRangeConsumer rrc) Consume presence information for all values in this container.voidforAllFrom(char startValue, RelativeRangeConsumer rrc) Consume presence information for all values greater or equal to startValue in this container.voidforAllInRange(char startValue, char endValue, RelativeRangeConsumer rrc) Consumer presence information for all values in the range [startValue, endValue) in this container.voidforAllUntil(int offset, char endValue, RelativeRangeConsumer rrc) Consume presence information for all values smaller than endValue in this container.voidforEach(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.intSize of the underlying arrayGets an iterator to visit the contents of the container in batchesintComputes the distinct number of char values in the container.Iterator to visit the char values in the container in ascending order.Iterator to visit the short values in container and pre-compute ranksIterator to visit the char values in the container in descending order.static CharIteratorgetReverseShortIterator(long[] bitmap) Return a bitmap iterator over this arraystatic PeekableCharIteratorgetShortIterator(long[] bitmap) Return a bitmap iterator over this arrayintComputes an estimate of the memory usage of this container.inthashCode()iadd(int begin, int end) Add all shorts in [begin,end) using an unsigned interpretation.iand(ArrayContainer b2) Computes the in-place bitwise AND of this container with another (intersection).iand(BitmapContainer b2) Computes the in-place bitwise AND of this container with another (intersection).iand(RunContainer x) Computes the in-place bitwise AND of this container with another (intersection).Computes the in-place bitwise ANDNOT of this container with another (difference).Computes the in-place bitwise ANDNOT of this container with another (difference).Computes the in-place bitwise ANDNOT of this container with another (difference).inot(int firstOfRange, int lastOfRange) Computes the in-place bitwise NOT of this container (complement).booleanintersects(int minimum, int supremum) Checks if the container intersects with a rangebooleanintersects(ArrayContainer value2) Returns true if the current container intersects the other container.booleanintersects(BitmapContainer value2) Returns true if the current container intersects the other container.booleanReturns true if the current container intersects the other container.ior(ArrayContainer value2) Computes the in-place bitwise OR of this container with another (union).ior(BitmapContainer b2) Computes the in-place bitwise OR of this container with another (union).ior(RunContainer x) Computes the in-place bitwise OR of this container with another (union).iremove(int begin, int end) Remove shorts in [begin,end) using an unsigned interpretation.booleanisEmpty()Checks whether the container is empty or not.booleanisFull()Checks whether the container is full or not.iterator()ixor(ArrayContainer value2) Computes the in-place bitwise XOR of this container with another (symmetric difference).ixor(BitmapContainer b2) Computes the in-place bitwise XOR of this container with another (symmetric difference).ixor(RunContainer x) Computes the in-place bitwise XOR of this container with another (symmetric difference).intlast()Get the last integer held in the containerprotected Containerlazyor(ArrayContainer value2) protected Containerprotected Containerlimit(int maxcardinality) Create a new Container containing at most maxcardinality integers.intnextAbsentValue(char fromValue) Gets the first absent value greater than or equal to the lower bound.intnextSetBit(int i) Find the index of the next set bit greater or equal to i, returns -1 if none found.intnextValue(char fromValue) Gets the first value greater than or equal to the lower bound, or -1 if no such value exists.not(int firstOfRange, int lastOfRange) Computes the bitwise NOT of this container (complement).intComputes the number of runsintnumberOfRunsLowerBound(int mustNotExceed) Counts how many runs there is in the bitmap, up to a maximumor(ArrayContainer value2) Computes the bitwise OR of this container with another (union).or(BitmapContainer value2) Computes the bitwise OR of this container with another (union).or(RunContainer x) Computes the bitwise OR of this container with another (union).intpreviousAbsentValue(char fromValue) Gets the last value less than or equal to the upper bound.intpreviousValue(char fromValue) Gets the last value less than or equal to the upper bound, or -1 if no such value exists.intrank(char lowbits) Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).voidremove(char i) Remove the char from this container.remove(int begin, int end) Return a new container with all chars in [begin,end) remove using an unsigned interpretation.The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.Convert to RunContainers, when the result is smaller.charselect(int j) Return the jth valuevoidserialize(DataOutput out) Serialize the container.intReport the number of bytes required to serialize this container.protected static intserializedSizeInBytes(int unusedCardinality) Convert the current container to a BitmapContainer, if a conversion is needed.Return the content of this container as a LongBuffer.Convert to a mappeable container.toString()voidtrim()If possible, recover wasted memory.voidwriteArray(DataOutput out) Write just the underlying array.voidwriteArray(ByteBuffer buffer) Write just the underlying array.voidxor(ArrayContainer value2) Computes the bitwise XOR of this container with another (symmetric difference).xor(BitmapContainer value2) Computes the bitwise XOR of this container with another (symmetric difference).xor(RunContainer x) Computes the bitwise XOR of this container with another (symmetric difference).从类继承的方法 org.bitlap.roaringbitmap.Container
and, andCardinality, andNot, assertNonEmpty, contains, getContainerName, iand, iandNot, intersects, ior, iorNot, ixor, lazyIOR, lazyOR, or, orNot, rangeOfOnes, xor, xorCardinality从接口继承的方法 java.lang.Iterable
forEach, spliterator
-
字段详细资料
-
MAX_CAPACITY
public static final int MAX_CAPACITY- 另请参阅:
-
-
构造器详细资料
-
BitmapContainer
public BitmapContainer()Create a bitmap container with all bits set to false -
BitmapContainer
public BitmapContainer(int firstOfRun, int lastOfRun) Create a bitmap container with a run of ones from firstOfRun to lastOfRun. Caller must ensure that the range isn't so small that an ArrayContainer should have been created instead- 参数:
firstOfRun- first indexlastOfRun- last index (range is exclusive)
-
BitmapContainer
public BitmapContainer(long[] newBitmap, int newCardinality) Create a new container, no copy is made.- 参数:
newBitmap- contentnewCardinality- desired cardinality.
-
BitmapContainer
Creates a new non-mappeable container from a mappeable one. This copies the data.- 参数:
bc- the original container
-
-
方法详细资料
-
getReverseShortIterator
Return a bitmap iterator over this array- 参数:
bitmap- array to be iterated over- 返回:
- an iterator
-
getShortIterator
Return a bitmap iterator over this array- 参数:
bitmap- array to be iterated over- 返回:
- an iterator
-
serializedSizeInBytes
protected static int serializedSizeInBytes(int unusedCardinality) -
add
从类复制的说明:ContainerReturn a new container with all shorts in [begin,end) added using an unsigned interpretation. -
add
从类复制的说明:ContainerAdd a short to the container. May generate a new container.- 指定者:
add在接口中WordStorage<Container>- 指定者:
add在类中Container- 参数:
i- short to be added- 返回:
- the new container
-
and
从类复制的说明:ContainerComputes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected. -
and
从类复制的说明:ContainerComputes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected. -
and
从类复制的说明:ContainerComputes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected. -
andCardinality
- 指定者:
andCardinality在类中Container
-
andCardinality
- 指定者:
andCardinality在类中Container
-
andCardinality
- 指定者:
andCardinality在类中Container
-
andNot
从类复制的说明:ContainerComputes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected. -
andNot
从类复制的说明:ContainerComputes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected. -
andNot
从类复制的说明:ContainerComputes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected. -
clear
public void clear()从类复制的说明:ContainerEmpties the container -
clone
-
isEmpty
public boolean isEmpty()从类复制的说明:ContainerChecks whether the container is empty or not.- 指定者:
isEmpty在接口中WordStorage<Container>- 指定者:
isEmpty在类中Container- 返回:
- true if the container is empty.
-
contains
public boolean contains(char i) 从类复制的说明:ContainerChecks whether the contain contains the provided value -
contains
public boolean contains(int minimum, int supremum) 从类复制的说明:ContainerChecks whether the container contains the entire range -
contains
-
contains
-
contains
-
deserialize
从类复制的说明:ContainerDeserialize (recover) the container.- 指定者:
deserialize在类中Container- 参数:
in- the DataInput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
equals
-
fillLeastSignificant16bits
public void fillLeastSignificant16bits(int[] x, int i, int mask) 从类复制的说明:ContainerFill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.- 指定者:
fillLeastSignificant16bits在类中Container- 参数:
x- provided arrayi- starting indexmask- indicates most significant bits
-
flip
从类复制的说明:ContainerAdd a short to the container if it is not present, otherwise remove it. May generate a new container. -
getArraySizeInBytes
public int getArraySizeInBytes()从类复制的说明:ContainerSize of the underlying array- 指定者:
getArraySizeInBytes在类中Container- 返回:
- size in bytes
-
getCardinality
public int getCardinality()从类复制的说明:ContainerComputes the distinct number of char values in the container. Can be expected to run in constant time.- 指定者:
getCardinality在类中Container- 返回:
- the cardinality
-
getReverseCharIterator
从类复制的说明:ContainerIterator to visit the char values in the container in descending order.- 指定者:
getReverseCharIterator在类中Container- 返回:
- iterator
-
getCharIterator
从类复制的说明:ContainerIterator to visit the char values in the container in ascending order.- 指定者:
getCharIterator在类中Container- 返回:
- iterator
-
getCharRankIterator
从类复制的说明:ContainerIterator to visit the short values in container and pre-compute ranks- 指定者:
getCharRankIterator在类中Container- 返回:
- iterator
-
getBatchIterator
从类复制的说明:ContainerGets an iterator to visit the contents of the container in batches- 指定者:
getBatchIterator在类中Container- 返回:
- iterator
-
getSizeInBytes
public int getSizeInBytes()从类复制的说明:ContainerComputes an estimate of the memory usage of this container. The estimate is not meant to be exact.- 指定者:
getSizeInBytes在类中Container- 返回:
- estimated memory usage in bytes
-
hashCode
public int hashCode() -
iadd
从类复制的说明:ContainerAdd all shorts in [begin,end) using an unsigned interpretation. May generate a new container. -
iand
从类复制的说明:ContainerComputes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iand
从类复制的说明:ContainerComputes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iand
从类复制的说明:ContainerComputes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iandNot
从类复制的说明:ContainerComputes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iandNot
从类复制的说明:ContainerComputes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iandNot
从类复制的说明:ContainerComputes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
inot
从类复制的说明:ContainerComputes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected. The current container is generally modified. May generate a new container. -
intersects
从类复制的说明:ContainerReturns true if the current container intersects the other container.- 指定者:
intersects在类中Container- 参数:
value2- other container- 返回:
- whether they intersect
-
intersects
从类复制的说明:ContainerReturns true if the current container intersects the other container.- 指定者:
intersects在类中Container- 参数:
value2- other container- 返回:
- whether they intersect
-
intersects
从类复制的说明:ContainerReturns true if the current container intersects the other container.- 指定者:
intersects在类中Container- 参数:
x- other container- 返回:
- whether they intersect
-
intersects
public boolean intersects(int minimum, int supremum) 从类复制的说明:ContainerChecks if the container intersects with a range- 指定者:
intersects在类中Container- 参数:
minimum- the inclusive unsigned lower bound of the rangesupremum- the exclusive unsigned upper bound of the range- 返回:
- true if the container intersects the range
-
ior
从类复制的说明:ContainerComputes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ior
从类复制的说明:ContainerComputes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ior
从类复制的说明:ContainerComputes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iremove
从类复制的说明:ContainerRemove shorts in [begin,end) using an unsigned interpretation. May generate a new container. -
iterator
-
ixor
从类复制的说明:ContainerComputes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ixor
从类复制的说明:ContainerComputes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ixor
从类复制的说明:ContainerComputes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
lazyor
-
lazyor
-
lazyor
-
limit
从类复制的说明:ContainerCreate a new Container containing at most maxcardinality integers. -
nextSetBit
public int nextSetBit(int i) Find the index of the next set bit greater or equal to i, returns -1 if none found.- 参数:
i- starting index- 返回:
- index of the next set bit
-
not
从类复制的说明:ContainerComputes the bitwise NOT of this container (complement). Only those bits within the range are affected. The current container is left unaffected. -
numberOfRunsAdjustment
public int numberOfRunsAdjustment()Computes the number of runs- 返回:
- the number of runs
-
numberOfRunsLowerBound
public int numberOfRunsLowerBound(int mustNotExceed) Counts how many runs there is in the bitmap, up to a maximum- 参数:
mustNotExceed- maximum of runs beyond which counting is pointless- 返回:
- estimated number of courses
-
or
从类复制的说明:ContainerComputes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected. -
isFull
public boolean isFull()从类复制的说明:ContainerChecks whether the container is full or not. -
or
从类复制的说明:ContainerComputes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected. -
or
从类复制的说明:ContainerComputes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected. -
rank
public int rank(char lowbits) 从类复制的说明:ContainerRank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()). -
readExternal
- 指定者:
readExternal在接口中Externalizable- 抛出:
IOException
-
remove
从类复制的说明:ContainerReturn a new container with all chars in [begin,end) remove using an unsigned interpretation. -
remove
从类复制的说明:ContainerRemove the char from this container. May create a new container. -
repairAfterLazy
从类复制的说明:ContainerThe output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.- 指定者:
repairAfterLazy在类中Container- 返回:
- a new valid container
-
runOptimize
从类复制的说明:ContainerConvert to RunContainers, when the result is smaller. Overridden by RunContainer to possibility switch from RunContainer to a smaller alternative. Overridden by BitmapContainer with a more efficient approach.- 指定者:
runOptimize在接口中WordStorage<Container>- 指定者:
runOptimize在类中Container- 返回:
- the new container
-
select
public char select(int j) 从类复制的说明:ContainerReturn the jth value -
serialize
从类复制的说明:ContainerSerialize the container.- 指定者:
serialize在类中Container- 参数:
out- the DataOutput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
serializedSizeInBytes
public int serializedSizeInBytes()从类复制的说明:ContainerReport the number of bytes required to serialize this container.- 指定者:
serializedSizeInBytes在类中Container- 返回:
- the size in bytes
-
toLongBuffer
Return the content of this container as a LongBuffer. This creates a copy and might be relatively slow.- 返回:
- the LongBuffer
-
toMappeableContainer
从类复制的说明:ContainerConvert to a mappeable container.- 指定者:
toMappeableContainer在类中Container- 返回:
- the mappeable container
-
toString
-
trim
public void trim()从类复制的说明:ContainerIf possible, recover wasted memory. -
writeArray
从类复制的说明:ContainerWrite just the underlying array.- 指定者:
writeArray在类中Container- 参数:
out- output stream- 抛出:
IOException- in case of failure
-
writeArray
从类复制的说明:ContainerWrite just the underlying array.- 指定者:
writeArray在类中Container- 参数:
buffer- ByteBuffer to write to
-
writeExternal
- 指定者:
writeExternal在接口中Externalizable- 抛出:
IOException
-
xor
从类复制的说明:ContainerComputes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected. -
xor
从类复制的说明:ContainerComputes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected. -
xor
从类复制的说明:ContainerComputes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected. -
forEach
从类复制的说明:ContainerIterate through the values of this container and pass them along to the IntConsumer, using msb as the 16 most significant bits. -
forAll
从类复制的说明:ContainerConsume presence information for all values in this container. -
forAllFrom
从类复制的说明:ContainerConsume presence information for all values greater or equal to startValue in this container.- 指定者:
forAllFrom在类中Container- 参数:
startValue- First value to consume. Corresponds to relativePos=0 in the range consumer.rrc- consumer
-
forAllUntil
从类复制的说明:ContainerConsume presence information for all values smaller than endValue in this container.- 指定者:
forAllUntil在类中Container- 参数:
offset- First value in this container corresponds to this relativePos in the range consumer.endValue- First value greater than last value to consume.rrc- consumer
-
forAllInRange
从类复制的说明:ContainerConsumer presence information for all values in the range [startValue, endValue) in this container.- 指定者:
forAllInRange在类中Container- 参数:
startValue- First value to consume. Corresponds to relativePos=0 in the range consumer.endValue- First value greater than last value to consume.rrc- consumer
-
toBitmapContainer
从类复制的说明:ContainerConvert the current container to a BitmapContainer, if a conversion is needed. If the container is already a bitmap, the container is returned unchanged.- 指定者:
toBitmapContainer在类中Container- 返回:
- a bitmap container
-
nextValue
public int nextValue(char fromValue) 从类复制的说明:ContainerGets the first value greater than or equal to the lower bound, or -1 if no such value exists. -
previousValue
public int previousValue(char fromValue) 从类复制的说明:ContainerGets the last value less than or equal to the upper bound, or -1 if no such value exists.- 指定者:
previousValue在类中Container- 参数:
fromValue- the upper bound (inclusive)- 返回:
- the previous value
-
nextAbsentValue
public int nextAbsentValue(char fromValue) 从类复制的说明:ContainerGets the first absent value greater than or equal to the lower bound.- 指定者:
nextAbsentValue在类中Container- 参数:
fromValue- the lower bound (inclusive)- 返回:
- the next absent value
-
previousAbsentValue
public int previousAbsentValue(char fromValue) 从类复制的说明:ContainerGets the last value less than or equal to the upper bound.- 指定者:
previousAbsentValue在类中Container- 参数:
fromValue- the upper bound (inclusive)- 返回:
- the previous absent value
-
first
public int first()从类复制的说明:ContainerGet the first integer held in the container -
last
public int last()从类复制的说明:ContainerGet the last integer held in the container
-