Class SynchronizedIntStack
- java.lang.Object
-
- org.eclipse.collections.impl.stack.mutable.primitive.SynchronizedIntStack
-
- All Implemented Interfaces:
Serializable,IntIterable,OrderedIntIterable,PrimitiveIterable,IntStack,MutableIntStack
public class SynchronizedIntStack extends Object implements MutableIntStack, Serializable
A synchronized view of aMutableIntStack. It is imperative that the user manually synchronize on the collection when iterating over it using theIntIterator, as perCollections.synchronizedCollection(Collection).This file was automatically generated from template file synchronizedPrimitiveStack.stg.
- Since:
- 3.1.
- See Also:
MutableIntStack.asSynchronized(),MutableStack.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedIntStack(MutableIntStack stack)SynchronizedIntStack(MutableIntStack stack, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(IntPredicate predicate)booleananySatisfy(IntPredicate predicate)voidappendString(Appendable appendable)voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)LazyIntIterableasLazy()MutableIntStackasSynchronized()MutableIntStackasUnmodifiable()doubleaverage()RichIterable<IntIterable>chunk(int size)voidclear()<V> MutableStack<V>collect(IntToObjectFunction<? extends V> function)<V> MutableStack<V>collectWithIndex(IntIntToObjectFunction<? 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(IntIntToObjectFunction<? 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(int value)booleancontainsAll(int... source)booleancontainsAll(IntIterable source)intcount(IntPredicate predicate)intdetectIfNone(IntPredicate predicate, int ifNone)voideach(IntProcedure procedure)booleanequals(Object otherStack)voidforEachWithIndex(IntIntProcedure procedure)intgetFirst()inthashCode()intindexOf(int value)<T> TinjectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)IntIteratorintIterator()Must be called in a synchronized block.booleanisEmpty()StringmakeString()StringmakeString(String separator)StringmakeString(String start, String separator, String end)intmax()intmaxIfEmpty(int defaultValue)doublemedian()intmin()intminIfEmpty(int defaultValue)MutableIntStacknewEmpty()booleannoneSatisfy(IntPredicate predicate)booleannotEmpty()intpeek()IntListpeek(int count)intpeekAt(int index)intpop()IntListpop(int count)voidpush(int item)MutableIntStackreject(IntPredicate predicate)MutableIntStackrejectWithIndex(IntIntPredicate predicate)Returns a new MutableIntStack excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableIntCollection>
RrejectWithIndex(IntIntPredicate predicate, R target)Returns a new MutableIntCollection excluding all elements with corresponding indexes matching the specified predicate.MutableIntStackselect(IntPredicate predicate)MutableIntStackselectWithIndex(IntIntPredicate predicate)Returns a new MutableIntStack including all elements with corresponding indexes matching the specified predicate.<R extends MutableIntCollection>
RselectWithIndex(IntIntPredicate predicate, R target)Returns a new MutableIntCollection including all elements with corresponding indexes matching the specified predicate.intsize()longsum()int[]toArray()int[]toArray(int[] target)MutableIntBagtoBag()ImmutableIntStacktoImmutable()MutableIntListtoList()MutableIntSettoSet()int[]toSortedArray()MutableIntListtoSortedList()MutableIntStacktoStack()StringtoString()-
Methods inherited from interface org.eclipse.collections.api.IntIterable
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.MutableIntStack
tap
-
-
-
-
Constructor Detail
-
SynchronizedIntStack
public SynchronizedIntStack(MutableIntStack stack)
-
SynchronizedIntStack
public SynchronizedIntStack(MutableIntStack stack, Object newLock)
-
-
Method Detail
-
push
public void push(int item)
- Specified by:
pushin interfaceMutableIntStack
-
pop
public int pop()
- Specified by:
popin interfaceMutableIntStack
-
pop
public IntList pop(int count)
- Specified by:
popin interfaceMutableIntStack
-
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 interfaceMutableIntStack
-
contains
public boolean contains(int value)
- Specified by:
containsin interfaceIntIterable
-
containsAll
public boolean containsAll(int... source)
- Specified by:
containsAllin interfaceIntIterable
-
containsAll
public boolean containsAll(IntIterable source)
- Specified by:
containsAllin interfaceIntIterable
-
intIterator
public IntIterator intIterator()
Must be called in a synchronized block.- Specified by:
intIteratorin interfaceIntIterable
-
each
public void each(IntProcedure procedure)
- Specified by:
eachin interfaceIntIterable- Since:
- 7.0.
-
count
public int count(IntPredicate predicate)
- Specified by:
countin interfaceIntIterable
-
anySatisfy
public boolean anySatisfy(IntPredicate predicate)
- Specified by:
anySatisfyin interfaceIntIterable
-
allSatisfy
public boolean allSatisfy(IntPredicate predicate)
- Specified by:
allSatisfyin interfaceIntIterable
-
noneSatisfy
public boolean noneSatisfy(IntPredicate predicate)
- Specified by:
noneSatisfyin interfaceIntIterable
-
detectIfNone
public int detectIfNone(IntPredicate predicate, int ifNone)
- Specified by:
detectIfNonein interfaceIntIterable
-
select
public MutableIntStack select(IntPredicate predicate)
- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceIntStack- Specified by:
selectin interfaceMutableIntStack- Specified by:
selectin interfaceOrderedIntIterable
-
reject
public MutableIntStack reject(IntPredicate predicate)
- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceIntStack- Specified by:
rejectin interfaceMutableIntStack- Specified by:
rejectin interfaceOrderedIntIterable
-
collect
public <V> MutableStack<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceIntIterable- Specified by:
collectin interfaceIntStack- Specified by:
collectin interfaceMutableIntStack- Specified by:
collectin interfaceOrderedIntIterable
-
sum
public long sum()
- Specified by:
sumin interfaceIntIterable
-
max
public int max()
- Specified by:
maxin interfaceIntIterable
-
min
public int min()
- Specified by:
minin interfaceIntIterable
-
minIfEmpty
public int minIfEmpty(int defaultValue)
- Specified by:
minIfEmptyin interfaceIntIterable
-
maxIfEmpty
public int maxIfEmpty(int defaultValue)
- Specified by:
maxIfEmptyin interfaceIntIterable
-
average
public double average()
- Specified by:
averagein interfaceIntIterable
-
median
public double median()
- Specified by:
medianin interfaceIntIterable
-
toSortedList
public MutableIntList toSortedList()
- Specified by:
toSortedListin interfaceIntIterable
-
toSortedArray
public int[] toSortedArray()
- Specified by:
toSortedArrayin interfaceIntIterable
-
toArray
public int[] toArray()
- Specified by:
toArrayin interfaceIntIterable
-
toArray
public int[] toArray(int[] target)
- Specified by:
toArrayin interfaceIntIterable
-
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 MutableIntList toList()
- Specified by:
toListin interfaceIntIterable
-
toSet
public MutableIntSet toSet()
- Specified by:
toSetin interfaceIntIterable
-
toBag
public MutableIntBag toBag()
- Specified by:
toBagin interfaceIntIterable
-
equals
public boolean equals(Object otherStack)
-
hashCode
public int hashCode()
-
asLazy
public LazyIntIterable asLazy()
- Specified by:
asLazyin interfaceIntIterable
-
asUnmodifiable
public MutableIntStack asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntStack
-
asSynchronized
public MutableIntStack asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntStack
-
toImmutable
public ImmutableIntStack toImmutable()
- Specified by:
toImmutablein interfaceIntStack
-
newEmpty
public MutableIntStack newEmpty()
- Specified by:
newEmptyin interfaceMutableIntStack- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceIntIterable
-
chunk
public RichIterable<IntIterable> chunk(int size)
- Specified by:
chunkin interfaceIntIterable
-
getFirst
public int getFirst()
- Specified by:
getFirstin interfaceOrderedIntIterable
-
indexOf
public int indexOf(int value)
- Specified by:
indexOfin interfaceOrderedIntIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedIntIterable
-
forEachWithIndex
public void forEachWithIndex(IntIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedIntIterable
-
selectWithIndex
public MutableIntStack selectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntStack including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceIntStack- Specified by:
selectWithIndexin interfaceMutableIntStack- Specified by:
selectWithIndexin interfaceOrderedIntIterable- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableIntCollection> R selectWithIndex(IntIntPredicate predicate, R target)
Returns a new MutableIntCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedIntIterable- Since:
- 11.1.
-
rejectWithIndex
public MutableIntStack rejectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntStack excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceIntStack- Specified by:
rejectWithIndexin interfaceMutableIntStack- Specified by:
rejectWithIndexin interfaceOrderedIntIterable- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableIntCollection> R rejectWithIndex(IntIntPredicate predicate, R target)
Returns a new MutableIntCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedIntIterable- Since:
- 11.1.
-
collectWithIndex
public <V> MutableStack<V> collectWithIndex(IntIntToObjectFunction<? 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 interfaceIntStack- Specified by:
collectWithIndexin interfaceMutableIntStack- Specified by:
collectWithIndexin interfaceOrderedIntIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(IntIntToObjectFunction<? 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 interfaceOrderedIntIterable- Since:
- 9.1.
-
toStack
public MutableIntStack toStack()
- Specified by:
toStackin interfaceOrderedIntIterable
-
-