Interface PackedArray<T>

All Superinterfaces:
LArrayAccessor<T>
All Known Implementing Classes:
PackedArray_F32, PackedArray_F64, PackedArrayPoint2D_F32, PackedArrayPoint2D_F64, PackedArrayPoint2D_I16, PackedArrayPoint2D_I32, PackedArrayPoint3D_F32, PackedArrayPoint3D_F64, PackedArrayPoint4D_F32, PackedArrayPoint4D_F64, PackedBigArray_F32, PackedBigArray_F64, PackedBigArrayPoint2D_F32, PackedBigArrayPoint2D_F64, PackedBigArrayPoint3D_F32, PackedBigArrayPoint3D_F64, PackedBigArrayPoint4D_F32, PackedBigArrayPoint4D_F64

public interface PackedArray<T> extends LArrayAccessor<T>
Interface for objects which are stored in a dense array instead as individual elements. This is typically implemented internally as a structure of array format.
  • Method Details

    • reset

      PackedArray<T> reset()
      Resets the array's size to be zero
      Returns:
      An instance of 'this' for chaining
    • resize

      void resize(int size)
      Resizes the array. If the size has increased then new elements are given the default value
    • removeSwap

      void removeSwap(int index)
      Removes the index and copies in the last element. O(1), but changes the order
    • reserve

      PackedArray<T> reserve(int numElements)
      Ensure there is enough space to store 'numElements' before the internal array needs to grow. Does not change the size
      Parameters:
      numElements - Minimum number of elements allocated to the array
      Returns:
      An instance of 'this' for chaining
    • append

      void append(T element)
      Appends a copy to the end of the array
      Parameters:
      element - (Input) The element which is copied then added
    • set

      void set(int index, T element)
      Sets an element's value
    • forIdx

      void forIdx(int idx0, int idx1, PackedArray.ProcessIndex<T> op)
      Passes in each object and index within the specified range. Modifications to the passed in objcet will be saved in the array.
      Parameters:
      idx0 - Initial index. Inclusive
      idx1 - Last index, Exclusive
      op - The operation to process each element
    • isEquals

      boolean isEquals(PackedArray<T> other)
      Checks to see if the two data structures are equal