Class HighLowContainer

java.lang.Object
org.roaringbitmap.longlong.HighLowContainer

public class HighLowContainer extends Object
  • Constructor Details

    • HighLowContainer

      public HighLowContainer()
  • Method Details

    • getContainer

      public Container getContainer(long containerIdx)
    • searchContainer

      public ContainerWithIndex searchContainer(byte[] highPart)
      search the container by the given 48 bit high part key
      Parameters:
      highPart - the 48 bit key array
      Returns:
      the container with the container index
    • put

      public void put(byte[] highPart, Container container)
      put the 48 bit key and the corresponding container
      Parameters:
      highPart - the 48 bit key
      container - the container
    • remove

      public void remove(byte[] highPart)
      Attempt to remove the container that corresponds to the 48 bit key.
      Parameters:
      highPart - the 48 bit key
    • containerIterator

      public ContainerIterator containerIterator()
      get a container iterator
      Returns:
      a container iterator
    • highKeyIterator

      public KeyIterator highKeyIterator()
      get a key iterator
      Returns:
      a key iterator
    • highKeyLeafNodeIterator

      public LeafNodeIterator highKeyLeafNodeIterator(boolean reverse)
      Parameters:
      reverse - true ascending order, false: descending order
      Returns:
      the leaf node iterator
    • highKeyLeafNodeIteratorFrom

      public LeafNodeIterator highKeyLeafNodeIteratorFrom(long bound, boolean reverse)
    • replaceContainer

      public void replaceContainer(long containerIdx, Container container)
      replace the specified position one with a fresh container
      Parameters:
      containerIdx - the position of the container
      container - the fresh container
    • isEmpty

      public boolean isEmpty()
      whether it's empty
      Returns:
      true: empty,false: not empty
    • first

      public long first()
      Gets the first value in the array
      Returns:
      the first value in the array
      Throws:
      NoSuchElementException - if empty
    • last

      public long last()
      Gets the last value in the array
      Returns:
      the last value in the array
      Throws:
      NoSuchElementException - if empty
    • serialize

      public void serialize(ByteBuffer buffer) throws IOException
      serialize into the ByteBuffer in little endian
      Parameters:
      buffer - the ByteBuffer should be large enough to hold the data
      Throws:
      IOException - indicate exception happened
    • deserialize

      public void deserialize(ByteBuffer buffer) throws IOException
      deserialize from the input ByteBuffer in little endian
      Parameters:
      buffer - the ByteBuffer
      Throws:
      IOException - indicate exception happened
    • serializedSizeInBytes

      public long serializedSizeInBytes()
      serialized size in bytes
      Returns:
      the size in bytes
    • serialize

      public void serialize(DataOutput dataOutput) throws IOException
      serialize into the byte stream
      Parameters:
      dataOutput - the output stream
      Throws:
      IOException - indicate the io exception happened
    • deserialize

      public void deserialize(DataInput dataInput) throws IOException
      deserialize from the input byte stream
      Parameters:
      dataInput - the input byte stream
      Throws:
      IOException - indicate the io exception happened
    • clear

      public void clear()
      clear to be a empty fresh one
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object