Class FloatArrayList
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractFloatIterable
-
- org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList
-
- All Implemented Interfaces:
Externalizable,Serializable,MutableFloatCollection,FloatIterable,FloatList,MutableFloatList,OrderedFloatIterable,ReversibleFloatIterable,PrimitiveIterable
public class FloatArrayList extends AbstractFloatIterable implements MutableFloatList, Externalizable
FloatArrayList is similar to FastList, and is memory-optimized for float primitives. This file was automatically generated from template file primitiveArrayList.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FloatArrayList()FloatArrayList(float... array)FloatArrayList(int initialCapacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(float newItem)booleanaddAll(float... source)booleanaddAll(FloatIterable source)booleanaddAllAtIndex(int index, float... source)booleanaddAllAtIndex(int index, FloatIterable source)voidaddAtIndex(int index, float element)booleanallSatisfy(FloatPredicate predicate)booleananySatisfy(FloatPredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)LazyFloatIterableasReversed()MutableFloatListasSynchronized()MutableFloatListasUnmodifiable()intbinarySearch(float value)MutableList<Float>boxed()RichIterable<FloatIterable>chunk(int size)voidclear()<V> MutableList<V>collect(FloatToObjectFunction<? extends V> function)<V,R extends Collection<V>>
Rcollect(FloatToObjectFunction<? extends V> function, R target)booleancontains(float value)intcount(FloatPredicate predicate)floatdetectIfNone(FloatPredicate predicate, float ifNone)MutableFloatListdistinct()doubledotProduct(FloatList list)voideach(FloatProcedure procedure)voidensureCapacity(int minCapacity)booleanequals(Object otherList)MutableFloatIteratorfloatIterator()voidforEachWithIndex(FloatIntProcedure procedure)floatget(int index)floatgetFirst()floatgetLast()inthashCode()intindexOf(float value)<T> TinjectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(float value)floatmax()floatmin()FloatArrayListnewEmpty()Creates a new empty FloatArrayList.static FloatArrayListnewList(FloatIterable source)static FloatArrayListnewListWith(float... elements)Creates a new list using the passedelementsargument as the backing store.static FloatArrayListnewWithNValues(int size, float value)voidreadExternal(ObjectInput in)FloatArrayListreject(FloatPredicate predicate)<R extends MutableFloatCollection>
Rreject(FloatPredicate predicate, R target)booleanremove(float value)booleanremoveAll(float... source)booleanremoveAll(FloatIterable source)floatremoveAtIndex(int index)booleanremoveIf(FloatPredicate predicate)booleanretainAll(float... source)booleanretainAll(FloatIterable source)FloatArrayListreverseThis()FloatArrayListselect(FloatPredicate predicate)<R extends MutableFloatCollection>
Rselect(FloatPredicate predicate, R target)floatset(int index, float element)intsize()FloatArrayListsortThis()FloatArrayListsortThis(FloatComparator comparator)MutableFloatListsubList(int fromIndex, int toIndex)doublesum()voidswap(int index1, int index2)float[]toArray()float[]toArray(float[] target)ImmutableFloatListtoImmutable()FloatArrayListtoReversed()MutableFloatStacktoStack()voidtrimToSize()FloatArrayListwith(float element)FloatArrayListwith(float element1, float element2)FloatArrayListwith(float element1, float element2, float element3)FloatArrayListwith(float element1, float element2, float element3, float... elements)FloatArrayListwithAll(FloatIterable elements)FloatArrayListwithout(float element)FloatArrayListwithoutAll(FloatIterable elements)static FloatArrayListwrapCopy(float... array)Creates a new list by first copying the array passed in.voidwriteExternal(ObjectOutput out)<T> MutableList<FloatObjectPair<T>>zip(Iterable<T> iterable)MutableList<FloatFloatPair>zipFloat(FloatIterable iterable)-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractFloatIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.FloatIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.FloatList
forEachInBoth
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableFloatList
collectWithIndex, rejectWithIndex, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, sortThisBy, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedFloatIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
-
-
-
Method Detail
-
newListWith
public static FloatArrayList newListWith(float... elements)
Creates a new list using the passedelementsargument as the backing store.!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else. !!!
-
newList
public static FloatArrayList newList(FloatIterable source)
-
newWithNValues
public static FloatArrayList newWithNValues(int size, float value)
-
wrapCopy
public static FloatArrayList wrapCopy(float... array)
Creates a new list by first copying the array passed in.
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clearin interfaceMutableFloatCollection
-
contains
public boolean contains(float value)
- Specified by:
containsin interfaceFloatIterable
-
getFirst
public float getFirst()
- Specified by:
getFirstin interfaceOrderedFloatIterable
-
getLast
public float getLast()
- Specified by:
getLastin interfaceReversibleFloatIterable
-
indexOf
public int indexOf(float value)
- Specified by:
indexOfin interfaceOrderedFloatIterable
-
lastIndexOf
public int lastIndexOf(float value)
- Specified by:
lastIndexOfin interfaceFloatList
-
trimToSize
public void trimToSize()
-
ensureCapacity
public void ensureCapacity(int minCapacity)
-
add
public boolean add(float newItem)
- Specified by:
addin interfaceMutableFloatCollection
-
addAll
public boolean addAll(float... source)
- Specified by:
addAllin interfaceMutableFloatCollection
-
addAll
public boolean addAll(FloatIterable source)
- Specified by:
addAllin interfaceMutableFloatCollection
-
addAtIndex
public void addAtIndex(int index, float element)- Specified by:
addAtIndexin interfaceMutableFloatList
-
addAllAtIndex
public boolean addAllAtIndex(int index, float... source)- Specified by:
addAllAtIndexin interfaceMutableFloatList
-
addAllAtIndex
public boolean addAllAtIndex(int index, FloatIterable source)- Specified by:
addAllAtIndexin interfaceMutableFloatList
-
remove
public boolean remove(float value)
- Specified by:
removein interfaceMutableFloatCollection
-
removeIf
public boolean removeIf(FloatPredicate predicate)
- Specified by:
removeIfin interfaceMutableFloatCollection
-
removeAll
public boolean removeAll(FloatIterable source)
- Specified by:
removeAllin interfaceMutableFloatCollection
-
removeAll
public boolean removeAll(float... source)
- Specified by:
removeAllin interfaceMutableFloatCollection
-
retainAll
public boolean retainAll(FloatIterable source)
- Specified by:
retainAllin interfaceMutableFloatCollection
-
retainAll
public boolean retainAll(float... source)
- Specified by:
retainAllin interfaceMutableFloatCollection
-
removeAtIndex
public float removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableFloatList
-
set
public float set(int index, float element)- Specified by:
setin interfaceMutableFloatList
-
swap
public void swap(int index1, int index2)- Specified by:
swapin interfaceMutableFloatList
-
with
public FloatArrayList with(float element)
- Specified by:
within interfaceMutableFloatCollection- Specified by:
within interfaceMutableFloatList
-
without
public FloatArrayList without(float element)
- Specified by:
withoutin interfaceMutableFloatCollection- Specified by:
withoutin interfaceMutableFloatList
-
withAll
public FloatArrayList withAll(FloatIterable elements)
- Specified by:
withAllin interfaceMutableFloatCollection- Specified by:
withAllin interfaceMutableFloatList
-
withoutAll
public FloatArrayList withoutAll(FloatIterable elements)
- Specified by:
withoutAllin interfaceMutableFloatCollection- Specified by:
withoutAllin interfaceMutableFloatList
-
with
public FloatArrayList with(float element1, float element2)
-
with
public FloatArrayList with(float element1, float element2, float element3)
-
with
public FloatArrayList with(float element1, float element2, float element3, float... elements)
-
floatIterator
public MutableFloatIterator floatIterator()
- Specified by:
floatIteratorin interfaceFloatIterable- Specified by:
floatIteratorin interfaceMutableFloatCollection
-
each
public void each(FloatProcedure procedure)
- Specified by:
eachin interfaceFloatIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(FloatIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedFloatIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceFloatIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedFloatIterable- Specified by:
injectIntoWithIndexin interfaceReversibleFloatIterable
-
chunk
public RichIterable<FloatIterable> chunk(int size)
- Specified by:
chunkin interfaceFloatIterable
-
count
public int count(FloatPredicate predicate)
- Specified by:
countin interfaceFloatIterable
-
anySatisfy
public boolean anySatisfy(FloatPredicate predicate)
- Specified by:
anySatisfyin interfaceFloatIterable
-
allSatisfy
public boolean allSatisfy(FloatPredicate predicate)
- Specified by:
allSatisfyin interfaceFloatIterable
-
select
public FloatArrayList select(FloatPredicate predicate)
- Specified by:
selectin interfaceFloatIterable- Specified by:
selectin interfaceFloatList- Specified by:
selectin interfaceMutableFloatCollection- Specified by:
selectin interfaceMutableFloatList- Specified by:
selectin interfaceOrderedFloatIterable- Specified by:
selectin interfaceReversibleFloatIterable
-
select
public <R extends MutableFloatCollection> R select(FloatPredicate predicate, R target)
- Specified by:
selectin interfaceFloatIterable- Since:
- 8.1.
-
reject
public FloatArrayList reject(FloatPredicate predicate)
- Specified by:
rejectin interfaceFloatIterable- Specified by:
rejectin interfaceFloatList- Specified by:
rejectin interfaceMutableFloatCollection- Specified by:
rejectin interfaceMutableFloatList- Specified by:
rejectin interfaceOrderedFloatIterable- Specified by:
rejectin interfaceReversibleFloatIterable
-
reject
public <R extends MutableFloatCollection> R reject(FloatPredicate predicate, R target)
- Specified by:
rejectin interfaceFloatIterable- Since:
- 8.1.
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNonein interfaceFloatIterable
-
collect
public <V> MutableList<V> collect(FloatToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceFloatIterable- Specified by:
collectin interfaceFloatList- Specified by:
collectin interfaceMutableFloatCollection- Specified by:
collectin interfaceMutableFloatList- Specified by:
collectin interfaceOrderedFloatIterable- Specified by:
collectin interfaceReversibleFloatIterable
-
collect
public <V,R extends Collection<V>> R collect(FloatToObjectFunction<? extends V> function, R target)
- Specified by:
collectin interfaceFloatIterable- Since:
- 8.1.
-
max
public float max()
- Specified by:
maxin interfaceFloatIterable
-
min
public float min()
- Specified by:
minin interfaceFloatIterable
-
sum
public double sum()
- Specified by:
sumin interfaceFloatIterable
-
dotProduct
public double dotProduct(FloatList list)
- Specified by:
dotProductin interfaceFloatList
-
toArray
public float[] toArray()
- Specified by:
toArrayin interfaceFloatIterable
-
toArray
public float[] toArray(float[] target)
- Specified by:
toArrayin interfaceFloatIterable
-
equals
public boolean equals(Object otherList)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
asUnmodifiable
public MutableFloatList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableFloatCollection- Specified by:
asUnmodifiablein interfaceMutableFloatList
-
asSynchronized
public MutableFloatList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableFloatCollection- Specified by:
asSynchronizedin interfaceMutableFloatList
-
toImmutable
public ImmutableFloatList toImmutable()
- Specified by:
toImmutablein interfaceFloatList- Specified by:
toImmutablein interfaceMutableFloatCollection- Specified by:
toImmutablein interfaceMutableFloatList
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
asReversed
public LazyFloatIterable asReversed()
- Specified by:
asReversedin interfaceReversibleFloatIterable
-
reverseThis
public FloatArrayList reverseThis()
- Specified by:
reverseThisin interfaceMutableFloatList
-
sortThis
public FloatArrayList sortThis()
- Specified by:
sortThisin interfaceMutableFloatList
-
sortThis
public FloatArrayList sortThis(FloatComparator comparator)
- Specified by:
sortThisin interfaceMutableFloatList
-
toReversed
public FloatArrayList toReversed()
- Specified by:
toReversedin interfaceFloatList- Specified by:
toReversedin interfaceMutableFloatList- Specified by:
toReversedin interfaceReversibleFloatIterable
-
binarySearch
public int binarySearch(float value)
- Specified by:
binarySearchin interfaceFloatList
-
distinct
public MutableFloatList distinct()
- Specified by:
distinctin interfaceFloatList- Specified by:
distinctin interfaceMutableFloatList- Specified by:
distinctin interfaceReversibleFloatIterable
-
subList
public MutableFloatList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceFloatList- Specified by:
subListin interfaceMutableFloatList
-
zipFloat
public MutableList<FloatFloatPair> zipFloat(FloatIterable iterable)
- Specified by:
zipFloatin interfaceFloatList- Specified by:
zipFloatin interfaceMutableFloatList- Since:
- 9.1.
-
newEmpty
public FloatArrayList newEmpty()
Creates a new empty FloatArrayList.- Specified by:
newEmptyin interfaceMutableFloatCollection- Specified by:
newEmptyin interfaceMutableFloatList- Since:
- 9.2.
-
zip
public <T> MutableList<FloatObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zipin interfaceFloatList- Specified by:
zipin interfaceMutableFloatList- Since:
- 9.1.
-
boxed
public MutableList<Float> boxed()
- Specified by:
boxedin interfaceMutableFloatList
-
toStack
public MutableFloatStack toStack()
- Specified by:
toStackin interfaceOrderedFloatIterable
-
-