Class FloatList

java.lang.Object
com.mta.tehreer.collections.FloatList
All Implemented Interfaces:
Primitive

public abstract class FloatList extends Object implements Primitive
Represents a primitive list of floats.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    copyTo(float[] array, int atIndex)
    Copies all of the floats in this list to an array, starting at the specified index of the target array.
    boolean
     
    abstract float
    get(int index)
    Returns the float value at the specified index in this list.
    int
     
    static FloatList
    of(float... values)
    Returns a float list whose elements are the specified values.
    abstract int
    Returns the number of floats in this list.
    abstract FloatList
    subList(int fromIndex, int toIndex)
    Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
    float[]
    Returns a new array containing all of the floats in this list in proper sequence (from first to last element).
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FloatList

      public FloatList()
  • Method Details

    • of

      @NonNull public static FloatList of(float... values)
      Returns a float list whose elements are the specified values.
      Parameters:
      values - The elements of the float list.
      Returns:
      A new float list.
    • size

      public abstract int size()
      Returns the number of floats in this list.
      Returns:
      The number of floats in this list.
    • get

      public abstract float get(int index)
      Returns the float value at the specified index in this list.
      Parameters:
      index - Index of the float element to return.
      Returns:
      The float value at the specified index in this list.
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).
    • copyTo

      public abstract void copyTo(@NonNull float[] array, int atIndex)
      Copies all of the floats in this list to an array, starting at the specified index of the target array.
      Parameters:
      array - The array into which the floats of this list are to be copied.
      atIndex - The index in the target array at which copying begins.
      Throws:
      NullPointerException - if array is null.
      IndexOutOfBoundsException - for an illegal endpoint index value (atIndex < 0 || (array.length - atIndex) < size()).
    • subList

      @NonNull public abstract FloatList subList(int fromIndex, int toIndex)
      Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
      Parameters:
      fromIndex - Low endpoint (inclusive) of the sub list.
      toIndex - High endpoint (exclusive) of the sub list.
      Returns:
      A view of the specified range within this list.
      Throws:
      IndexOutOfBoundsException - for an illegal endpoint index value (fromIndex < 0 || toIndex > size() || fromIndex > toIndex).
    • toArray

      @NonNull public float[] toArray()
      Returns a new array containing all of the floats in this list in proper sequence (from first to last element).
      Returns:
      A new array containing all of the floats in this list in proper sequence.
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NonNull public String toString()
      Overrides:
      toString in class Object