Class ImmutableFloatSingletonList
java.lang.Object
org.eclipse.collections.impl.list.immutable.primitive.ImmutableFloatSingletonList
- All Implemented Interfaces:
Serializable, ImmutableFloatCollection, FloatIterable, FloatList, ImmutableFloatList, OrderedFloatIterable, ReversibleFloatIterable, PrimitiveIterable
ImmutableFloatSingletonList is an optimization for
ImmutableFloatList of size 1.
This file was automatically generated from template file immutablePrimitiveSingletonList.stg.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallSatisfy(FloatPredicate predicate) Returns true if all of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(FloatPredicate predicate) Returns true if any of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.voidappendString(Appendable appendable) Prints a string representation of this collection onto the givenAppendable.voidappendString(Appendable appendable, String separator) Prints a string representation of this collection onto the givenAppendable.voidappendString(Appendable appendable, String start, String separator, String end) Prints a string representation of this collection onto the givenAppendable.asLazy()Returns a LazyFloatIterable adapter wrapping the source FloatIterable.doubleaverage()intbinarySearch(float value) chunk(int size) Partitions elements in fixed size chunks.<V> ImmutableList<V> collect(FloatToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.booleancontains(float value) Returns true if the value is contained in the FloatIterable, and false if it is not.booleancontainsAll(float... source) Returns true if all of the values specified in the source array are contained in the FloatIterable, and false if they are not.booleancontainsAll(FloatIterable source) Returns true if all of the values specified in the source FloatIterable are contained in the FloatIterable, and false if they are not.intcount(FloatPredicate predicate) Returns a count of the number of elements in the FloatIterable that return true for the specified predicate.floatdetectIfNone(FloatPredicate predicate, float ifNone) distinct()doubledotProduct(FloatList list) voideach(FloatProcedure procedure) A synonym for forEach.booleanFollows the same general contract asList.equals(Object).Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.voidforEachWithIndex(FloatIntProcedure procedure) floatget(int index) floatgetFirst()floatgetLast()inthashCode()Follows the same general contract asList.hashCode().intindexOf(float value) <T> TinjectInto(T injectedValue, ObjectFloatToObjectFunction<? super T, ? extends T> function) <T> TinjectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T, ? extends T> function) booleanisEmpty()Returns true if this iterable has zero items.intlastIndexOf(float value) Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).makeString(String separator) Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)and defaulting the start and end parameters to""(the empty String).makeString(String start, String separator, String end) Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.floatmax()floatmaxIfEmpty(float defaultValue) doublemedian()floatmin()floatminIfEmpty(float defaultValue) newWith(float element) newWithAll(FloatIterable elements) newWithout(float element) newWithoutAll(FloatIterable elements) booleannoneSatisfy(FloatPredicate predicate) Returns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.booleannotEmpty()The English equivalent of !this.isEmpty()reject(FloatPredicate predicate) Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.select(FloatPredicate predicate) Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.intsize()Returns the number of items in this iterable.subList(int fromIndex, int toIndex) doublesum()float[]toArray()Converts the FloatIterable to a primitive float array.float[]toArray(float[] target) Converts the FloatIterable to a primitive float array.toBag()Converts the FloatIterable to a new MutableFloatBag.Returns an immutable copy of this list.toList()Converts the FloatIterable to a new MutableFloatList.toSet()Converts the FloatIterable to a new MutableFloatSet.float[]toStack()Converts the collection to a FloatStack.toString()Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.<T> ImmutableList<FloatObjectPair<T>> Returns anImmutableListformed from thisImmutableFloatListand aListIterableby combining corresponding elements in pairs.zipFloat(FloatIterable iterable) Returns anImmutableListformed from thisImmutableFloatListand anotherFloatListby combining corresponding elements in pairs.Methods inherited from interface FloatIterable
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface FloatList
forEachInBothMethods inherited from interface ImmutableFloatList
collectWithIndex, rejectWithIndex, selectWithIndex, tapMethods inherited from interface OrderedFloatIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
element1
private final float element1
-
-
Constructor Details
-
ImmutableFloatSingletonList
ImmutableFloatSingletonList(float element)
-
-
Method Details
-
get
-
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
-
floatIterator
Description copied from interface:FloatIterableReturns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.- Specified by:
floatIteratorin interfaceFloatIterable
-
each
Description copied from interface:FloatIterableA synonym for forEach.- Specified by:
eachin interfaceFloatIterable- Since:
- 7.0.
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedFloatIterable
-
count
Description copied from interface:FloatIterableReturns a count of the number of elements in the FloatIterable that return true for the specified predicate.- Specified by:
countin interfaceFloatIterable
-
anySatisfy
Description copied from interface:FloatIterableReturns true if any of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceFloatIterable
-
allSatisfy
Description copied from interface:FloatIterableReturns true if all of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceFloatIterable
-
noneSatisfy
Description copied from interface:FloatIterableReturns true if none of the elements in the FloatIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfyin interfaceFloatIterable
-
select
Description copied from interface:FloatIterableReturns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.- Specified by:
selectin interfaceFloatIterable- Specified by:
selectin interfaceFloatList- Specified by:
selectin interfaceImmutableFloatCollection- Specified by:
selectin interfaceImmutableFloatList- Specified by:
selectin interfaceOrderedFloatIterable- Specified by:
selectin interfaceReversibleFloatIterable
-
reject
Description copied from interface:FloatIterableReturns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.- Specified by:
rejectin interfaceFloatIterable- Specified by:
rejectin interfaceFloatList- Specified by:
rejectin interfaceImmutableFloatCollection- Specified by:
rejectin interfaceImmutableFloatList- Specified by:
rejectin interfaceOrderedFloatIterable- Specified by:
rejectin interfaceReversibleFloatIterable
-
detectIfNone
- Specified by:
detectIfNonein interfaceFloatIterable
-
collect
Description copied from interface:FloatIterableReturns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collectin interfaceFloatIterable- Specified by:
collectin interfaceFloatList- Specified by:
collectin interfaceImmutableFloatCollection- Specified by:
collectin interfaceImmutableFloatList- Specified by:
collectin interfaceOrderedFloatIterable- Specified by:
collectin interfaceReversibleFloatIterable
-
sum
public double sum()- Specified by:
sumin interfaceFloatIterable
-
max
public float max()- Specified by:
maxin interfaceFloatIterable
-
maxIfEmpty
public float maxIfEmpty(float defaultValue) - Specified by:
maxIfEmptyin interfaceFloatIterable
-
min
public float min()- Specified by:
minin interfaceFloatIterable
-
minIfEmpty
public float minIfEmpty(float defaultValue) - Specified by:
minIfEmptyin interfaceFloatIterable
-
average
public double average()- Specified by:
averagein interfaceFloatIterable
-
median
public double median()- Specified by:
medianin interfaceFloatIterable
-
toSortedArray
public float[] toSortedArray()- Specified by:
toSortedArrayin interfaceFloatIterable
-
toSortedList
- Specified by:
toSortedListin interfaceFloatIterable
-
binarySearch
public int binarySearch(float value) - Specified by:
binarySearchin interfaceFloatList
-
dotProduct
- Specified by:
dotProductin interfaceFloatList
-
toArray
public float[] toArray()Description copied from interface:FloatIterableConverts the FloatIterable to a primitive float array.- Specified by:
toArrayin interfaceFloatIterable
-
toArray
public float[] toArray(float[] target) Description copied from interface:FloatIterableConverts the FloatIterable to a primitive float array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArrayin interfaceFloatIterable
-
contains
public boolean contains(float value) Description copied from interface:FloatIterableReturns true if the value is contained in the FloatIterable, and false if it is not.- Specified by:
containsin interfaceFloatIterable
-
containsAll
public boolean containsAll(float... source) Description copied from interface:FloatIterableReturns true if all of the values specified in the source array are contained in the FloatIterable, and false if they are not.- Specified by:
containsAllin interfaceFloatIterable
-
containsAll
Description copied from interface:FloatIterableReturns true if all of the values specified in the source FloatIterable are contained in the FloatIterable, and false if they are not.- Specified by:
containsAllin interfaceFloatIterable
-
asReversed
- Specified by:
asReversedin interfaceReversibleFloatIterable
-
toList
Description copied from interface:FloatIterableConverts the FloatIterable to a new MutableFloatList.- Specified by:
toListin interfaceFloatIterable
-
toSet
Description copied from interface:FloatIterableConverts the FloatIterable to a new MutableFloatSet.- Specified by:
toSetin interfaceFloatIterable
-
toBag
Description copied from interface:FloatIterableConverts the FloatIterable to a new MutableFloatBag.- Specified by:
toBagin interfaceFloatIterable
-
asLazy
Description copied from interface:FloatIterableReturns a LazyFloatIterable adapter wrapping the source FloatIterable.- Specified by:
asLazyin interfaceFloatIterable
-
toImmutable
Description copied from interface:FloatListReturns an immutable copy of this list. If the list is immutable, it returns itself.- Specified by:
toImmutablein interfaceFloatList
-
toReversed
- Specified by:
toReversedin interfaceFloatList- Specified by:
toReversedin interfaceImmutableFloatList- Specified by:
toReversedin interfaceReversibleFloatIterable
-
newWith
- Specified by:
newWithin interfaceImmutableFloatCollection- Specified by:
newWithin interfaceImmutableFloatList
-
newWithout
- Specified by:
newWithoutin interfaceImmutableFloatCollection- Specified by:
newWithoutin interfaceImmutableFloatList
-
newWithAll
- Specified by:
newWithAllin interfaceImmutableFloatCollection- Specified by:
newWithAllin interfaceImmutableFloatList
-
newWithoutAll
- Specified by:
newWithoutAllin interfaceImmutableFloatCollection- Specified by:
newWithoutAllin interfaceImmutableFloatList
-
size
public int size()Description copied from interface:PrimitiveIterableReturns the number of items in this iterable.- Specified by:
sizein interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()Description copied from interface:PrimitiveIterableReturns true if this iterable has zero items.- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()Description copied from interface:PrimitiveIterableThe English equivalent of !this.isEmpty()- Specified by:
notEmptyin interfacePrimitiveIterable
-
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
Description copied from interface:FloatIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceFloatIterable- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingFloatIterables of sizesize, except the last will be truncated if the elements don't divide evenly.
-
equals
-
hashCode
-
toString
Description copied from interface:PrimitiveIterableReturns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.Assert.assertEquals("[]", IntLists.mutable.empty().toString()); Assert.assertEquals("[1]", IntLists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());- Specified by:
toStringin interfacePrimitiveIterable- Overrides:
toStringin classObject- Returns:
- a string representation of this PrimitiveIterable
- See Also:
-
makeString
Description copied from interface:PrimitiveIterableReturns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterableReturns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)and defaulting the start and end parameters to""(the empty String).- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterableReturns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString().- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String).- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String, String, String).- Specified by:
appendStringin interfacePrimitiveIterable
-
distinct
- Specified by:
distinctin interfaceFloatList- Specified by:
distinctin interfaceImmutableFloatList- Specified by:
distinctin interfaceReversibleFloatIterable- Since:
- 6.0.
-
subList
- Specified by:
subListin interfaceFloatList- Specified by:
subListin interfaceImmutableFloatList- See Also:
-
zipFloat
Description copied from interface:ImmutableFloatListReturns anImmutableListformed from thisImmutableFloatListand anotherFloatListby combining corresponding elements in pairs. If one of the twoFloatLists is longer than the other, its remaining elements are ignored.- Specified by:
zipFloatin interfaceFloatList- Specified by:
zipFloatin interfaceImmutableFloatList- Since:
- 9.1.
-
zip
Description copied from interface:ImmutableFloatListReturns anImmutableListformed from thisImmutableFloatListand aListIterableby combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zipin interfaceFloatList- Specified by:
zipin interfaceImmutableFloatList- Since:
- 9.1.
-
toStack
Description copied from interface:OrderedFloatIterableConverts the collection to a FloatStack.- Specified by:
toStackin interfaceOrderedFloatIterable
-