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 boolean
allSatisfy(FloatPredicate predicate)
boolean
anySatisfy(FloatPredicate predicate)
void
appendString(Appendable appendable)
void
appendString(Appendable appendable, String separator)
void
appendString(Appendable appendable, String start, String separator, String end)
LazyFloatIterable
asLazy()
MutableFloatStack
asSynchronized()
MutableFloatStack
asUnmodifiable()
double
average()
RichIterable<FloatIterable>
chunk(int size)
void
clear()
<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.boolean
contains(float value)
boolean
containsAll(float... source)
boolean
containsAll(FloatIterable source)
int
count(FloatPredicate predicate)
float
detectIfNone(FloatPredicate predicate, float ifNone)
void
each(FloatProcedure procedure)
boolean
equals(Object otherStack)
FloatIterator
floatIterator()
Must be called in a synchronized block.void
forEachWithIndex(FloatIntProcedure procedure)
float
getFirst()
int
hashCode()
int
indexOf(float value)
<T> T
injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
<T> T
injectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)
boolean
isEmpty()
String
makeString()
String
makeString(String separator)
String
makeString(String start, String separator, String end)
float
max()
float
maxIfEmpty(float defaultValue)
double
median()
float
min()
float
minIfEmpty(float defaultValue)
MutableFloatStack
newEmpty()
boolean
noneSatisfy(FloatPredicate predicate)
boolean
notEmpty()
float
peek()
FloatList
peek(int count)
float
peekAt(int index)
float
pop()
FloatList
pop(int count)
void
push(float item)
MutableFloatStack
reject(FloatPredicate predicate)
MutableFloatStack
rejectWithIndex(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.MutableFloatStack
select(FloatPredicate predicate)
MutableFloatStack
selectWithIndex(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.int
size()
double
sum()
float[]
toArray()
float[]
toArray(float[] target)
MutableFloatBag
toBag()
ImmutableFloatStack
toImmutable()
MutableFloatList
toList()
MutableFloatSet
toSet()
float[]
toSortedArray()
MutableFloatList
toSortedList()
String
toString()
-
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:
push
in interfaceMutableFloatStack
-
pop
public float pop()
- Specified by:
pop
in interfaceMutableFloatStack
-
pop
public FloatList pop(int count)
- Specified by:
pop
in interfaceMutableFloatStack
-
peek
public float peek()
- Specified by:
peek
in interfaceFloatStack
-
peek
public FloatList peek(int count)
- Specified by:
peek
in interfaceFloatStack
-
peekAt
public float peekAt(int index)
- Specified by:
peekAt
in interfaceFloatStack
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmpty
in interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableFloatStack
-
contains
public boolean contains(float value)
- Specified by:
contains
in interfaceFloatIterable
-
containsAll
public boolean containsAll(float... source)
- Specified by:
containsAll
in interfaceFloatIterable
-
containsAll
public boolean containsAll(FloatIterable source)
- Specified by:
containsAll
in interfaceFloatIterable
-
floatIterator
public FloatIterator floatIterator()
Must be called in a synchronized block.- Specified by:
floatIterator
in interfaceFloatIterable
-
each
public void each(FloatProcedure procedure)
- Specified by:
each
in interfaceFloatIterable
- Since:
- 7.0.
-
count
public int count(FloatPredicate predicate)
- Specified by:
count
in interfaceFloatIterable
-
anySatisfy
public boolean anySatisfy(FloatPredicate predicate)
- Specified by:
anySatisfy
in interfaceFloatIterable
-
allSatisfy
public boolean allSatisfy(FloatPredicate predicate)
- Specified by:
allSatisfy
in interfaceFloatIterable
-
noneSatisfy
public boolean noneSatisfy(FloatPredicate predicate)
- Specified by:
noneSatisfy
in interfaceFloatIterable
-
detectIfNone
public float detectIfNone(FloatPredicate predicate, float ifNone)
- Specified by:
detectIfNone
in interfaceFloatIterable
-
select
public MutableFloatStack select(FloatPredicate predicate)
- Specified by:
select
in interfaceFloatIterable
- Specified by:
select
in interfaceFloatStack
- Specified by:
select
in interfaceMutableFloatStack
- Specified by:
select
in interfaceOrderedFloatIterable
-
reject
public MutableFloatStack reject(FloatPredicate predicate)
- Specified by:
reject
in interfaceFloatIterable
- Specified by:
reject
in interfaceFloatStack
- Specified by:
reject
in interfaceMutableFloatStack
- Specified by:
reject
in interfaceOrderedFloatIterable
-
collect
public <V> MutableStack<V> collect(FloatToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceFloatIterable
- Specified by:
collect
in interfaceFloatStack
- Specified by:
collect
in interfaceMutableFloatStack
- Specified by:
collect
in interfaceOrderedFloatIterable
-
sum
public double sum()
- Specified by:
sum
in interfaceFloatIterable
-
max
public float max()
- Specified by:
max
in interfaceFloatIterable
-
min
public float min()
- Specified by:
min
in interfaceFloatIterable
-
minIfEmpty
public float minIfEmpty(float defaultValue)
- Specified by:
minIfEmpty
in interfaceFloatIterable
-
maxIfEmpty
public float maxIfEmpty(float defaultValue)
- Specified by:
maxIfEmpty
in interfaceFloatIterable
-
average
public double average()
- Specified by:
average
in interfaceFloatIterable
-
median
public double median()
- Specified by:
median
in interfaceFloatIterable
-
toSortedList
public MutableFloatList toSortedList()
- Specified by:
toSortedList
in interfaceFloatIterable
-
toSortedArray
public float[] toSortedArray()
- Specified by:
toSortedArray
in interfaceFloatIterable
-
toArray
public float[] toArray()
- Specified by:
toArray
in interfaceFloatIterable
-
toArray
public float[] toArray(float[] target)
- Specified by:
toArray
in interfaceFloatIterable
-
toString
public String toString()
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
-
makeString
public String makeString()
- Specified by:
makeString
in interfacePrimitiveIterable
-
makeString
public String makeString(String separator)
- Specified by:
makeString
in interfacePrimitiveIterable
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendString
in interfacePrimitiveIterable
-
toList
public MutableFloatList toList()
- Specified by:
toList
in interfaceFloatIterable
-
toSet
public MutableFloatSet toSet()
- Specified by:
toSet
in interfaceFloatIterable
-
toBag
public MutableFloatBag toBag()
- Specified by:
toBag
in interfaceFloatIterable
-
equals
public boolean equals(Object otherStack)
- Specified by:
equals
in interfaceFloatStack
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceFloatStack
- Overrides:
hashCode
in classObject
-
asLazy
public LazyFloatIterable asLazy()
- Specified by:
asLazy
in interfaceFloatIterable
-
asUnmodifiable
public MutableFloatStack asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableFloatStack
-
asSynchronized
public MutableFloatStack asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableFloatStack
-
toImmutable
public ImmutableFloatStack toImmutable()
- Specified by:
toImmutable
in interfaceFloatStack
-
newEmpty
public MutableFloatStack newEmpty()
- Specified by:
newEmpty
in interfaceMutableFloatStack
- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
- Specified by:
injectInto
in interfaceFloatIterable
-
chunk
public RichIterable<FloatIterable> chunk(int size)
- Specified by:
chunk
in interfaceFloatIterable
-
getFirst
public float getFirst()
- Specified by:
getFirst
in interfaceOrderedFloatIterable
-
indexOf
public int indexOf(float value)
- Specified by:
indexOf
in interfaceOrderedFloatIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedFloatIterable
-
forEachWithIndex
public void forEachWithIndex(FloatIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedFloatIterable
-
selectWithIndex
public MutableFloatStack selectWithIndex(FloatIntPredicate predicate)
Returns a new MutableFloatStack including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceFloatStack
- Specified by:
selectWithIndex
in interfaceMutableFloatStack
- Specified by:
selectWithIndex
in 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:
selectWithIndex
in 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:
rejectWithIndex
in interfaceFloatStack
- Specified by:
rejectWithIndex
in interfaceMutableFloatStack
- Specified by:
rejectWithIndex
in 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:
rejectWithIndex
in 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:
collectWithIndex
in interfaceFloatStack
- Specified by:
collectWithIndex
in interfaceMutableFloatStack
- Specified by:
collectWithIndex
in 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:
collectWithIndex
in interfaceOrderedFloatIterable
- Since:
- 9.1.
-
-