java.lang.Object
de.grogra.xl.util.FloatList
de.grogra.mesh.utils.FloatListArray
- All Implemented Interfaces:
FloatConsumer,VoidToFloatGenerator,Serializable,Cloneable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanTrue if there is enough memory to add more to the list -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(float o) Addsoas last element to this list.voidadd(int index, float o) Insertsoat positionindexto this list.addAll(float[] v, int begin, int length) Appendslengthcomponents ofvto this list, starting at indexbegin.Appends all elements ofvto this list.voidaddIfNotContained(float o) Addsoas last element to this list if is not yet contained as reported byFloatList.contains(float).static voidarraycopyAll(FloatListArray src, int srcIndex, float[] dest, int destIndex, int length) intbinarySearch(float value) Searches this list for the specified value using the binary search algorithm.clone()voidconsume(float value) Receives a value of typefloat.booleancontains(float o) Returnstrueiff this list contains the given elemento.voidensureCapacity(int capacity) If the capacity is not high enough, the currentList is added to the list of lists and a new FloatList is createdbooleanvoidevaluateFloat(FloatConsumer cons) This generator method yields all values tocons.floatget(int index) Returns the list element atindex.intindexOf(float o) Returns the index ofoin this list.intlastIndexOf(float o) Returns the last index ofoin this list.floatpeek(int index) Returns the list element atindexas seen from the top, i.e., at absolute positionsize - index.floatpop()Removes and returns the object at the top of this list.float[]reduce(int i) Returns an array of the size - i of the elementsbooleanremove(float o) Removes the elemento.floatremoveAt(int index) Removes the element at positionindex.float[]safelyCreate(int size) floatset(int index, float o) Sets the element at positionindextoo.voidsetSize(int size) Sets the size of this list to the given value.float[]toArray()Returns an array containing the elements of this list.float[]toArray(float[] array) Returns an array containing the elements of this list.float[]toArray(int x) This toArray is specifically made for the collection display, where each object HAS to be a set of x floats.voidTrims the capacity of this list to be its current size.voidvalues(FloatConsumer cons) This method is an alias forFloatList.evaluateFloat(de.grogra.xl.lang.FloatConsumer).voidwriteTo(FloatBuffer out)
-
Field Details
-
currentList
-
shouldContinue
public boolean shouldContinueTrue if there is enough memory to add more to the list
-
-
Constructor Details
-
FloatListArray
public FloatListArray() -
FloatListArray
public FloatListArray(int size)
-
-
Method Details
-
safelyCreate
-
safelyCast
-
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:
ensureCapacityin classFloatList- Parameters:
capacity- the desired minimum capacity
-
add
public boolean add(float o) Description copied from class:FloatListAddsoas last element to this list. -
addAll
Description copied from class:FloatListAppendslengthcomponents ofvto this list, starting at indexbegin. -
toArray
public float[] toArray()Description copied from class:FloatListReturns an array containing the elements 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:FloatListReturns an array containing the elements of this list. The type of the returned array is that of the specifiedarray. If this list fits in the specifiedarray, 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, a0-value is written behind the last copied element. -
arraycopyAll
public static void arraycopyAll(FloatListArray src, int srcIndex, float[] dest, int destIndex, int length) -
clone
-
trimToSize
public void trimToSize()Description copied from class:FloatListTrims the capacity of this list to be its current size.- Overrides:
trimToSizein classFloatList
-
add
public void add(int index, float o) Description copied from class:FloatListInsertsoat positionindexto this list. Ifindexis not less thansize, the list is enlarged and filled with0-values before. -
addIfNotContained
public void addIfNotContained(float o) Description copied from class:FloatListAddsoas last element to this list if is not yet contained as reported byFloatList.contains(float).- Overrides:
addIfNotContainedin classFloatList- Parameters:
o- the value to add
-
addAll
Description copied from class:FloatListAppends all elements ofvto this list. -
removeAt
public float removeAt(int index) Description copied from class:FloatListRemoves the element at positionindex. -
remove
public boolean remove(float o) Description copied from class:FloatListRemoves the elemento. The last occurence ofoin this list is removed. -
set
public float set(int index, float o) Description copied from class:FloatListSets the element at positionindextoo. Ifindexis not less thansize, the list is enlarged and filled with0-values before. -
get
public float get(int index) Description copied from class:FloatListReturns the list element atindex. Ifindexis not less thansize,0is returned. -
peek
public float peek(int index) Description copied from class:FloatListReturns the list element atindexas seen from the top, i.e., at absolute positionsize - index. Thus, the topmost element has index 1. -
contains
public boolean contains(float o) Description copied from class:FloatListReturnstrueiff this list contains the given elemento. -
indexOf
public int indexOf(float o) Description copied from class:FloatListReturns the index ofoin this list. -
lastIndexOf
public int lastIndexOf(float o) Description copied from class:FloatListReturns the last index ofoin this list.- Overrides:
lastIndexOfin classFloatList- Parameters:
o- a value- Returns:
- the index of
o, or -1 ofois not contained
-
binarySearch
public int binarySearch(float value) Description copied from class:FloatListSearches this list for the specified value using the binary search algorithm. This list has to be sorted in ascending order.- Overrides:
binarySearchin classFloatList- 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, orFloatList.size(), if all elements in the list are less than the specified value.
-
writeTo
-
pop
public float pop()Description copied from class:FloatListRemoves and returns the object at the top of this list. -
setSize
public void setSize(int size) Description copied from class:FloatListSets the size of this list to the given value. If the new size is greater than the old size, the new elements are initialized with0-values. -
equals
-
consume
public void consume(float value) Description copied from interface:FloatConsumerReceives a value of typefloat.- Specified by:
consumein interfaceFloatConsumer- Overrides:
consumein classFloatList
-
evaluateFloat
Description copied from class:FloatListThis generator method yields all values tocons.- Specified by:
evaluateFloatin interfaceVoidToFloatGenerator- Overrides:
evaluateFloatin classFloatList- Parameters:
cons- the consumer which receives the values
-
values
Description copied from class:FloatListThis method is an alias forFloatList.evaluateFloat(de.grogra.xl.lang.FloatConsumer).
-