Class ObjectBigArray<T>

java.lang.Object
io.trino.array.ObjectBigArray<T>

public final class ObjectBigArray<T> extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new big array containing one initial segment
    ObjectBigArray(Object initialValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    copyTo(long sourceIndex, ObjectBigArray<T> destination, long destinationIndex, long length)
    Copies this array, beginning at the specified sourceIndex, to the specified destinationIndex of the destination array.
    void
    ensureCapacity(long length)
    Ensures this big array is at least the specified length.
    void
    fill(T value)
    Fills the entire big array with the specified value.
    get(long index)
    Returns the element of this big array at specified index.
    long
    Returns the current available capacity in this array
    boolean
    replace(long index, T value)
    Replaces the element of this big array at specified index.
    void
    set(long index, T value)
    Sets the element of this big array at specified index.
    long
    Returns the size of this big array in bytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ObjectBigArray

      public ObjectBigArray()
      Creates a new big array containing one initial segment
    • ObjectBigArray

      public ObjectBigArray(Object initialValue)
  • Method Details

    • getCapacity

      public long getCapacity()
      Returns the current available capacity in this array
    • sizeOf

      public long sizeOf()
      Returns the size of this big array in bytes.
    • get

      public T get(long index)
      Returns the element of this big array at specified index.
      Parameters:
      index - a position in this big array.
      Returns:
      the element of this big array at the specified position.
    • set

      public void set(long index, T value)
      Sets the element of this big array at specified index.
      Parameters:
      index - a position in this big array.
    • replace

      public boolean replace(long index, T value)
      Replaces the element of this big array at specified index.
      Parameters:
      index - a position in this big array.
      Returns:
      true if the previous value was not null
    • ensureCapacity

      public void ensureCapacity(long length)
      Ensures this big array is at least the specified length. If the array is smaller, segments are added until the array is larger then the specified length.
    • fill

      public void fill(T value)
      Fills the entire big array with the specified value.
    • copyTo

      public void copyTo(long sourceIndex, ObjectBigArray<T> destination, long destinationIndex, long length)
      Copies this array, beginning at the specified sourceIndex, to the specified destinationIndex of the destination array. A subsequence of this array's components are copied to the destination array referenced by destination. The number of components copied is equal to the length argument. The components at positions sourceIndex through sourceIndex+length-1 in this array are copied into positions destinationIndex through destinationIndex+length-1, respectively, of the destination array.