Class SynchronizedFloatStack
- java.lang.Object
-
- org.eclipse.collections.impl.stack.mutable.primitive.SynchronizedFloatStack
-
- All Implemented Interfaces:
Serializable,FloatIterable,OrderedFloatIterable,PrimitiveIterable,FloatStack,MutableFloatStack
public class SynchronizedFloatStack extends Object implements MutableFloatStack, Serializable
A synchronized view of aMutableFloatStack. It is imperative that the user manually synchronize on the collection when iterating over it using theFloatIterator, as perCollections.synchronizedCollection(Collection).This file was automatically generated from template file synchronizedPrimitiveStack.stg.
- Since:
- 3.1.
- See Also:
MutableFloatStack.asSynchronized(),MutableStack.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedFloatStack(MutableFloatStack stack)SynchronizedFloatStack(MutableFloatStack stack, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(FloatPredicate predicate)booleananySatisfy(FloatPredicate predicate)voidappendString(Appendable appendable)voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)LazyFloatIterableasLazy()MutableFloatStackasSynchronized()MutableFloatStackasUnmodifiable()doubleaverage()RichIterable<FloatIterable>chunk(int size)voidclear()<V> MutableStack<V>collect(FloatToObjectFunction<? extends V> function)<V> MutableStack<V>collectWithIndex(FloatIntToObjectFunction<? extends V> function)Returns a new MutableStack using results obtained by applying the specified function to each element and its corresponding index.<V,R extends Collection<V>>
RcollectWithIndex(FloatIntToObjectFunction<? extends V> function, R target)Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.booleancontains(float value)booleancontainsAll(float... source)booleancontainsAll(FloatIterable source)intcount(FloatPredicate predicate)floatdetectIfNone(FloatPredicate predicate, float ifNone)voideach(FloatProcedure procedure)booleanequals(Object otherStack)FloatIteratorfloatIterator()Must be called in a synchronized block.voidforEachWithIndex(FloatIntProcedure procedure)floatgetFirst()inthashCode()intindexOf(float value)<T> TinjectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)booleanisEmpty()StringmakeString()StringmakeString(String separator)StringmakeString(String start, String separator, String end)floatmax()floatmaxIfEmpty(float defaultValue)doublemedian()floatmin()floatminIfEmpty(float defaultValue)MutableFloatStacknewEmpty()booleannoneSatisfy(FloatPredicate predicate)booleannotEmpty()floatpeek()FloatListpeek(int count)floatpeekAt(int index)floatpop()FloatListpop(int count)voidpush(float item)MutableFloatStackreject(FloatPredicate predicate)MutableFloatStackrejectWithIndex(FloatIntPredicate predicate)Returns a new MutableFloatStack excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableFloatCollection>
RrejectWithIndex(FloatIntPredicate predicate, R target)Returns a new MutableFloatCollection excluding all elements with corresponding indexes matching the specified predicate.MutableFloatStackselect(FloatPredicate predicate)MutableFloatStackselectWithIndex(FloatIntPredicate predicate)Returns a new MutableFloatStack including all elements with corresponding indexes matching the specified predicate.<R extends MutableFloatCollection>
RselectWithIndex(FloatIntPredicate predicate, R target)Returns a new MutableFloatCollection including all elements with corresponding indexes matching the specified predicate.intsize()doublesum()float[]toArray()float[]toArray(float[] target)MutableFloatBagtoBag()ImmutableFloatStacktoImmutable()MutableFloatListtoList()MutableFloatSettoSet()float[]toSortedArray()MutableFloatListtoSortedList()StringtoString()-
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.stack.primitive.MutableFloatStack
tap
-
-
-
-
Constructor Detail
-
SynchronizedFloatStack
public SynchronizedFloatStack(MutableFloatStack stack)
-
SynchronizedFloatStack
public SynchronizedFloatStack(MutableFloatStack stack, Object newLock)
-
-
Method Detail
-
push
public void push(float item)
- Specified by:
pushin interfaceMutableFloatStack
-
pop
public float pop()
- Specified by:
popin interfaceMutableFloatStack
-
pop
public FloatList pop(int count)
- Specified by:
popin interfaceMutableFloatStack
-
peek
public float peek()
- Specified by:
peekin interfaceFloatStack
-
peek
public FloatList peek(int count)
- Specified by:
peekin interfaceFloatStack
-
peekAt
public float peekAt(int index)
- Specified by:
peekAtin interfaceFloatStack
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clearin interfaceMutableFloatStack
-
contains
public boolean contains(float value)
- Specified by:
containsin interfaceFloatIterable
-
containsAll
public boolean containsAll(float... source)
- Specified by:
containsAllin interfaceFloatIterable
-
containsAll
public boolean containsAll(FloatIterable source)
- Specified by:
containsAllin interfaceFloatIterable
-
floatIterator
public FloatIterator floatIterator()
Must be called in a synchronized block.- Specified by:
floatIteratorin interfaceFloatIterable
-
each
public void each(FloatProcedure procedure)
- Specified by:
eachin interfaceFloatIterable- Since:
- 7.0.
-
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
-
noneSatisfy
public boolean noneSatisfy(FloatPredicate predicate)
- Specified by:
noneSatisfyin interfaceFloatIterable
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNonein interfaceFloatIterable
-
select
public MutableFloatStack select(FloatPredicate predicate)
- Specified by:
selectin interfaceFloatIterable- Specified by:
selectin interfaceFloatStack- Specified by:
selectin interfaceMutableFloatStack- Specified by:
selectin interfaceOrderedFloatIterable
-
reject
public MutableFloatStack reject(FloatPredicate predicate)
- Specified by:
rejectin interfaceFloatIterable- Specified by:
rejectin interfaceFloatStack- Specified by:
rejectin interfaceMutableFloatStack- Specified by:
rejectin interfaceOrderedFloatIterable
-
collect
public <V> MutableStack<V> collect(FloatToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceFloatIterable- Specified by:
collectin interfaceFloatStack- Specified by:
collectin interfaceMutableFloatStack- Specified by:
collectin interfaceOrderedFloatIterable
-
sum
public double sum()
- Specified by:
sumin interfaceFloatIterable
-
max
public float max()
- Specified by:
maxin interfaceFloatIterable
-
min
public float min()
- Specified by:
minin interfaceFloatIterable
-
minIfEmpty
public float minIfEmpty(float defaultValue)
- Specified by:
minIfEmptyin interfaceFloatIterable
-
maxIfEmpty
public float maxIfEmpty(float defaultValue)
- Specified by:
maxIfEmptyin interfaceFloatIterable
-
average
public double average()
- Specified by:
averagein interfaceFloatIterable
-
median
public double median()
- Specified by:
medianin interfaceFloatIterable
-
toSortedList
public MutableFloatList toSortedList()
- Specified by:
toSortedListin interfaceFloatIterable
-
toSortedArray
public float[] toSortedArray()
- Specified by:
toSortedArrayin interfaceFloatIterable
-
toArray
public float[] toArray()
- Specified by:
toArrayin interfaceFloatIterable
-
toArray
public float[] toArray(float[] target)
- Specified by:
toArrayin interfaceFloatIterable
-
toString
public String toString()
- Specified by:
toStringin interfacePrimitiveIterable- Overrides:
toStringin classObject
-
makeString
public String makeString()
- Specified by:
makeStringin interfacePrimitiveIterable
-
makeString
public String makeString(String separator)
- Specified by:
makeStringin interfacePrimitiveIterable
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeStringin interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
toList
public MutableFloatList toList()
- Specified by:
toListin interfaceFloatIterable
-
toSet
public MutableFloatSet toSet()
- Specified by:
toSetin interfaceFloatIterable
-
toBag
public MutableFloatBag toBag()
- Specified by:
toBagin interfaceFloatIterable
-
equals
public boolean equals(Object otherStack)
- Specified by:
equalsin interfaceFloatStack- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceFloatStack- Overrides:
hashCodein classObject
-
asLazy
public LazyFloatIterable asLazy()
- Specified by:
asLazyin interfaceFloatIterable
-
asUnmodifiable
public MutableFloatStack asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableFloatStack
-
asSynchronized
public MutableFloatStack asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableFloatStack
-
toImmutable
public ImmutableFloatStack toImmutable()
- Specified by:
toImmutablein interfaceFloatStack
-
newEmpty
public MutableFloatStack newEmpty()
- Specified by:
newEmptyin interfaceMutableFloatStack- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceFloatIterable
-
chunk
public RichIterable<FloatIterable> chunk(int size)
- Specified by:
chunkin interfaceFloatIterable
-
getFirst
public float getFirst()
- Specified by:
getFirstin interfaceOrderedFloatIterable
-
indexOf
public int indexOf(float value)
- Specified by:
indexOfin interfaceOrderedFloatIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedFloatIterable
-
forEachWithIndex
public void forEachWithIndex(FloatIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedFloatIterable
-
selectWithIndex
public MutableFloatStack selectWithIndex(FloatIntPredicate predicate)
Returns a new MutableFloatStack including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceFloatStack- Specified by:
selectWithIndexin interfaceMutableFloatStack- Specified by:
selectWithIndexin interfaceOrderedFloatIterable- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableFloatCollection> R selectWithIndex(FloatIntPredicate predicate, R target)
Returns a new MutableFloatCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedFloatIterable- Since:
- 11.1.
-
rejectWithIndex
public MutableFloatStack rejectWithIndex(FloatIntPredicate predicate)
Returns a new MutableFloatStack excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceFloatStack- Specified by:
rejectWithIndexin interfaceMutableFloatStack- Specified by:
rejectWithIndexin interfaceOrderedFloatIterable- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableFloatCollection> R rejectWithIndex(FloatIntPredicate predicate, R target)
Returns a new MutableFloatCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedFloatIterable- Since:
- 11.1.
-
collectWithIndex
public <V> MutableStack<V> collectWithIndex(FloatIntToObjectFunction<? extends V> function)
Returns a new MutableStack using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceFloatStack- Specified by:
collectWithIndexin interfaceMutableFloatStack- Specified by:
collectWithIndexin interfaceOrderedFloatIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(FloatIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceOrderedFloatIterable- Since:
- 9.1.
-
-