Interface PointableRoaringArray

    • Method Detail

      • advanceUntil

        int advanceUntil​(short 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

        PointableRoaringArray clone()
        Create an independent copy of the underlying array
        Returns:
        a copy
      • containsForContainerAtIndex

        boolean containsForContainerAtIndex​(int i,
                                            short 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​(short 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​(short x)
        Parameters:
        x - 16-bit key
        Returns:
        corresponding index
      • getKeyAtIndex

        short 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 first value in the array
        Returns:
        te first value in the array
      • last

        int last()
        Gets the last value in the array
        Returns:
        te last value in the array