Class FloatListArray

java.lang.Object
de.grogra.xl.util.FloatList
de.grogra.mesh.utils.FloatListArray
All Implemented Interfaces:
FloatConsumer, VoidToFloatGenerator, Serializable, Cloneable

public class FloatListArray extends FloatList
See Also:
  • Field Details

    • currentList

      public FloatList currentList
    • shouldContinue

      public boolean shouldContinue
      True if there is enough memory to add more to the list
  • Constructor Details

    • FloatListArray

      public FloatListArray()
    • FloatListArray

      public FloatListArray(int size)
  • Method Details

    • safelyCreate

      public FloatList safelyCreate(int size)
    • safelyCast

      public float[] safelyCast(FloatList l)
    • ensureCapacity

      public void ensureCapacity(int capacity)
      If the capacity is not high enough, the currentList is added to the list of lists and a new FloatList is created
      Overrides:
      ensureCapacity in class FloatList
      Parameters:
      capacity - the desired minimum capacity
    • add

      public boolean add(float o)
      Description copied from class: FloatList
      Adds o as last element to this list.
      Overrides:
      add in class FloatList
      Parameters:
      o - the value to add
      Returns:
      true
    • addAll

      public FloatList addAll(float[] v, int begin, int length)
      Description copied from class: FloatList
      Appends length components of v to this list, starting at index begin.
      Overrides:
      addAll in class FloatList
      Parameters:
      v - the array of elements to add
      begin - the array index to begin with
      length - the number of elements to add
      Returns:
      this list
    • toArray

      public float[] toArray()
      Description copied from class: FloatList
      Returns an array containing the elements of this list.
      Overrides:
      toArray in class FloatList
      Returns:
      an array copy of this list
    • toArray

      public float[] toArray(int x)
      This toArray is specifically made for the collection display, where each object HAS to be a set of x floats.
    • reduce

      public float[] reduce(int i)
      Returns an array of the size - i of the elements
    • toArray

      public float[] toArray(float[] array)
      Description copied from class: FloatList
      Returns an array containing the elements of this list. The type of the returned array is that of the specified array. If this list fits in the specified array, it is returned therein. Otherwise, a new array is allocated whose length is the size of this list's size, the values of this list are copied into the new array, and this array is returned.

      If there is room for an additional element in the array, a 0-value is written behind the last copied element.

      Overrides:
      toArray in class FloatList
      Parameters:
      array - an array to use
      Returns:
      an array copy of this list
    • arraycopyAll

      public static void arraycopyAll(FloatListArray src, int srcIndex, float[] dest, int destIndex, int length)
    • clone

      public Object clone()
      Overrides:
      clone in class FloatList
    • trimToSize

      public void trimToSize()
      Description copied from class: FloatList
      Trims the capacity of this list to be its current size.
      Overrides:
      trimToSize in class FloatList
    • add

      public void add(int index, float o)
      Description copied from class: FloatList
      Inserts o at position index to this list. If index is not less than size, the list is enlarged and filled with 0-values before.
      Overrides:
      add in class FloatList
      Parameters:
      index - the insert position
      o - the value to insert
    • addIfNotContained

      public void addIfNotContained(float o)
      Description copied from class: FloatList
      Adds o as last element to this list if is not yet contained as reported by FloatList.contains(float).
      Overrides:
      addIfNotContained in class FloatList
      Parameters:
      o - the value to add
    • addAll

      public FloatList addAll(FloatList v)
      Description copied from class: FloatList
      Appends all elements of v to this list.
      Overrides:
      addAll in class FloatList
      Parameters:
      v - the list of elements to add
      Returns:
      this list
    • removeAt

      public float removeAt(int index)
      Description copied from class: FloatList
      Removes the element at position index.
      Overrides:
      removeAt in class FloatList
      Parameters:
      index - the position of the element to be removed
      Returns:
      the value of the removed element
    • remove

      public boolean remove(float o)
      Description copied from class: FloatList
      Removes the element o. The last occurence of o in this list is removed.
      Overrides:
      remove in class FloatList
      Parameters:
      o - the element to be removed
      Returns:
      true iff o was found and removed from the list
    • set

      public float set(int index, float o)
      Description copied from class: FloatList
      Sets the element at position index to o. If index is not less than size, the list is enlarged and filled with 0-values before.
      Overrides:
      set in class FloatList
      Parameters:
      index - the position
      o - the new value
      Returns:
      the old value at index
    • get

      public float get(int index)
      Description copied from class: FloatList
      Returns the list element at index. If index is not less than size, 0 is returned.
      Overrides:
      get in class FloatList
      Parameters:
      index - the position
      Returns:
      the value at index
    • peek

      public float peek(int index)
      Description copied from class: FloatList
      Returns the list element at index as seen from the top, i.e., at absolute position size - index. Thus, the topmost element has index 1.
      Overrides:
      peek in class FloatList
      Parameters:
      index - the position as seen from the top
      Returns:
      the value at that position
    • contains

      public boolean contains(float o)
      Description copied from class: FloatList
      Returns true iff this list contains the given element o.
      Overrides:
      contains in class FloatList
      Parameters:
      o - a value
      Returns:
      true iff o is contained
    • indexOf

      public int indexOf(float o)
      Description copied from class: FloatList
      Returns the index of o in this list.
      Overrides:
      indexOf in class FloatList
      Parameters:
      o - a value
      Returns:
      the index of o, or -1 of o is not contained
    • lastIndexOf

      public int lastIndexOf(float o)
      Description copied from class: FloatList
      Returns the last index of o in this list.
      Overrides:
      lastIndexOf in class FloatList
      Parameters:
      o - a value
      Returns:
      the index of o, or -1 of o is not contained
    • binarySearch

      public int binarySearch(float value)
      Description copied from class: FloatList
      Searches this list for the specified value using the binary search algorithm. This list has to be sorted in ascending order.
      Overrides:
      binarySearch in class FloatList
      Parameters:
      value - the value to be searched for
      Returns:
      index of the searched value, if it is contained in this list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the value would be inserted into the list: the index of the first element greater than the value, or FloatList.size(), if all elements in the list are less than the specified value.
    • writeTo

      public void writeTo(FloatBuffer out)
      Overrides:
      writeTo in class FloatList
    • pop

      public float pop()
      Description copied from class: FloatList
      Removes and returns the object at the top of this list.
      Overrides:
      pop in class FloatList
      Returns:
      the removed object from the top of this list
    • setSize

      public void setSize(int size)
      Description copied from class: FloatList
      Sets the size of this list to the given value. If the new size is greater than the old size, the new elements are initialized with 0-values.
      Overrides:
      setSize in class FloatList
      Parameters:
      size - the new size
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class FloatList
    • consume

      public void consume(float value)
      Description copied from interface: FloatConsumer
      Receives a value of type float.
      Specified by:
      consume in interface FloatConsumer
      Overrides:
      consume in class FloatList
    • evaluateFloat

      public void evaluateFloat(FloatConsumer cons)
      Description copied from class: FloatList
      This generator method yields all values to cons.
      Specified by:
      evaluateFloat in interface VoidToFloatGenerator
      Overrides:
      evaluateFloat in class FloatList
      Parameters:
      cons - the consumer which receives the values
    • values

      public void values(FloatConsumer cons)
      Description copied from class: FloatList
      Overrides:
      values in class FloatList