Class SynchronizedLongStack
- java.lang.Object
-
- org.eclipse.collections.impl.stack.mutable.primitive.SynchronizedLongStack
-
- All Implemented Interfaces:
Serializable,LongIterable,OrderedLongIterable,PrimitiveIterable,LongStack,MutableLongStack
public class SynchronizedLongStack extends Object implements MutableLongStack, Serializable
A synchronized view of aMutableLongStack. It is imperative that the user manually synchronize on the collection when iterating over it using theLongIterator, as perCollections.synchronizedCollection(Collection).This file was automatically generated from template file synchronizedPrimitiveStack.stg.
- Since:
- 3.1.
- See Also:
MutableLongStack.asSynchronized(),MutableStack.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedLongStack(MutableLongStack stack)SynchronizedLongStack(MutableLongStack stack, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(LongPredicate predicate)booleananySatisfy(LongPredicate predicate)voidappendString(Appendable appendable)voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)LazyLongIterableasLazy()MutableLongStackasSynchronized()MutableLongStackasUnmodifiable()doubleaverage()RichIterable<LongIterable>chunk(int size)voidclear()<V> MutableStack<V>collect(LongToObjectFunction<? extends V> function)<V> MutableStack<V>collectWithIndex(LongIntToObjectFunction<? 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(LongIntToObjectFunction<? 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(long value)booleancontainsAll(long... source)booleancontainsAll(LongIterable source)intcount(LongPredicate predicate)longdetectIfNone(LongPredicate predicate, long ifNone)voideach(LongProcedure procedure)booleanequals(Object otherStack)voidforEachWithIndex(LongIntProcedure procedure)longgetFirst()inthashCode()intindexOf(long value)<T> TinjectInto(T injectedValue, ObjectLongToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectLongIntToObjectFunction<? super T,? extends T> function)booleanisEmpty()LongIteratorlongIterator()Must be called in a synchronized block.StringmakeString()StringmakeString(String separator)StringmakeString(String start, String separator, String end)longmax()longmaxIfEmpty(long defaultValue)doublemedian()longmin()longminIfEmpty(long defaultValue)MutableLongStacknewEmpty()booleannoneSatisfy(LongPredicate predicate)booleannotEmpty()longpeek()LongListpeek(int count)longpeekAt(int index)longpop()LongListpop(int count)voidpush(long item)MutableLongStackreject(LongPredicate predicate)MutableLongStackrejectWithIndex(LongIntPredicate predicate)Returns a new MutableLongStack excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableLongCollection>
RrejectWithIndex(LongIntPredicate predicate, R target)Returns a new MutableLongCollection excluding all elements with corresponding indexes matching the specified predicate.MutableLongStackselect(LongPredicate predicate)MutableLongStackselectWithIndex(LongIntPredicate predicate)Returns a new MutableLongStack including all elements with corresponding indexes matching the specified predicate.<R extends MutableLongCollection>
RselectWithIndex(LongIntPredicate predicate, R target)Returns a new MutableLongCollection including all elements with corresponding indexes matching the specified predicate.intsize()longsum()long[]toArray()long[]toArray(long[] target)MutableLongBagtoBag()ImmutableLongStacktoImmutable()MutableLongListtoList()MutableLongSettoSet()long[]toSortedArray()MutableLongListtoSortedList()StringtoString()-
Methods inherited from interface org.eclipse.collections.api.LongIterable
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.MutableLongStack
tap
-
-
-
-
Constructor Detail
-
SynchronizedLongStack
public SynchronizedLongStack(MutableLongStack stack)
-
SynchronizedLongStack
public SynchronizedLongStack(MutableLongStack stack, Object newLock)
-
-
Method Detail
-
push
public void push(long item)
- Specified by:
pushin interfaceMutableLongStack
-
pop
public long pop()
- Specified by:
popin interfaceMutableLongStack
-
pop
public LongList pop(int count)
- Specified by:
popin interfaceMutableLongStack
-
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 interfaceMutableLongStack
-
contains
public boolean contains(long value)
- Specified by:
containsin interfaceLongIterable
-
containsAll
public boolean containsAll(long... source)
- Specified by:
containsAllin interfaceLongIterable
-
containsAll
public boolean containsAll(LongIterable source)
- Specified by:
containsAllin interfaceLongIterable
-
longIterator
public LongIterator longIterator()
Must be called in a synchronized block.- Specified by:
longIteratorin interfaceLongIterable
-
each
public void each(LongProcedure procedure)
- Specified by:
eachin interfaceLongIterable- Since:
- 7.0.
-
count
public int count(LongPredicate predicate)
- Specified by:
countin interfaceLongIterable
-
anySatisfy
public boolean anySatisfy(LongPredicate predicate)
- Specified by:
anySatisfyin interfaceLongIterable
-
allSatisfy
public boolean allSatisfy(LongPredicate predicate)
- Specified by:
allSatisfyin interfaceLongIterable
-
noneSatisfy
public boolean noneSatisfy(LongPredicate predicate)
- Specified by:
noneSatisfyin interfaceLongIterable
-
detectIfNone
public long detectIfNone(LongPredicate predicate, long ifNone)
- Specified by:
detectIfNonein interfaceLongIterable
-
select
public MutableLongStack select(LongPredicate predicate)
- Specified by:
selectin interfaceLongIterable- Specified by:
selectin interfaceLongStack- Specified by:
selectin interfaceMutableLongStack- Specified by:
selectin interfaceOrderedLongIterable
-
reject
public MutableLongStack reject(LongPredicate predicate)
- Specified by:
rejectin interfaceLongIterable- Specified by:
rejectin interfaceLongStack- Specified by:
rejectin interfaceMutableLongStack- Specified by:
rejectin interfaceOrderedLongIterable
-
collect
public <V> MutableStack<V> collect(LongToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceLongIterable- Specified by:
collectin interfaceLongStack- Specified by:
collectin interfaceMutableLongStack- Specified by:
collectin interfaceOrderedLongIterable
-
sum
public long sum()
- Specified by:
sumin interfaceLongIterable
-
max
public long max()
- Specified by:
maxin interfaceLongIterable
-
min
public long min()
- Specified by:
minin interfaceLongIterable
-
minIfEmpty
public long minIfEmpty(long defaultValue)
- Specified by:
minIfEmptyin interfaceLongIterable
-
maxIfEmpty
public long maxIfEmpty(long defaultValue)
- Specified by:
maxIfEmptyin interfaceLongIterable
-
average
public double average()
- Specified by:
averagein interfaceLongIterable
-
median
public double median()
- Specified by:
medianin interfaceLongIterable
-
toSortedList
public MutableLongList toSortedList()
- Specified by:
toSortedListin interfaceLongIterable
-
toSortedArray
public long[] toSortedArray()
- Specified by:
toSortedArrayin interfaceLongIterable
-
toArray
public long[] toArray()
- Specified by:
toArrayin interfaceLongIterable
-
toArray
public long[] toArray(long[] target)
- Specified by:
toArrayin interfaceLongIterable
-
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 MutableLongList toList()
- Specified by:
toListin interfaceLongIterable
-
toSet
public MutableLongSet toSet()
- Specified by:
toSetin interfaceLongIterable
-
toBag
public MutableLongBag toBag()
- Specified by:
toBagin interfaceLongIterable
-
equals
public boolean equals(Object otherStack)
-
hashCode
public int hashCode()
-
asLazy
public LazyLongIterable asLazy()
- Specified by:
asLazyin interfaceLongIterable
-
asUnmodifiable
public MutableLongStack asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableLongStack
-
asSynchronized
public MutableLongStack asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableLongStack
-
toImmutable
public ImmutableLongStack toImmutable()
- Specified by:
toImmutablein interfaceLongStack
-
newEmpty
public MutableLongStack newEmpty()
- Specified by:
newEmptyin interfaceMutableLongStack- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectLongToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceLongIterable
-
chunk
public RichIterable<LongIterable> chunk(int size)
- Specified by:
chunkin interfaceLongIterable
-
getFirst
public long getFirst()
- Specified by:
getFirstin interfaceOrderedLongIterable
-
indexOf
public int indexOf(long value)
- Specified by:
indexOfin interfaceOrderedLongIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectLongIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedLongIterable
-
forEachWithIndex
public void forEachWithIndex(LongIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedLongIterable
-
selectWithIndex
public MutableLongStack selectWithIndex(LongIntPredicate predicate)
Returns a new MutableLongStack including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceLongStack- Specified by:
selectWithIndexin interfaceMutableLongStack- Specified by:
selectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableLongCollection> R selectWithIndex(LongIntPredicate predicate, R target)
Returns a new MutableLongCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
rejectWithIndex
public MutableLongStack rejectWithIndex(LongIntPredicate predicate)
Returns a new MutableLongStack excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceLongStack- Specified by:
rejectWithIndexin interfaceMutableLongStack- Specified by:
rejectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableLongCollection> R rejectWithIndex(LongIntPredicate predicate, R target)
Returns a new MutableLongCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedLongIterable- Since:
- 11.1.
-
collectWithIndex
public <V> MutableStack<V> collectWithIndex(LongIntToObjectFunction<? 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 interfaceLongStack- Specified by:
collectWithIndexin interfaceMutableLongStack- Specified by:
collectWithIndexin interfaceOrderedLongIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(LongIntToObjectFunction<? 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 interfaceOrderedLongIterable- Since:
- 9.1.
-
-