Class ImmutableFloatSingletonSet
- java.lang.Object
-
- org.eclipse.collections.impl.set.immutable.primitive.ImmutableFloatSingletonSet
-
- All Implemented Interfaces:
java.io.Serializable,ImmutableFloatCollection,FloatIterable,PrimitiveIterable,FloatSet,ImmutableFloatSet
final class ImmutableFloatSingletonSet extends java.lang.Object implements ImmutableFloatSet, java.io.Serializable
ImmutableFloatSingletonSet is an optimization forImmutableFloatSetof size 1. This file was automatically generated from template file immutablePrimitiveSingletonSet.stg.- Since:
- 4.0.
-
-
Field Summary
Fields Modifier and Type Field Description private floatelementprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ImmutableFloatSingletonSet(float element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(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(java.lang.Appendable appendable)Prints a string representation of this collection onto the givenAppendable.voidappendString(java.lang.Appendable appendable, java.lang.String separator)Prints a string representation of this collection onto the givenAppendable.voidappendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)Prints a string representation of this collection onto the givenAppendable.LazyFloatIterableasLazy()Returns a LazyFloatIterable adapter wrapping the source FloatIterable.doubleaverage()LazyIterable<FloatFloatPair>cartesianProduct(FloatSet set)Returns the set whose members are all possible ordered pairs (a, b) where a is a member ofthisand b is a member ofset.RichIterable<FloatIterable>chunk(int size)Partitions elements in fixed size chunks.<V> ImmutableSet<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)voideach(FloatProcedure procedure)A synonym for forEach.booleanequals(java.lang.Object obj)Follows the same general contract asSet.equals(Object).FloatIteratorfloatIterator()Returns a primitive iterator that can be used to iterate over the FloatIterable in an imperative style.voidforEachWithOccurrences(FloatIntProcedure floatIntProcedure)FloatSetfreeze()Returns a frozen copy of this set.inthashCode()Follows the same general contract asSet.hashCode().<T> TinjectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)booleanisEmpty()Returns true if this iterable has zero items.java.lang.StringmakeString()Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).java.lang.StringmakeString(java.lang.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).java.lang.StringmakeString(java.lang.String start, java.lang.String separator, java.lang.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)ImmutableFloatSetnewWith(float element)ImmutableFloatSetnewWithAll(FloatIterable elements)ImmutableFloatSetnewWithout(float element)ImmutableFloatSetnewWithoutAll(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()intoccurrencesOf(float item)ImmutableFloatSetreject(FloatPredicate predicate)Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.ImmutableFloatSetselect(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.intsizeDistinct()doublesum()float[]toArray()Converts the FloatIterable to a primitive float array.float[]toArray(float[] target)Converts the FloatIterable to a primitive float array.MutableFloatBagtoBag()Converts the FloatIterable to a new MutableFloatBag.ImmutableFloatSettoImmutable()Returns an immutable copy of this set.MutableFloatListtoList()Converts the FloatIterable to a new MutableFloatList.MutableFloatSettoSet()Converts the FloatIterable to a new MutableFloatSet.float[]toSortedArray()MutableFloatListtoSortedList()java.lang.StringtoString()Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.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, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.FloatSet
isProperSubsetOf, isSubsetOf
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.ImmutableFloatSet
difference, intersect, symmetricDifference, tap, union
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
element
private final float element
-
-
Method Detail
-
newWith
public ImmutableFloatSet newWith(float element)
- Specified by:
newWithin interfaceImmutableFloatCollection- Specified by:
newWithin interfaceImmutableFloatSet
-
newWithout
public ImmutableFloatSet newWithout(float element)
- Specified by:
newWithoutin interfaceImmutableFloatCollection- Specified by:
newWithoutin interfaceImmutableFloatSet
-
newWithAll
public ImmutableFloatSet newWithAll(FloatIterable elements)
- Specified by:
newWithAllin interfaceImmutableFloatCollection- Specified by:
newWithAllin interfaceImmutableFloatSet
-
newWithoutAll
public ImmutableFloatSet newWithoutAll(FloatIterable elements)
- Specified by:
newWithoutAllin interfaceImmutableFloatCollection- Specified by:
newWithoutAllin interfaceImmutableFloatSet
-
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
-
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(FloatIterable source)
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
-
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
-
each
public void each(FloatProcedure procedure)
Description copied from interface:FloatIterableA synonym for forEach.- Specified by:
eachin interfaceFloatIterable- Since:
- 7.0.
-
select
public ImmutableFloatSet select(FloatPredicate predicate)
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 interfaceFloatSet- Specified by:
selectin interfaceImmutableFloatCollection- Specified by:
selectin interfaceImmutableFloatSet
-
reject
public ImmutableFloatSet reject(FloatPredicate predicate)
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 interfaceFloatSet- Specified by:
rejectin interfaceImmutableFloatCollection- Specified by:
rejectin interfaceImmutableFloatSet
-
collect
public <V> ImmutableSet<V> collect(FloatToObjectFunction<? extends V> function)
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 interfaceFloatSet- Specified by:
collectin interfaceImmutableFloatCollection- Specified by:
collectin interfaceImmutableFloatSet
-
toList
public MutableFloatList toList()
Description copied from interface:FloatIterableConverts the FloatIterable to a new MutableFloatList.- Specified by:
toListin interfaceFloatIterable
-
sizeDistinct
public int sizeDistinct()
-
occurrencesOf
public int occurrencesOf(float item)
-
forEachWithOccurrences
public void forEachWithOccurrences(FloatIntProcedure floatIntProcedure)
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNonein interfaceFloatIterable
-
count
public int count(FloatPredicate predicate)
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
public boolean anySatisfy(FloatPredicate predicate)
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
-
sum
public double sum()
- Specified by:
sumin interfaceFloatIterable
-
min
public float min()
- Specified by:
minin interfaceFloatIterable
-
max
public float max()
- Specified by:
maxin interfaceFloatIterable
-
maxIfEmpty
public float maxIfEmpty(float defaultValue)
- Specified by:
maxIfEmptyin 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
-
cartesianProduct
public LazyIterable<FloatFloatPair> cartesianProduct(FloatSet set)
Description copied from interface:FloatSetReturns the set whose members are all possible ordered pairs (a, b) where a is a member ofthisand b is a member ofset.- Specified by:
cartesianProductin interfaceFloatSet
-
toSortedArray
public float[] toSortedArray()
- Specified by:
toSortedArrayin interfaceFloatIterable
-
toSortedList
public MutableFloatList toSortedList()
- Specified by:
toSortedListin interfaceFloatIterable
-
noneSatisfy
public boolean noneSatisfy(FloatPredicate predicate)
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
-
allSatisfy
public boolean allSatisfy(FloatPredicate predicate)
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
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceFloatIterable
-
chunk
public RichIterable<FloatIterable> chunk(int size)
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
public boolean equals(java.lang.Object obj)
Description copied from interface:FloatSetFollows the same general contract asSet.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:FloatSetFollows the same general contract asSet.hashCode().
-
toSet
public MutableFloatSet toSet()
Description copied from interface:FloatIterableConverts the FloatIterable to a new MutableFloatSet.- Specified by:
toSetin interfaceFloatIterable
-
toBag
public MutableFloatBag toBag()
Description copied from interface:FloatIterableConverts the FloatIterable to a new MutableFloatBag.- Specified by:
toBagin interfaceFloatIterable
-
freeze
public FloatSet freeze()
Description copied from interface:FloatSetReturns a frozen copy of this set. If the set is frozen, it returns itself. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.
-
toImmutable
public ImmutableFloatSet toImmutable()
Description copied from interface:FloatSetReturns an immutable copy of this set. If the set is immutable, it returns itself.- Specified by:
toImmutablein interfaceFloatSet
-
asLazy
public LazyFloatIterable asLazy()
Description copied from interface:FloatIterableReturns a LazyFloatIterable adapter wrapping the source FloatIterable.- Specified by:
asLazyin interfaceFloatIterable
-
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
-
toString
public java.lang.String 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 classjava.lang.Object- Returns:
- a string representation of this PrimitiveIterable
- See Also:
AbstractCollection.toString()
-
makeString
public java.lang.String 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
public java.lang.String makeString(java.lang.String separator)
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
public java.lang.String makeString(java.lang.String start, java.lang.String separator, java.lang.String end)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
public void appendString(java.lang.Appendable appendable)
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
public void appendString(java.lang.Appendable appendable, java.lang.String separator)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
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)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
-
floatIterator
public FloatIterator 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
-
-