Class SynchronizedStack<T>
- java.lang.Object
-
- org.eclipse.collections.impl.stack.mutable.SynchronizedStack<T>
-
- All Implemented Interfaces:
Serializable,Iterable<T>,InternalIterable<T>,OrderedIterable<T>,RichIterable<T>,MutableStack<T>,StackIterable<T>
public final class SynchronizedStack<T> extends Object implements MutableStack<T>, Serializable
A synchronized view of aMutableStack. It is imperative that the user manually synchronize on the collection when iterating over it using the standard JDK iterator or JDK 5 for loop, as perCollections.synchronizedCollection(Collection).- See Also:
MutableStack.asSynchronized(), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedStack(MutableStack<T> newStack)SynchronizedStack(MutableStack<T> newStack, Object newLock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
MutableMap<K,V>aggregateBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator)<K,V>
MutableMap<K,V>aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)booleanallSatisfy(Predicate<? super T> predicate)<P> booleanallSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)booleananySatisfy(Predicate<? super T> predicate)<P> booleananySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)voidappendString(Appendable appendable)voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)LazyIterable<T>asLazy()MutableStack<T>asSynchronized()MutableStack<T>asUnmodifiable()RichIterable<RichIterable<T>>chunk(int size)voidclear()<V> MutableStack<V>collect(Function<? super T,? extends V> function)<V,R extends Collection<V>>
Rcollect(Function<? super T,? extends V> function, R target)MutableBooleanStackcollectBoolean(BooleanFunction<? super T> booleanFunction)<R extends MutableBooleanCollection>
RcollectBoolean(BooleanFunction<? super T> booleanFunction, R target)MutableByteStackcollectByte(ByteFunction<? super T> byteFunction)<R extends MutableByteCollection>
RcollectByte(ByteFunction<? super T> byteFunction, R target)MutableCharStackcollectChar(CharFunction<? super T> charFunction)<R extends MutableCharCollection>
RcollectChar(CharFunction<? super T> charFunction, R target)MutableDoubleStackcollectDouble(DoubleFunction<? super T> doubleFunction)<R extends MutableDoubleCollection>
RcollectDouble(DoubleFunction<? super T> doubleFunction, R target)MutableFloatStackcollectFloat(FloatFunction<? super T> floatFunction)<R extends MutableFloatCollection>
RcollectFloat(FloatFunction<? super T> floatFunction, R target)<V> MutableStack<V>collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)<V,R extends Collection<V>>
RcollectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function, R target)MutableIntStackcollectInt(IntFunction<? super T> intFunction)<R extends MutableIntCollection>
RcollectInt(IntFunction<? super T> intFunction, R target)MutableLongStackcollectLong(LongFunction<? super T> longFunction)<R extends MutableLongCollection>
RcollectLong(LongFunction<? super T> longFunction, R target)MutableShortStackcollectShort(ShortFunction<? super T> shortFunction)<R extends MutableShortCollection>
RcollectShort(ShortFunction<? super T> shortFunction, R target)<P,V>
MutableStack<V>collectWith(Function2<? super T,? super P,? extends V> function, P parameter)<P,V,R extends Collection<V>>
RcollectWith(Function2<? super T,? super P,? extends V> function, P parameter, R targetCollection)<V> MutableStack<V>collectWithIndex(ObjectIntToObjectFunction<? super T,? extends V> function)<V,R extends Collection<V>>
RcollectWithIndex(ObjectIntToObjectFunction<? super T,? extends V> function, R target)booleancontains(Object object)booleancontainsAll(Collection<?> source)booleancontainsAllArguments(Object... elements)booleancontainsAllIterable(Iterable<?> source)booleancontainsAny(Collection<?> source)booleancontainsAnyIterable(Iterable<?> source)booleancontainsNone(Collection<?> source)booleancontainsNoneIterable(Iterable<?> source)<S> booleancorresponds(OrderedIterable<S> other, Predicate2<? super T,? super S> predicate)intcount(Predicate<? super T> predicate)<P> intcountWith(Predicate2<? super T,? super P> predicate, P parameter)Tdetect(Predicate<? super T> predicate)TdetectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)intdetectIndex(Predicate<? super T> predicate)Optional<T>detectOptional(Predicate<? super T> predicate)<P> TdetectWith(Predicate2<? super T,? super P> predicate, P parameter)<P> TdetectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)<P> Optional<T>detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)MutableStack<T>distinct()MutableStack<T>dropWhile(Predicate<? super T> predicate)voideach(Procedure<? super T> procedure)booleanequals(Object obj)<V> MutableStack<V>flatCollect(Function<? super T,? extends Iterable<V>> function)<V,R extends Collection<V>>
RflatCollect(Function<? super T,? extends Iterable<V>> function, R target)<R extends MutableBooleanCollection>
RflatCollectBoolean(Function<? super T,? extends BooleanIterable> function, R target)<R extends MutableByteCollection>
RflatCollectByte(Function<? super T,? extends ByteIterable> function, R target)<R extends MutableCharCollection>
RflatCollectChar(Function<? super T,? extends CharIterable> function, R target)<R extends MutableDoubleCollection>
RflatCollectDouble(Function<? super T,? extends DoubleIterable> function, R target)<R extends MutableFloatCollection>
RflatCollectFloat(Function<? super T,? extends FloatIterable> function, R target)<R extends MutableIntCollection>
RflatCollectInt(Function<? super T,? extends IntIterable> function, R target)<R extends MutableLongCollection>
RflatCollectLong(Function<? super T,? extends LongIterable> function, R target)<R extends MutableShortCollection>
RflatCollectShort(Function<? super T,? extends ShortIterable> function, R target)voidforEach(int startIndex, int endIndex, Procedure<? super T> procedure)<P> voidforEachWith(Procedure2<? super T,? super P> procedure, P parameter)voidforEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)voidforEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)TgetFirst()Optional<T>getFirstOptional()TgetLast()Optional<T>getLastOptional()TgetOnly()<V> MutableListMultimap<V,T>groupBy(Function<? super T,? extends V> function)<V,R extends MutableMultimap<V,T>>
RgroupBy(Function<? super T,? extends V> function, R target)<V> MutableListMultimap<V,T>groupByEach(Function<? super T,? extends Iterable<V>> function)<V,R extends MutableMultimap<V,T>>
RgroupByEach(Function<? super T,? extends Iterable<V>> function, R target)<V> MutableMap<V,T>groupByUniqueKey(Function<? super T,? extends V> function)<V,R extends MutableMapIterable<V,T>>
RgroupByUniqueKey(Function<? super T,? extends V> function, R target)inthashCode()intindexOf(Object object)doubleinjectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> doubleObjectToDoubleFunction)floatinjectInto(float injectedValue, FloatObjectToFloatFunction<? super T> floatObjectToFloatFunction)intinjectInto(int injectedValue, IntObjectToIntFunction<? super T> intObjectToIntFunction)longinjectInto(long injectedValue, LongObjectToLongFunction<? super T> longObjectToLongFunction)<IV> IVinjectInto(IV injectedValue, Function2<? super IV,? super T,? extends IV> function)<R extends Collection<T>>
Rinto(R target)booleanisEmpty()Iterator<T>iterator()StringmakeString()StringmakeString(String separator)StringmakeString(String start, String separator, String end)Tmax()Tmax(Comparator<? super T> comparator)<V extends Comparable<? super V>>
TmaxBy(Function<? super T,? extends V> function)Tmin()Tmin(Comparator<? super T> comparator)<V extends Comparable<? super V>>
TminBy(Function<? super T,? extends V> function)booleannoneSatisfy(Predicate<? super T> predicate)<P> booleannoneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)booleannotEmpty()static <T,S extends MutableStack<T>>
SynchronizedStack<T>of(S stack)This method will take a MutableStack and wrap it directly in a SynchronizedStack.PartitionMutableStack<T>partition(Predicate<? super T> predicate)PartitionMutableStack<T>partitionWhile(Predicate<? super T> predicate)<P> PartitionMutableStack<T>partitionWith(Predicate2<? super T,? super P> predicate, P parameter)Tpeek()ListIterable<T>peek(int count)TpeekAt(int index)Tpop()ListIterable<T>pop(int count)<R extends Collection<T>>
Rpop(int count, R targetCollection)voidpush(T item)<K> MutableMap<K,T>reduceBy(Function<? super T,? extends K> groupBy, Function2<? super T,? super T,? extends T> reduceFunction)MutableStack<T>reject(Predicate<? super T> predicate)<R extends Collection<T>>
Rreject(Predicate<? super T> predicate, R target)<P> MutableStack<T>rejectWith(Predicate2<? super T,? super P> predicate, P parameter)<P,R extends Collection<T>>
RrejectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)<R extends Collection<T>>
RrejectWithIndex(ObjectIntPredicate<? super T> predicate, R target)MutableStack<T>select(Predicate<? super T> predicate)<R extends Collection<T>>
Rselect(Predicate<? super T> predicate, R target)<S> MutableStack<S>selectInstancesOf(Class<S> clazz)<P> MutableStack<T>selectWith(Predicate2<? super T,? super P> predicate, P parameter)<P,R extends Collection<T>>
RselectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)<R extends Collection<T>>
RselectWithIndex(ObjectIntPredicate<? super T> predicate, R target)intsize()<V> MutableObjectDoubleMap<V>sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)<V> MutableObjectDoubleMap<V>sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)<V> MutableObjectLongMap<V>sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)<V> MutableObjectLongMap<V>sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)doublesumOfDouble(DoubleFunction<? super T> doubleFunction)doublesumOfFloat(FloatFunction<? super T> floatFunction)longsumOfInt(IntFunction<? super T> intFunction)longsumOfLong(LongFunction<? super T> longFunction)MutableStack<T>takeWhile(Predicate<? super T> predicate)MutableStack<T>tap(Procedure<? super T> procedure)Object[]toArray()<T> T[]toArray(T[] a)MutableBag<T>toBag()<NK,NV>
MutableBiMap<NK,NV>toBiMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)ImmutableStack<T>toImmutable()MutableList<T>toList()<NK,NV>
MutableMap<NK,NV>toMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)<NK,NV,R extends Map<NK,NV>>
RtoMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction, R target)MutableSet<T>toSet()MutableSortedBag<T>toSortedBag()MutableSortedBag<T>toSortedBag(Comparator<? super T> comparator)MutableList<T>toSortedList()MutableList<T>toSortedList(Comparator<? super T> comparator)<NK,NV>
MutableSortedMap<NK,NV>toSortedMap(Comparator<? super NK> comparator, Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)<NK,NV>
MutableSortedMap<NK,NV>toSortedMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)MutableSortedSet<T>toSortedSet()MutableSortedSet<T>toSortedSet(Comparator<? super T> comparator)MutableStack<T>toStack()StringtoString()<S> MutableStack<Pair<T,S>>zip(Iterable<S> that)<S,R extends Collection<Pair<T,S>>>
Rzip(Iterable<S> that, R target)MutableStack<Pair<T,Integer>>zipWithIndex()<R extends Collection<Pair<T,Integer>>>
RzipWithIndex(R target)-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach
-
Methods inherited from interface java.lang.Iterable
spliterator
-
Methods inherited from interface org.eclipse.collections.api.stack.MutableStack
countBy, countByEach, countByWith, flatCollectWith
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, containsBy, countBy, countByEach, countByWith, flatCollectWith, forEach, getAny, groupByAndCollect, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, reduce, reduceBy, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toSortedBagBy, toSortedListBy, toSortedMapBy, toSortedSetBy
-
-
-
-
Constructor Detail
-
SynchronizedStack
public SynchronizedStack(MutableStack<T> newStack)
-
SynchronizedStack
public SynchronizedStack(MutableStack<T> newStack, Object newLock)
-
-
Method Detail
-
of
public static <T,S extends MutableStack<T>> SynchronizedStack<T> of(S stack)
This method will take a MutableStack and wrap it directly in a SynchronizedStack.
-
pop
public T pop()
- Specified by:
popin interfaceMutableStack<T>
-
pop
public ListIterable<T> pop(int count)
- Specified by:
popin interfaceMutableStack<T>
-
pop
public <R extends Collection<T>> R pop(int count, R targetCollection)
- Specified by:
popin interfaceMutableStack<T>
-
pop
public <R extends MutableStack<T>> R pop(int count, R targetStack)
- Specified by:
popin interfaceMutableStack<T>
-
clear
public void clear()
- Specified by:
clearin interfaceMutableStack<T>
-
push
public void push(T item)
- Specified by:
pushin interfaceMutableStack<T>
-
peek
public T peek()
- Specified by:
peekin interfaceStackIterable<T>
-
peek
public ListIterable<T> peek(int count)
- Specified by:
peekin interfaceStackIterable<T>
-
peekAt
public T peekAt(int index)
- Specified by:
peekAtin interfaceStackIterable<T>
-
select
public MutableStack<T> select(Predicate<? super T> predicate)
- Specified by:
selectin interfaceMutableStack<T>- Specified by:
selectin interfaceOrderedIterable<T>- Specified by:
selectin interfaceRichIterable<T>- Specified by:
selectin interfaceStackIterable<T>
-
selectWith
public <P> MutableStack<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectWithin interfaceMutableStack<T>- Specified by:
selectWithin interfaceOrderedIterable<T>- Specified by:
selectWithin interfaceRichIterable<T>- Specified by:
selectWithin interfaceStackIterable<T>
-
select
public <R extends Collection<T>> R select(Predicate<? super T> predicate, R target)
- Specified by:
selectin interfaceRichIterable<T>
-
selectWith
public <P,R extends Collection<T>> R selectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)
- Specified by:
selectWithin interfaceRichIterable<T>
-
reject
public MutableStack<T> reject(Predicate<? super T> predicate)
- Specified by:
rejectin interfaceMutableStack<T>- Specified by:
rejectin interfaceOrderedIterable<T>- Specified by:
rejectin interfaceRichIterable<T>- Specified by:
rejectin interfaceStackIterable<T>
-
rejectWith
public <P> MutableStack<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
rejectWithin interfaceMutableStack<T>- Specified by:
rejectWithin interfaceOrderedIterable<T>- Specified by:
rejectWithin interfaceRichIterable<T>- Specified by:
rejectWithin interfaceStackIterable<T>
-
reject
public <R extends Collection<T>> R reject(Predicate<? super T> predicate, R target)
- Specified by:
rejectin interfaceRichIterable<T>
-
rejectWith
public <P,R extends Collection<T>> R rejectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)
- Specified by:
rejectWithin interfaceRichIterable<T>
-
partition
public PartitionMutableStack<T> partition(Predicate<? super T> predicate)
- Specified by:
partitionin interfaceMutableStack<T>- Specified by:
partitionin interfaceOrderedIterable<T>- Specified by:
partitionin interfaceRichIterable<T>- Specified by:
partitionin interfaceStackIterable<T>
-
partitionWith
public <P> PartitionMutableStack<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
partitionWithin interfaceMutableStack<T>- Specified by:
partitionWithin interfaceOrderedIterable<T>- Specified by:
partitionWithin interfaceRichIterable<T>- Specified by:
partitionWithin interfaceStackIterable<T>
-
selectInstancesOf
public <S> MutableStack<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOfin interfaceMutableStack<T>- Specified by:
selectInstancesOfin interfaceOrderedIterable<T>- Specified by:
selectInstancesOfin interfaceRichIterable<T>- Specified by:
selectInstancesOfin interfaceStackIterable<T>
-
collect
public <V> MutableStack<V> collect(Function<? super T,? extends V> function)
- Specified by:
collectin interfaceMutableStack<T>- Specified by:
collectin interfaceOrderedIterable<T>- Specified by:
collectin interfaceRichIterable<T>- Specified by:
collectin interfaceStackIterable<T>
-
collectBoolean
public MutableBooleanStack collectBoolean(BooleanFunction<? super T> booleanFunction)
- Specified by:
collectBooleanin interfaceMutableStack<T>- Specified by:
collectBooleanin interfaceOrderedIterable<T>- Specified by:
collectBooleanin interfaceRichIterable<T>- Specified by:
collectBooleanin interfaceStackIterable<T>
-
collectBoolean
public <R extends MutableBooleanCollection> R collectBoolean(BooleanFunction<? super T> booleanFunction, R target)
- Specified by:
collectBooleanin interfaceRichIterable<T>
-
flatCollectBoolean
public <R extends MutableBooleanCollection> R flatCollectBoolean(Function<? super T,? extends BooleanIterable> function, R target)
- Specified by:
flatCollectBooleanin interfaceRichIterable<T>
-
collectByte
public MutableByteStack collectByte(ByteFunction<? super T> byteFunction)
- Specified by:
collectBytein interfaceMutableStack<T>- Specified by:
collectBytein interfaceOrderedIterable<T>- Specified by:
collectBytein interfaceRichIterable<T>- Specified by:
collectBytein interfaceStackIterable<T>
-
collectByte
public <R extends MutableByteCollection> R collectByte(ByteFunction<? super T> byteFunction, R target)
- Specified by:
collectBytein interfaceRichIterable<T>
-
flatCollectByte
public <R extends MutableByteCollection> R flatCollectByte(Function<? super T,? extends ByteIterable> function, R target)
- Specified by:
flatCollectBytein interfaceRichIterable<T>
-
collectChar
public MutableCharStack collectChar(CharFunction<? super T> charFunction)
- Specified by:
collectCharin interfaceMutableStack<T>- Specified by:
collectCharin interfaceOrderedIterable<T>- Specified by:
collectCharin interfaceRichIterable<T>- Specified by:
collectCharin interfaceStackIterable<T>
-
collectChar
public <R extends MutableCharCollection> R collectChar(CharFunction<? super T> charFunction, R target)
- Specified by:
collectCharin interfaceRichIterable<T>
-
flatCollectChar
public <R extends MutableCharCollection> R flatCollectChar(Function<? super T,? extends CharIterable> function, R target)
- Specified by:
flatCollectCharin interfaceRichIterable<T>
-
collectDouble
public MutableDoubleStack collectDouble(DoubleFunction<? super T> doubleFunction)
- Specified by:
collectDoublein interfaceMutableStack<T>- Specified by:
collectDoublein interfaceOrderedIterable<T>- Specified by:
collectDoublein interfaceRichIterable<T>- Specified by:
collectDoublein interfaceStackIterable<T>
-
collectDouble
public <R extends MutableDoubleCollection> R collectDouble(DoubleFunction<? super T> doubleFunction, R target)
- Specified by:
collectDoublein interfaceRichIterable<T>
-
flatCollectDouble
public <R extends MutableDoubleCollection> R flatCollectDouble(Function<? super T,? extends DoubleIterable> function, R target)
- Specified by:
flatCollectDoublein interfaceRichIterable<T>
-
collectFloat
public MutableFloatStack collectFloat(FloatFunction<? super T> floatFunction)
- Specified by:
collectFloatin interfaceMutableStack<T>- Specified by:
collectFloatin interfaceOrderedIterable<T>- Specified by:
collectFloatin interfaceRichIterable<T>- Specified by:
collectFloatin interfaceStackIterable<T>
-
collectFloat
public <R extends MutableFloatCollection> R collectFloat(FloatFunction<? super T> floatFunction, R target)
- Specified by:
collectFloatin interfaceRichIterable<T>
-
flatCollectFloat
public <R extends MutableFloatCollection> R flatCollectFloat(Function<? super T,? extends FloatIterable> function, R target)
- Specified by:
flatCollectFloatin interfaceRichIterable<T>
-
collectInt
public MutableIntStack collectInt(IntFunction<? super T> intFunction)
- Specified by:
collectIntin interfaceMutableStack<T>- Specified by:
collectIntin interfaceOrderedIterable<T>- Specified by:
collectIntin interfaceRichIterable<T>- Specified by:
collectIntin interfaceStackIterable<T>
-
collectInt
public <R extends MutableIntCollection> R collectInt(IntFunction<? super T> intFunction, R target)
- Specified by:
collectIntin interfaceRichIterable<T>
-
flatCollectInt
public <R extends MutableIntCollection> R flatCollectInt(Function<? super T,? extends IntIterable> function, R target)
- Specified by:
flatCollectIntin interfaceRichIterable<T>
-
collectLong
public MutableLongStack collectLong(LongFunction<? super T> longFunction)
- Specified by:
collectLongin interfaceMutableStack<T>- Specified by:
collectLongin interfaceOrderedIterable<T>- Specified by:
collectLongin interfaceRichIterable<T>- Specified by:
collectLongin interfaceStackIterable<T>
-
flatCollectLong
public <R extends MutableLongCollection> R flatCollectLong(Function<? super T,? extends LongIterable> function, R target)
- Specified by:
flatCollectLongin interfaceRichIterable<T>
-
collectLong
public <R extends MutableLongCollection> R collectLong(LongFunction<? super T> longFunction, R target)
- Specified by:
collectLongin interfaceRichIterable<T>
-
collectShort
public MutableShortStack collectShort(ShortFunction<? super T> shortFunction)
- Specified by:
collectShortin interfaceMutableStack<T>- Specified by:
collectShortin interfaceOrderedIterable<T>- Specified by:
collectShortin interfaceRichIterable<T>- Specified by:
collectShortin interfaceStackIterable<T>
-
collectShort
public <R extends MutableShortCollection> R collectShort(ShortFunction<? super T> shortFunction, R target)
- Specified by:
collectShortin interfaceRichIterable<T>
-
flatCollectShort
public <R extends MutableShortCollection> R flatCollectShort(Function<? super T,? extends ShortIterable> function, R target)
- Specified by:
flatCollectShortin interfaceRichIterable<T>
-
collect
public <V,R extends Collection<V>> R collect(Function<? super T,? extends V> function, R target)
- Specified by:
collectin interfaceRichIterable<T>
-
collectWith
public <P,V> MutableStack<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
collectWithin interfaceMutableStack<T>- Specified by:
collectWithin interfaceOrderedIterable<T>- Specified by:
collectWithin interfaceRichIterable<T>- Specified by:
collectWithin interfaceStackIterable<T>
-
collectWith
public <P,V,R extends Collection<V>> R collectWith(Function2<? super T,? super P,? extends V> function, P parameter, R targetCollection)
- Specified by:
collectWithin interfaceRichIterable<T>
-
collectIf
public <V> MutableStack<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
- Specified by:
collectIfin interfaceMutableStack<T>- Specified by:
collectIfin interfaceOrderedIterable<T>- Specified by:
collectIfin interfaceRichIterable<T>- Specified by:
collectIfin interfaceStackIterable<T>
-
collectIf
public <V,R extends Collection<V>> R collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function, R target)
- Specified by:
collectIfin interfaceRichIterable<T>
-
flatCollect
public <V> MutableStack<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
- Specified by:
flatCollectin interfaceMutableStack<T>- Specified by:
flatCollectin interfaceOrderedIterable<T>- Specified by:
flatCollectin interfaceRichIterable<T>- Specified by:
flatCollectin interfaceStackIterable<T>
-
flatCollect
public <V,R extends Collection<V>> R flatCollect(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
flatCollectin interfaceRichIterable<T>
-
zip
public <S,R extends Collection<Pair<T,S>>> R zip(Iterable<S> that, R target)
- Specified by:
zipin interfaceOrderedIterable<T>- Specified by:
zipin interfaceRichIterable<T>
-
zip
public <S> MutableStack<Pair<T,S>> zip(Iterable<S> that)
- Specified by:
zipin interfaceMutableStack<T>- Specified by:
zipin interfaceOrderedIterable<T>- Specified by:
zipin interfaceRichIterable<T>- Specified by:
zipin interfaceStackIterable<T>
-
zipWithIndex
public <R extends Collection<Pair<T,Integer>>> R zipWithIndex(R target)
- Specified by:
zipWithIndexin interfaceOrderedIterable<T>- Specified by:
zipWithIndexin interfaceRichIterable<T>
-
zipWithIndex
public MutableStack<Pair<T,Integer>> zipWithIndex()
- Specified by:
zipWithIndexin interfaceMutableStack<T>- Specified by:
zipWithIndexin interfaceOrderedIterable<T>- Specified by:
zipWithIndexin interfaceRichIterable<T>- Specified by:
zipWithIndexin interfaceStackIterable<T>
-
size
public int size()
- Specified by:
sizein interfaceRichIterable<T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceRichIterable<T>
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfaceRichIterable<T>
-
getFirst
public T getFirst()
- Specified by:
getFirstin interfaceOrderedIterable<T>- Specified by:
getFirstin interfaceRichIterable<T>- Specified by:
getFirstin interfaceStackIterable<T>
-
getFirstOptional
public Optional<T> getFirstOptional()
- Specified by:
getFirstOptionalin interfaceOrderedIterable<T>
-
getLast
public T getLast()
- Specified by:
getLastin interfaceOrderedIterable<T>- Specified by:
getLastin interfaceRichIterable<T>- Specified by:
getLastin interfaceStackIterable<T>
-
getLastOptional
public Optional<T> getLastOptional()
- Specified by:
getLastOptionalin interfaceOrderedIterable<T>
-
getOnly
public T getOnly()
- Specified by:
getOnlyin interfaceRichIterable<T>
-
contains
public boolean contains(Object object)
- Specified by:
containsin interfaceRichIterable<T>
-
containsAllIterable
public boolean containsAllIterable(Iterable<?> source)
- Specified by:
containsAllIterablein interfaceRichIterable<T>
-
containsAll
public boolean containsAll(Collection<?> source)
- Specified by:
containsAllin interfaceRichIterable<T>
-
containsAny
public boolean containsAny(Collection<?> source)
- Specified by:
containsAnyin interfaceRichIterable<T>
-
containsNone
public boolean containsNone(Collection<?> source)
- Specified by:
containsNonein interfaceRichIterable<T>
-
containsAnyIterable
public boolean containsAnyIterable(Iterable<?> source)
- Specified by:
containsAnyIterablein interfaceRichIterable<T>
-
containsNoneIterable
public boolean containsNoneIterable(Iterable<?> source)
- Specified by:
containsNoneIterablein interfaceRichIterable<T>
-
containsAllArguments
public boolean containsAllArguments(Object... elements)
- Specified by:
containsAllArgumentsin interfaceRichIterable<T>
-
detect
public T detect(Predicate<? super T> predicate)
- Specified by:
detectin interfaceRichIterable<T>
-
detectWith
public <P> T detectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithin interfaceRichIterable<T>
-
detectOptional
public Optional<T> detectOptional(Predicate<? super T> predicate)
- Specified by:
detectOptionalin interfaceRichIterable<T>
-
detectWithOptional
public <P> Optional<T> detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithOptionalin interfaceRichIterable<T>
-
detectIfNone
public T detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
- Specified by:
detectIfNonein interfaceRichIterable<T>
-
detectWithIfNone
public <P> T detectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)
- Specified by:
detectWithIfNonein interfaceRichIterable<T>
-
count
public int count(Predicate<? super T> predicate)
- Specified by:
countin interfaceRichIterable<T>
-
countWith
public <P> int countWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
countWithin interfaceRichIterable<T>
-
anySatisfy
public boolean anySatisfy(Predicate<? super T> predicate)
- Specified by:
anySatisfyin interfaceRichIterable<T>
-
anySatisfyWith
public <P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
anySatisfyWithin interfaceRichIterable<T>
-
allSatisfy
public boolean allSatisfy(Predicate<? super T> predicate)
- Specified by:
allSatisfyin interfaceRichIterable<T>
-
allSatisfyWith
public <P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
allSatisfyWithin interfaceRichIterable<T>
-
noneSatisfy
public boolean noneSatisfy(Predicate<? super T> predicate)
- Specified by:
noneSatisfyin interfaceRichIterable<T>
-
noneSatisfyWith
public <P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
noneSatisfyWithin interfaceRichIterable<T>
-
injectInto
public <IV> IV injectInto(IV injectedValue, Function2<? super IV,? super T,? extends IV> function)- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
public int injectInto(int injectedValue, IntObjectToIntFunction<? super T> intObjectToIntFunction)- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
public long injectInto(long injectedValue, LongObjectToLongFunction<? super T> longObjectToLongFunction)- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
public float injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> floatObjectToFloatFunction)- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> doubleObjectToDoubleFunction)- Specified by:
injectIntoin interfaceRichIterable<T>
-
into
public <R extends Collection<T>> R into(R target)
- Specified by:
intoin interfaceRichIterable<T>
-
toList
public MutableList<T> toList()
- Specified by:
toListin interfaceRichIterable<T>
-
toSortedList
public MutableList<T> toSortedList()
- Specified by:
toSortedListin interfaceRichIterable<T>
-
toSortedList
public MutableList<T> toSortedList(Comparator<? super T> comparator)
- Specified by:
toSortedListin interfaceRichIterable<T>
-
toSet
public MutableSet<T> toSet()
- Specified by:
toSetin interfaceRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet()
- Specified by:
toSortedSetin interfaceRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet(Comparator<? super T> comparator)
- Specified by:
toSortedSetin interfaceRichIterable<T>
-
toStack
public MutableStack<T> toStack()
- Specified by:
toStackin interfaceOrderedIterable<T>- Specified by:
toStackin interfaceStackIterable<T>
-
toImmutable
public ImmutableStack<T> toImmutable()
- Specified by:
toImmutablein interfaceStackIterable<T>
-
toBag
public MutableBag<T> toBag()
- Specified by:
toBagin interfaceRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag()
- Specified by:
toSortedBagin interfaceRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag(Comparator<? super T> comparator)
- Specified by:
toSortedBagin interfaceRichIterable<T>
-
toMap
public <NK,NV> MutableMap<NK,NV> toMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toMapin interfaceRichIterable<T>
-
toMap
public <NK,NV,R extends Map<NK,NV>> R toMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction, R target)
- Specified by:
toMapin interfaceRichIterable<T>
-
toSortedMap
public <NK,NV> MutableSortedMap<NK,NV> toSortedMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toSortedMapin interfaceRichIterable<T>
-
toSortedMap
public <NK,NV> MutableSortedMap<NK,NV> toSortedMap(Comparator<? super NK> comparator, Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toSortedMapin interfaceRichIterable<T>
-
toBiMap
public <NK,NV> MutableBiMap<NK,NV> toBiMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toBiMapin interfaceRichIterable<T>
-
asLazy
public LazyIterable<T> asLazy()
- Specified by:
asLazyin interfaceRichIterable<T>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceRichIterable<T>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceRichIterable<T>
-
min
public T min(Comparator<? super T> comparator)
- Specified by:
minin interfaceRichIterable<T>
-
max
public T max(Comparator<? super T> comparator)
- Specified by:
maxin interfaceRichIterable<T>
-
min
public T min()
- Specified by:
minin interfaceOrderedIterable<T>- Specified by:
minin interfaceRichIterable<T>
-
max
public T max()
- Specified by:
maxin interfaceOrderedIterable<T>- Specified by:
maxin interfaceRichIterable<T>
-
minBy
public <V extends Comparable<? super V>> T minBy(Function<? super T,? extends V> function)
- Specified by:
minByin interfaceRichIterable<T>
-
maxBy
public <V extends Comparable<? super V>> T maxBy(Function<? super T,? extends V> function)
- Specified by:
maxByin interfaceRichIterable<T>
-
sumOfInt
public long sumOfInt(IntFunction<? super T> intFunction)
- Specified by:
sumOfIntin interfaceRichIterable<T>
-
sumOfFloat
public double sumOfFloat(FloatFunction<? super T> floatFunction)
- Specified by:
sumOfFloatin interfaceRichIterable<T>
-
sumOfLong
public long sumOfLong(LongFunction<? super T> longFunction)
- Specified by:
sumOfLongin interfaceRichIterable<T>
-
sumOfDouble
public double sumOfDouble(DoubleFunction<? super T> doubleFunction)
- Specified by:
sumOfDoublein interfaceRichIterable<T>
-
sumByInt
public <V> MutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
- Specified by:
sumByIntin interfaceMutableStack<T>- Specified by:
sumByIntin interfaceRichIterable<T>
-
sumByFloat
public <V> MutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
- Specified by:
sumByFloatin interfaceMutableStack<T>- Specified by:
sumByFloatin interfaceRichIterable<T>
-
sumByLong
public <V> MutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
- Specified by:
sumByLongin interfaceMutableStack<T>- Specified by:
sumByLongin interfaceRichIterable<T>
-
sumByDouble
public <V> MutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
- Specified by:
sumByDoublein interfaceMutableStack<T>- Specified by:
sumByDoublein interfaceRichIterable<T>
-
makeString
public String makeString()
- Specified by:
makeStringin interfaceRichIterable<T>
-
makeString
public String makeString(String separator)
- Specified by:
makeStringin interfaceRichIterable<T>
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeStringin interfaceRichIterable<T>
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendStringin interfaceRichIterable<T>
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendStringin interfaceRichIterable<T>
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfaceRichIterable<T>
-
groupBy
public <V> MutableListMultimap<V,T> groupBy(Function<? super T,? extends V> function)
- Specified by:
groupByin interfaceMutableStack<T>- Specified by:
groupByin interfaceOrderedIterable<T>- Specified by:
groupByin interfaceRichIterable<T>- Specified by:
groupByin interfaceStackIterable<T>
-
groupBy
public <V,R extends MutableMultimap<V,T>> R groupBy(Function<? super T,? extends V> function, R target)
- Specified by:
groupByin interfaceRichIterable<T>
-
groupByEach
public <V> MutableListMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
groupByEachin interfaceMutableStack<T>- Specified by:
groupByEachin interfaceOrderedIterable<T>- Specified by:
groupByEachin interfaceRichIterable<T>- Specified by:
groupByEachin interfaceStackIterable<T>
-
groupByEach
public <V,R extends MutableMultimap<V,T>> R groupByEach(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
groupByEachin interfaceRichIterable<T>
-
groupByUniqueKey
public <V> MutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
- Specified by:
groupByUniqueKeyin interfaceMutableStack<T>- Specified by:
groupByUniqueKeyin interfaceRichIterable<T>
-
groupByUniqueKey
public <V,R extends MutableMapIterable<V,T>> R groupByUniqueKey(Function<? super T,? extends V> function, R target)
- Specified by:
groupByUniqueKeyin interfaceRichIterable<T>
-
chunk
public RichIterable<RichIterable<T>> chunk(int size)
- Specified by:
chunkin interfaceRichIterable<T>
-
tap
public MutableStack<T> tap(Procedure<? super T> procedure)
- Specified by:
tapin interfaceMutableStack<T>- Specified by:
tapin interfaceOrderedIterable<T>- Specified by:
tapin interfaceRichIterable<T>- Specified by:
tapin interfaceStackIterable<T>
-
each
public void each(Procedure<? super T> procedure)
- Specified by:
eachin interfaceRichIterable<T>
-
toString
public String toString()
- Specified by:
toStringin interfaceRichIterable<T>- Specified by:
toStringin interfaceStackIterable<T>- Overrides:
toStringin classObject
-
forEachWithIndex
public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
- Specified by:
forEachWithIndexin interfaceInternalIterable<T>- Specified by:
forEachWithIndexin interfaceOrderedIterable<T>
-
forEachWith
public <P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
- Specified by:
forEachWithin interfaceInternalIterable<T>
-
asUnmodifiable
public MutableStack<T> asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableStack<T>
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceStackIterable<T>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceStackIterable<T>- Overrides:
hashCodein classObject
-
asSynchronized
public MutableStack<T> asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableStack<T>
-
aggregateInPlaceBy
public <K,V> MutableMap<K,V> aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
- Specified by:
aggregateInPlaceByin interfaceMutableStack<T>- Specified by:
aggregateInPlaceByin interfaceRichIterable<T>
-
aggregateBy
public <K,V> MutableMap<K,V> aggregateBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator)
- Specified by:
aggregateByin interfaceMutableStack<T>- Specified by:
aggregateByin interfaceRichIterable<T>
-
reduceBy
public <K> MutableMap<K,T> reduceBy(Function<? super T,? extends K> groupBy, Function2<? super T,? super T,? extends T> reduceFunction)
- Specified by:
reduceByin interfaceMutableStack<T>- Specified by:
reduceByin interfaceRichIterable<T>
-
takeWhile
public MutableStack<T> takeWhile(Predicate<? super T> predicate)
- Specified by:
takeWhilein interfaceMutableStack<T>- Specified by:
takeWhilein interfaceOrderedIterable<T>- Specified by:
takeWhilein interfaceStackIterable<T>
-
dropWhile
public MutableStack<T> dropWhile(Predicate<? super T> predicate)
- Specified by:
dropWhilein interfaceMutableStack<T>- Specified by:
dropWhilein interfaceOrderedIterable<T>- Specified by:
dropWhilein interfaceStackIterable<T>
-
partitionWhile
public PartitionMutableStack<T> partitionWhile(Predicate<? super T> predicate)
- Specified by:
partitionWhilein interfaceMutableStack<T>- Specified by:
partitionWhilein interfaceOrderedIterable<T>- Specified by:
partitionWhilein interfaceStackIterable<T>
-
distinct
public MutableStack<T> distinct()
- Specified by:
distinctin interfaceMutableStack<T>- Specified by:
distinctin interfaceOrderedIterable<T>- Specified by:
distinctin interfaceStackIterable<T>
-
collectWithIndex
public <V> MutableStack<V> collectWithIndex(ObjectIntToObjectFunction<? super T,? extends V> function)
- Specified by:
collectWithIndexin interfaceMutableStack<T>- Specified by:
collectWithIndexin interfaceOrderedIterable<T>- Specified by:
collectWithIndexin interfaceStackIterable<T>
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(ObjectIntToObjectFunction<? super T,? extends V> function, R target)
- Specified by:
collectWithIndexin interfaceOrderedIterable<T>- Since:
- 9.1
-
selectWithIndex
public <R extends Collection<T>> R selectWithIndex(ObjectIntPredicate<? super T> predicate, R target)
- Specified by:
selectWithIndexin interfaceOrderedIterable<T>- Since:
- 11.0
-
rejectWithIndex
public <R extends Collection<T>> R rejectWithIndex(ObjectIntPredicate<? super T> predicate, R target)
- Specified by:
rejectWithIndexin interfaceOrderedIterable<T>- Since:
- 11.0
-
indexOf
public int indexOf(Object object)
- Specified by:
indexOfin interfaceOrderedIterable<T>
-
corresponds
public <S> boolean corresponds(OrderedIterable<S> other, Predicate2<? super T,? super S> predicate)
- Specified by:
correspondsin interfaceOrderedIterable<T>
-
forEach
public void forEach(int startIndex, int endIndex, Procedure<? super T> procedure)- Specified by:
forEachin interfaceOrderedIterable<T>
-
forEachWithIndex
public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)- Specified by:
forEachWithIndexin interfaceOrderedIterable<T>
-
detectIndex
public int detectIndex(Predicate<? super T> predicate)
- Specified by:
detectIndexin interfaceOrderedIterable<T>
-
-