Class SynchronizedByteStack
- java.lang.Object
-
- org.eclipse.collections.impl.stack.mutable.primitive.SynchronizedByteStack
-
- All Implemented Interfaces:
Serializable,ByteIterable,OrderedByteIterable,PrimitiveIterable,ByteStack,MutableByteStack
public class SynchronizedByteStack extends Object implements MutableByteStack, Serializable
A synchronized view of aMutableByteStack. It is imperative that the user manually synchronize on the collection when iterating over it using theByteIterator, as perCollections.synchronizedCollection(Collection).This file was automatically generated from template file synchronizedPrimitiveStack.stg.
- Since:
- 3.1.
- See Also:
MutableByteStack.asSynchronized(),MutableStack.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedByteStack(MutableByteStack stack)SynchronizedByteStack(MutableByteStack stack, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(BytePredicate predicate)booleananySatisfy(BytePredicate predicate)voidappendString(Appendable appendable)voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)LazyByteIterableasLazy()MutableByteStackasSynchronized()MutableByteStackasUnmodifiable()doubleaverage()ByteIteratorbyteIterator()Must be called in a synchronized block.RichIterable<ByteIterable>chunk(int size)voidclear()<V> MutableStack<V>collect(ByteToObjectFunction<? extends V> function)<V> MutableStack<V>collectWithIndex(ByteIntToObjectFunction<? 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(ByteIntToObjectFunction<? 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(byte value)booleancontainsAll(byte... source)booleancontainsAll(ByteIterable source)intcount(BytePredicate predicate)bytedetectIfNone(BytePredicate predicate, byte ifNone)voideach(ByteProcedure procedure)booleanequals(Object otherStack)voidforEachWithIndex(ByteIntProcedure procedure)bytegetFirst()inthashCode()intindexOf(byte value)<T> TinjectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)booleanisEmpty()StringmakeString()StringmakeString(String separator)StringmakeString(String start, String separator, String end)bytemax()bytemaxIfEmpty(byte defaultValue)doublemedian()bytemin()byteminIfEmpty(byte defaultValue)MutableByteStacknewEmpty()booleannoneSatisfy(BytePredicate predicate)booleannotEmpty()bytepeek()ByteListpeek(int count)bytepeekAt(int index)bytepop()ByteListpop(int count)voidpush(byte item)MutableByteStackreject(BytePredicate predicate)MutableByteStackrejectWithIndex(ByteIntPredicate predicate)Returns a new MutableByteStack excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableByteCollection>
RrejectWithIndex(ByteIntPredicate predicate, R target)Returns a new MutableByteCollection excluding all elements with corresponding indexes matching the specified predicate.MutableByteStackselect(BytePredicate predicate)MutableByteStackselectWithIndex(ByteIntPredicate predicate)Returns a new MutableByteStack including all elements with corresponding indexes matching the specified predicate.<R extends MutableByteCollection>
RselectWithIndex(ByteIntPredicate predicate, R target)Returns a new MutableByteCollection including all elements with corresponding indexes matching the specified predicate.intsize()longsum()byte[]toArray()byte[]toArray(byte[] target)MutableByteBagtoBag()ImmutableByteStacktoImmutable()MutableByteListtoList()MutableByteSettoSet()byte[]toSortedArray()MutableByteListtoSortedList()StringtoString()-
Methods inherited from interface org.eclipse.collections.api.ByteIterable
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.MutableByteStack
tap
-
-
-
-
Constructor Detail
-
SynchronizedByteStack
public SynchronizedByteStack(MutableByteStack stack)
-
SynchronizedByteStack
public SynchronizedByteStack(MutableByteStack stack, Object newLock)
-
-
Method Detail
-
push
public void push(byte item)
- Specified by:
pushin interfaceMutableByteStack
-
pop
public byte pop()
- Specified by:
popin interfaceMutableByteStack
-
pop
public ByteList pop(int count)
- Specified by:
popin interfaceMutableByteStack
-
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 interfaceMutableByteStack
-
contains
public boolean contains(byte value)
- Specified by:
containsin interfaceByteIterable
-
containsAll
public boolean containsAll(byte... source)
- Specified by:
containsAllin interfaceByteIterable
-
containsAll
public boolean containsAll(ByteIterable source)
- Specified by:
containsAllin interfaceByteIterable
-
byteIterator
public ByteIterator byteIterator()
Must be called in a synchronized block.- Specified by:
byteIteratorin interfaceByteIterable
-
each
public void each(ByteProcedure procedure)
- Specified by:
eachin interfaceByteIterable- Since:
- 7.0.
-
count
public int count(BytePredicate predicate)
- Specified by:
countin interfaceByteIterable
-
anySatisfy
public boolean anySatisfy(BytePredicate predicate)
- Specified by:
anySatisfyin interfaceByteIterable
-
allSatisfy
public boolean allSatisfy(BytePredicate predicate)
- Specified by:
allSatisfyin interfaceByteIterable
-
noneSatisfy
public boolean noneSatisfy(BytePredicate predicate)
- Specified by:
noneSatisfyin interfaceByteIterable
-
detectIfNone
public byte detectIfNone(BytePredicate predicate, byte ifNone)
- Specified by:
detectIfNonein interfaceByteIterable
-
select
public MutableByteStack select(BytePredicate predicate)
- Specified by:
selectin interfaceByteIterable- Specified by:
selectin interfaceByteStack- Specified by:
selectin interfaceMutableByteStack- Specified by:
selectin interfaceOrderedByteIterable
-
reject
public MutableByteStack reject(BytePredicate predicate)
- Specified by:
rejectin interfaceByteIterable- Specified by:
rejectin interfaceByteStack- Specified by:
rejectin interfaceMutableByteStack- Specified by:
rejectin interfaceOrderedByteIterable
-
collect
public <V> MutableStack<V> collect(ByteToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceByteIterable- Specified by:
collectin interfaceByteStack- Specified by:
collectin interfaceMutableByteStack- Specified by:
collectin interfaceOrderedByteIterable
-
sum
public long sum()
- Specified by:
sumin interfaceByteIterable
-
max
public byte max()
- Specified by:
maxin interfaceByteIterable
-
min
public byte min()
- Specified by:
minin interfaceByteIterable
-
minIfEmpty
public byte minIfEmpty(byte defaultValue)
- Specified by:
minIfEmptyin interfaceByteIterable
-
maxIfEmpty
public byte maxIfEmpty(byte defaultValue)
- Specified by:
maxIfEmptyin interfaceByteIterable
-
average
public double average()
- Specified by:
averagein interfaceByteIterable
-
median
public double median()
- Specified by:
medianin interfaceByteIterable
-
toSortedList
public MutableByteList toSortedList()
- Specified by:
toSortedListin interfaceByteIterable
-
toSortedArray
public byte[] toSortedArray()
- Specified by:
toSortedArrayin interfaceByteIterable
-
toArray
public byte[] toArray()
- Specified by:
toArrayin interfaceByteIterable
-
toArray
public byte[] toArray(byte[] target)
- Specified by:
toArrayin interfaceByteIterable
-
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 MutableByteList toList()
- Specified by:
toListin interfaceByteIterable
-
toSet
public MutableByteSet toSet()
- Specified by:
toSetin interfaceByteIterable
-
toBag
public MutableByteBag toBag()
- Specified by:
toBagin interfaceByteIterable
-
equals
public boolean equals(Object otherStack)
-
hashCode
public int hashCode()
-
asLazy
public LazyByteIterable asLazy()
- Specified by:
asLazyin interfaceByteIterable
-
asUnmodifiable
public MutableByteStack asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableByteStack
-
asSynchronized
public MutableByteStack asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableByteStack
-
toImmutable
public ImmutableByteStack toImmutable()
- Specified by:
toImmutablein interfaceByteStack
-
newEmpty
public MutableByteStack newEmpty()
- Specified by:
newEmptyin interfaceMutableByteStack- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceByteIterable
-
chunk
public RichIterable<ByteIterable> chunk(int size)
- Specified by:
chunkin interfaceByteIterable
-
getFirst
public byte getFirst()
- Specified by:
getFirstin interfaceOrderedByteIterable
-
indexOf
public int indexOf(byte value)
- Specified by:
indexOfin interfaceOrderedByteIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedByteIterable
-
forEachWithIndex
public void forEachWithIndex(ByteIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedByteIterable
-
selectWithIndex
public MutableByteStack selectWithIndex(ByteIntPredicate predicate)
Returns a new MutableByteStack including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceByteStack- Specified by:
selectWithIndexin interfaceMutableByteStack- Specified by:
selectWithIndexin interfaceOrderedByteIterable- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableByteCollection> R selectWithIndex(ByteIntPredicate predicate, R target)
Returns a new MutableByteCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedByteIterable- Since:
- 11.1.
-
rejectWithIndex
public MutableByteStack rejectWithIndex(ByteIntPredicate predicate)
Returns a new MutableByteStack excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceByteStack- Specified by:
rejectWithIndexin interfaceMutableByteStack- Specified by:
rejectWithIndexin interfaceOrderedByteIterable- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableByteCollection> R rejectWithIndex(ByteIntPredicate predicate, R target)
Returns a new MutableByteCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedByteIterable- Since:
- 11.1.
-
collectWithIndex
public <V> MutableStack<V> collectWithIndex(ByteIntToObjectFunction<? 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 interfaceByteStack- Specified by:
collectWithIndexin interfaceMutableByteStack- Specified by:
collectWithIndexin interfaceOrderedByteIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(ByteIntToObjectFunction<? 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 interfaceOrderedByteIterable- Since:
- 9.1.
-
-