Package org.roaringbitmap.buffer
Interface MappeableContainerPointer
- All Superinterfaces:
Cloneable
,Comparable<MappeableContainerPointer>
This interface allows you to iterate over the containers in a roaring bitmap.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
advance()
Move to the next containerclone()
Create a copyint
Returns the cardinality of the current container.This method can be used to check whether there is current a valid container as it returns null when there is not.int
Get the size in bytes of the container.boolean
boolean
Returns true if it is a bitmap container (MappeableBitmapContainer).boolean
Returns true if it is a run container (MappeableRunContainer).char
key()
The key is a 16-bit integer that indicates the position of the container in the roaring bitmap.void
previous()
Move to the previous containerMethods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
advance
void advance()Move to the next container -
clone
MappeableContainerPointer clone()Create a copy- Returns:
- return a clone of this pointer
-
getCardinality
int getCardinality()Returns the cardinality of the current container. Can be faster than loading the container first.- Returns:
- cardinality of the current container
-
getContainer
MappeableContainer getContainer()This method can be used to check whether there is current a valid container as it returns null when there is not.- Returns:
- null or the current container
-
getSizeInBytes
int getSizeInBytes()Get the size in bytes of the container. Used for sorting.- Returns:
- the size in bytes
-
hasContainer
boolean hasContainer()- Returns:
- whether there is a container at the current position
-
isBitmapContainer
boolean isBitmapContainer()Returns true if it is a bitmap container (MappeableBitmapContainer).- Returns:
- boolean indicated if it is a bitmap container
-
isRunContainer
boolean isRunContainer()Returns true if it is a run container (MappeableRunContainer).- Returns:
- boolean indicated if it is a run container
-
key
char key()The key is a 16-bit integer that indicates the position of the container in the roaring bitmap. To be interpreted as an unsigned integer.- Returns:
- the key
-
previous
void previous()Move to the previous container
-