类 RoaringArray

java.lang.Object
org.bitlap.roaringbitmap.RoaringArray
所有已实现的接口:
Externalizable, Serializable, Cloneable, AppendableStorage<Container>

public final class RoaringArray extends Object implements Cloneable, Externalizable, AppendableStorage<Container>
Specialized array to store the containers used by a RoaringBitmap. This is not meant to be used by end users.
另请参阅:
  • 构造器详细资料

    • RoaringArray

      public RoaringArray()
      create RoaringArray with initial capacity
    • RoaringArray

      public RoaringArray(int initialCapacity)
      create RoaringArray
      参数:
      initialCapacity - initialCapacity
    • RoaringArray

      public RoaringArray(char[] keys, Container[] values, int size)
      create RoaringArray
      参数:
      keys - keys
      values - values
      size - size
  • 方法详细资料

    • getKeys

      public char[] getKeys()
    • getValues

      public Container[] getValues()
    • advanceUntil

      public int advanceUntil(char x, int pos)
      Find the smallest integer index larger than pos such that array[index].key>=x. If none can be found, return size. Based on code by O. Kaser.
      参数:
      x - minimal value
      pos - index to exceed
      返回:
      the smallest index greater than pos such that array[index].key is at least as large as min, or size if it is not possible.
    • append

      public void append(char key, Container value)
      从接口复制的说明: AppendableStorage
      Appends the key and container to the storage, throws if the key is less than the current mark.
      指定者:
      append 在接口中 AppendableStorage<Container>
      参数:
      key - the key to append
      value - the data to append
    • append

      public void append(RoaringArray roaringArray)
      append a roaringArray
      参数:
      roaringArray - roaringArray
    • append

      public void append(RoaringArray sa, int startingIndex, int end)
      Append the values from another array, no copy is made (use with care)
      参数:
      sa - other array
      startingIndex - starting index in the other array
      end - endingIndex (exclusive) in the other array
    • clear

      public void clear()
      clear
    • trim

      public void trim()
      If possible, recover wasted memory.
    • clone

      覆盖:
      clone 在类中 Object
      抛出:
      CloneNotSupportedException
    • deserialize

      public void deserialize(DataInput in) throws IOException
      Deserialize. If the DataInput is available as a byte[] or a ByteBuffer, you could prefer relying on deserialize(ByteBuffer). If the InputStream is >= 8kB, you could prefer relying on deserialize(DataInput, byte[]);
      参数:
      in - the DataInput stream
      抛出:
      IOException - Signals that an I/O exception has occurred.
      InvalidRoaringFormat - if a Roaring Bitmap cookie is missing.
    • deserialize

      public void deserialize(DataInput in, byte[] buffer) throws IOException
      Deserialize.
      参数:
      in - the DataInput stream
      buffer - The buffer gets overwritten with data during deserialization. You can pass a NULL reference as a buffer. A buffer containing at least 8192 bytes might be ideal for performance. It is recommended to reuse the buffer between calls to deserialize (in a single-threaded context) for best performance.
      抛出:
      IOException - Signals that an I/O exception has occurred.
      InvalidRoaringFormat - if a Roaring Bitmap cookie is missing.
    • deserialize

      public void deserialize(ByteBuffer bbf)
      Deserialize (retrieve) this bitmap. See format specification at https://github.com/RoaringBitmap/RoaringFormatSpec The current bitmap is overwritten. It is not necessary that limit() on the input ByteBuffer indicates the end of the serialized data. After loading this RoaringBitmap, you can advance to the rest of the data (if there is more) by setting bbf.position(bbf.position() + bitmap.serializedSizeInBytes()); Note that the input ByteBuffer is effectively copied (with the slice operation) so you should expect the provided ByteBuffer position/mark/limit/order to remain unchanged.
      参数:
      bbf - the byte buffer (can be mapped, direct, array backed etc.
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • getContainer

      public Container getContainer(char x)
      involves a binary search
      参数:
      x - x
      返回:
      container
    • getContainerIndex

      public int getContainerIndex(char x)
    • getContainerAtIndex

      public Container getContainerAtIndex(int i)
    • getContainerPointer

      public ContainerPointer getContainerPointer()
      Create a ContainerPointer for this RoaringArray
      返回:
      a ContainerPointer
    • getContainerPointer

      public ContainerPointer getContainerPointer(int startIndex)
      Create a ContainerPointer for this RoaringArray
      参数:
      startIndex - starting index in the container list
      返回:
      a ContainerPointer
    • getKeyAtIndex

      public char getKeyAtIndex(int i)
      getKeyAtIndex
      参数:
      i - i
      返回:
      char
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • hasRunContainer

      public boolean hasRunContainer()
      hasRunContainer
      返回:
      boolean
    • headerSize

      public int headerSize()
      headerSize
      返回:
      int
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      指定者:
      readExternal 在接口中 Externalizable
      抛出:
      IOException
    • serialize

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

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

      public int serializedSizeInBytes()
      Report the number of bytes required for serialization.
      返回:
      the size in bytes
    • setContainerAtIndex

      public void setContainerAtIndex(int i, Container c)
    • size

      public int size()
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      指定者:
      writeExternal 在接口中 Externalizable
      抛出:
      IOException
    • first

      public int first()
      Gets the first value in the array
      返回:
      the first value in the array
      抛出:
      NoSuchElementException - if empty
    • last

      public int last()
      Gets the last value in the array
      返回:
      the last value in the array
      抛出:
      NoSuchElementException - if empty