Interface DogArrayPrimitive<T extends DogArrayPrimitive<T>>

All Known Implementing Classes:
DogArray_B, DogArray_F32, DogArray_F64, DogArray_I32, DogArray_I64, DogArray_I8

public interface DogArrayPrimitive<T extends DogArrayPrimitive<T>>
Interface for growable queues of primitive types
  • Method Summary

    Modifier and Type Method Description
    T copy()  
    void extend​(int size)
    Changes the array to the specified size.
    void flip()
    Flips the elements such that a[i] = a[N-i-1] where N is the number of elements.
    default boolean isEmpty()
    True if the container has no elements
    default boolean isIndexOutOfBounds​(int index)
    Returns true if the specified array index is outside the allowed value range
    void reserve​(int amount)
    Ensures that the internal array's length is at least this size.
    void reset()
    Sets the size to zero.
    void resize​(int size)
    Ensures that the internal array is at least this size.
    void setTo​(T original)
    Turns 'this' into a copy of 'original'
    int size()
    Number of elements in the queue
    void sort()
    Sorts the data from smallest to largest
    void zero()
    Sets all elements to 0 or False for binary queues
  • Method Details

    • reset

      void reset()
      Sets the size to zero.
    • isIndexOutOfBounds

      default boolean isIndexOutOfBounds​(int index)
      Returns true if the specified array index is outside the allowed value range
    • setTo

      void setTo​(T original)
      Turns 'this' into a copy of 'original'
      Parameters:
      original - queue that is to be copied
    • resize

      void resize​(int size)
      Ensures that the internal array is at least this size. Value of elements previously in the array will not be changed. If the size is increased then the value of new elements in undefined. If you wish to resize the array and avoid copying over past values for performance reasons, then you must either resize(0) or call reset() first.
      Parameters:
      size - desired new size
    • extend

      void extend​(int size)
      Changes the array to the specified size. If there is not enough storage, a new internal array is created and the elements copied over. This is the same as: a.reserve(size);a.size = size;
      Parameters:
      size - desired new size
    • reserve

      void reserve​(int amount)
      Ensures that the internal array's length is at least this size. Size is left unchanged. If the array is not empty and it needs to grow then the existing array is copied into the new array.
      Parameters:
      amount - minimum size of internal array
    • flip

      void flip()
      Flips the elements such that a[i] = a[N-i-1] where N is the number of elements.
    • size

      int size()
      Number of elements in the queue
      Returns:
      size of queue
    • zero

      void zero()
      Sets all elements to 0 or False for binary queues
    • copy

      T copy()
    • sort

      void sort()
      Sorts the data from smallest to largest
    • isEmpty

      default boolean isEmpty()
      True if the container has no elements