Interface PointableRoaringArray

All Superinterfaces:
Cloneable
All Known Implementing Classes:
ImmutableRoaringArray, MutableRoaringArray

public interface PointableRoaringArray extends Cloneable
Generic interface for the array underlying roaring bitmap classes.
  • Method Details

    • advanceUntil

      int advanceUntil(char x, int pos)
      Find the smallest integer index larger than pos such that getKeyAtIndex(index)>=x. If none can be found, return size.
      Parameters:
      x - minimal value
      pos - index to exceed
      Returns:
      the smallest index greater than pos such that getKeyAtIndex(index) is at least as large as min, or size if it is not possible.
    • clone

      Create an independent copy of the underlying array
      Returns:
      a copy
    • containsForContainerAtIndex

      boolean containsForContainerAtIndex(int i, char x)
      This checks whether the container at index i has the value x. This can be faster than calling "getContainerAtIndex" and then calling contains.
      Parameters:
      i - container index (assumed to be non-negative)
      x - 16-bit value to check
      Returns:
      whether the container contains at index i contains x
    • getCardinality

      int getCardinality(int i)
      Returns the cardinality of the container at the given index. This method is expected to be fast.
      Parameters:
      i - index
      Returns:
      the cardinality
    • getContainerIndex

      int getContainerIndex(char x)
      Returns either the index of the container corresponding to key x, or a negative value.
      Parameters:
      x - 16-bit key
      Returns:
      index of container (negative value if no container found)
    • getContainerAtIndex

      MappeableContainer getContainerAtIndex(int i)
      Parameters:
      i - index
      Returns:
      matching container
    • getContainerPointer

      MappeableContainerPointer getContainerPointer()
      Returns:
      a ContainerPointer to iterator over the array
    • getContainerPointer

      MappeableContainerPointer getContainerPointer(int startIndex)
      Parameters:
      startIndex - starting index
      Returns:
      a ContainerPointer to iterator over the array initially positioned at startIndex
    • getIndex

      int getIndex(char x)
      Parameters:
      x - 16-bit key
      Returns:
      corresponding index
    • getKeyAtIndex

      char getKeyAtIndex(int i)
      Parameters:
      i - the index
      Returns:
      16-bit key at the index
    • hasRunCompression

      boolean hasRunCompression()
      Check whether this bitmap has had its runs compressed.
      Returns:
      whether this bitmap has run compression
    • serialize

      void serialize(DataOutput out) throws IOException
      Serialize. The current bitmap is not modified.
      Parameters:
      out - the DataOutput stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • serialize

      void serialize(ByteBuffer buffer)
      Serialize. The current bitmap is not modified.
      Parameters:
      buffer - the buffer to serialize to
    • serializedSizeInBytes

      int serializedSizeInBytes()
      Returns:
      the size that the data structure occupies on disk
    • size

      int size()
      Returns:
      number of keys
    • first

      int first()
      Gets the smallest unsigned (first) integer in the array.
      Returns:
      the smallest unsigned (first) integer in the array
    • last

      int last()
      Gets the largest unsigned (last) integer in the array.
      Returns:
      the largest unsigned (last) integer in the array
    • firstSigned

      int firstSigned()
      Gets the smallest signed integer in the array.
      Returns:
      the smallest signed integer in the array
    • lastSigned

      int lastSigned()
      Gets the largest signed integer in the array.
      Returns:
      the largest signed integer in the array