Class LongBigArray

java.lang.Object
io.trino.array.LongBigArray

public final class LongBigArray extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new big array containing one initial segment
    LongBigArray(long initialValue)
    Creates a new big array containing one initial segment filled with the specified default value
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(long index, long value)
    Adds the specified value to the specified element of this big array.
    void
    copyTo(long sourceIndex, LongBigArray 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(long value)
    Fills the entire big array with the specified value.
    long
    get(long index)
    Returns the element of this big array at specified index.
    long
     
    int
    getOffset(long index)
     
    long[]
    getSegment(long index)
     
    void
    increment(long index)
    Increments the element of this big array at specified index.
    void
    set(long index, long 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

    • LongBigArray

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

      public LongBigArray(long initialValue)
      Creates a new big array containing one initial segment filled with the specified default value
  • Method Details

    • sizeOf

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

      public long 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.
    • getSegment

      public long[] getSegment(long index)
    • getOffset

      public int getOffset(long index)
    • set

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

      public void increment(long index)
      Increments the element of this big array at specified index.
      Parameters:
      index - a position in this big array.
    • add

      public void add(long index, long value)
      Adds the specified value to the specified element of this big array.
      Parameters:
      index - a position in this big array.
      value - the value
    • 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.
    • getCapacity

      public long getCapacity()
    • copyTo

      public void copyTo(long sourceIndex, LongBigArray 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.
    • fill

      public void fill(long value)
      Fills the entire big array with the specified value.