Class SynchronizedCharStack
- java.lang.Object
-
- org.eclipse.collections.impl.stack.mutable.primitive.SynchronizedCharStack
-
- All Implemented Interfaces:
Serializable,CharIterable,OrderedCharIterable,PrimitiveIterable,CharStack,MutableCharStack
public class SynchronizedCharStack extends Object implements MutableCharStack, Serializable
A synchronized view of aMutableCharStack. It is imperative that the user manually synchronize on the collection when iterating over it using theCharIterator, as perCollections.synchronizedCollection(Collection).This file was automatically generated from template file synchronizedPrimitiveStack.stg.
- Since:
- 3.1.
- See Also:
MutableCharStack.asSynchronized(),MutableStack.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedCharStack(MutableCharStack stack)SynchronizedCharStack(MutableCharStack stack, Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(CharPredicate predicate)booleananySatisfy(CharPredicate predicate)voidappendString(Appendable appendable)voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)LazyCharIterableasLazy()MutableCharStackasSynchronized()MutableCharStackasUnmodifiable()doubleaverage()CharIteratorcharIterator()Must be called in a synchronized block.RichIterable<CharIterable>chunk(int size)voidclear()<V> MutableStack<V>collect(CharToObjectFunction<? extends V> function)<V> MutableStack<V>collectWithIndex(CharIntToObjectFunction<? 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(CharIntToObjectFunction<? 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(char value)booleancontainsAll(char... source)booleancontainsAll(CharIterable source)intcount(CharPredicate predicate)chardetectIfNone(CharPredicate predicate, char ifNone)voideach(CharProcedure procedure)booleanequals(Object otherStack)voidforEachWithIndex(CharIntProcedure procedure)chargetFirst()inthashCode()intindexOf(char value)<T> TinjectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)booleanisEmpty()StringmakeString()StringmakeString(String separator)StringmakeString(String start, String separator, String end)charmax()charmaxIfEmpty(char defaultValue)doublemedian()charmin()charminIfEmpty(char defaultValue)MutableCharStacknewEmpty()booleannoneSatisfy(CharPredicate predicate)booleannotEmpty()charpeek()CharListpeek(int count)charpeekAt(int index)charpop()CharListpop(int count)voidpush(char item)MutableCharStackreject(CharPredicate predicate)MutableCharStackrejectWithIndex(CharIntPredicate predicate)Returns a new MutableCharStack excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableCharCollection>
RrejectWithIndex(CharIntPredicate predicate, R target)Returns a new MutableCharCollection excluding all elements with corresponding indexes matching the specified predicate.MutableCharStackselect(CharPredicate predicate)MutableCharStackselectWithIndex(CharIntPredicate predicate)Returns a new MutableCharStack including all elements with corresponding indexes matching the specified predicate.<R extends MutableCharCollection>
RselectWithIndex(CharIntPredicate predicate, R target)Returns a new MutableCharCollection including all elements with corresponding indexes matching the specified predicate.intsize()longsum()char[]toArray()char[]toArray(char[] target)MutableCharBagtoBag()ImmutableCharStacktoImmutable()MutableCharListtoList()MutableCharSettoSet()char[]toSortedArray()MutableCharListtoSortedList()StringtoString()-
Methods inherited from interface org.eclipse.collections.api.CharIterable
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.MutableCharStack
tap
-
-
-
-
Constructor Detail
-
SynchronizedCharStack
public SynchronizedCharStack(MutableCharStack stack)
-
SynchronizedCharStack
public SynchronizedCharStack(MutableCharStack stack, Object newLock)
-
-
Method Detail
-
push
public void push(char item)
- Specified by:
pushin interfaceMutableCharStack
-
pop
public char pop()
- Specified by:
popin interfaceMutableCharStack
-
pop
public CharList pop(int count)
- Specified by:
popin interfaceMutableCharStack
-
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 interfaceMutableCharStack
-
contains
public boolean contains(char value)
- Specified by:
containsin interfaceCharIterable
-
containsAll
public boolean containsAll(char... source)
- Specified by:
containsAllin interfaceCharIterable
-
containsAll
public boolean containsAll(CharIterable source)
- Specified by:
containsAllin interfaceCharIterable
-
charIterator
public CharIterator charIterator()
Must be called in a synchronized block.- Specified by:
charIteratorin interfaceCharIterable
-
each
public void each(CharProcedure procedure)
- Specified by:
eachin interfaceCharIterable- Since:
- 7.0.
-
count
public int count(CharPredicate predicate)
- Specified by:
countin interfaceCharIterable
-
anySatisfy
public boolean anySatisfy(CharPredicate predicate)
- Specified by:
anySatisfyin interfaceCharIterable
-
allSatisfy
public boolean allSatisfy(CharPredicate predicate)
- Specified by:
allSatisfyin interfaceCharIterable
-
noneSatisfy
public boolean noneSatisfy(CharPredicate predicate)
- Specified by:
noneSatisfyin interfaceCharIterable
-
detectIfNone
public char detectIfNone(CharPredicate predicate, char ifNone)
- Specified by:
detectIfNonein interfaceCharIterable
-
select
public MutableCharStack select(CharPredicate predicate)
- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceCharStack- Specified by:
selectin interfaceMutableCharStack- Specified by:
selectin interfaceOrderedCharIterable
-
reject
public MutableCharStack reject(CharPredicate predicate)
- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceCharStack- Specified by:
rejectin interfaceMutableCharStack- Specified by:
rejectin interfaceOrderedCharIterable
-
collect
public <V> MutableStack<V> collect(CharToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceCharIterable- Specified by:
collectin interfaceCharStack- Specified by:
collectin interfaceMutableCharStack- Specified by:
collectin interfaceOrderedCharIterable
-
sum
public long sum()
- Specified by:
sumin interfaceCharIterable
-
max
public char max()
- Specified by:
maxin interfaceCharIterable
-
min
public char min()
- Specified by:
minin interfaceCharIterable
-
minIfEmpty
public char minIfEmpty(char defaultValue)
- Specified by:
minIfEmptyin interfaceCharIterable
-
maxIfEmpty
public char maxIfEmpty(char defaultValue)
- Specified by:
maxIfEmptyin interfaceCharIterable
-
average
public double average()
- Specified by:
averagein interfaceCharIterable
-
median
public double median()
- Specified by:
medianin interfaceCharIterable
-
toSortedList
public MutableCharList toSortedList()
- Specified by:
toSortedListin interfaceCharIterable
-
toSortedArray
public char[] toSortedArray()
- Specified by:
toSortedArrayin interfaceCharIterable
-
toArray
public char[] toArray()
- Specified by:
toArrayin interfaceCharIterable
-
toArray
public char[] toArray(char[] target)
- Specified by:
toArrayin interfaceCharIterable
-
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 MutableCharList toList()
- Specified by:
toListin interfaceCharIterable
-
toSet
public MutableCharSet toSet()
- Specified by:
toSetin interfaceCharIterable
-
toBag
public MutableCharBag toBag()
- Specified by:
toBagin interfaceCharIterable
-
equals
public boolean equals(Object otherStack)
-
hashCode
public int hashCode()
-
asLazy
public LazyCharIterable asLazy()
- Specified by:
asLazyin interfaceCharIterable
-
asUnmodifiable
public MutableCharStack asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableCharStack
-
asSynchronized
public MutableCharStack asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableCharStack
-
toImmutable
public ImmutableCharStack toImmutable()
- Specified by:
toImmutablein interfaceCharStack
-
newEmpty
public MutableCharStack newEmpty()
- Specified by:
newEmptyin interfaceMutableCharStack- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceCharIterable
-
chunk
public RichIterable<CharIterable> chunk(int size)
- Specified by:
chunkin interfaceCharIterable
-
getFirst
public char getFirst()
- Specified by:
getFirstin interfaceOrderedCharIterable
-
indexOf
public int indexOf(char value)
- Specified by:
indexOfin interfaceOrderedCharIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedCharIterable
-
forEachWithIndex
public void forEachWithIndex(CharIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedCharIterable
-
selectWithIndex
public MutableCharStack selectWithIndex(CharIntPredicate predicate)
Returns a new MutableCharStack including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceCharStack- Specified by:
selectWithIndexin interfaceMutableCharStack- Specified by:
selectWithIndexin interfaceOrderedCharIterable- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableCharCollection> R selectWithIndex(CharIntPredicate predicate, R target)
Returns a new MutableCharCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndexin interfaceOrderedCharIterable- Since:
- 11.1.
-
rejectWithIndex
public MutableCharStack rejectWithIndex(CharIntPredicate predicate)
Returns a new MutableCharStack excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceCharStack- Specified by:
rejectWithIndexin interfaceMutableCharStack- Specified by:
rejectWithIndexin interfaceOrderedCharIterable- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableCharCollection> R rejectWithIndex(CharIntPredicate predicate, R target)
Returns a new MutableCharCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndexin interfaceOrderedCharIterable- Since:
- 11.1.
-
collectWithIndex
public <V> MutableStack<V> collectWithIndex(CharIntToObjectFunction<? 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 interfaceCharStack- Specified by:
collectWithIndexin interfaceMutableCharStack- Specified by:
collectWithIndexin interfaceOrderedCharIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(CharIntToObjectFunction<? 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 interfaceOrderedCharIterable- Since:
- 9.1.
-
-