Package org.eclipse.collections.impl
Class AbstractRichIterable<T>
java.lang.Object
org.eclipse.collections.impl.AbstractRichIterable<T>
- All Implemented Interfaces:
Iterable<T>,InternalIterable<T>,RichIterable<T>
- Direct Known Subclasses:
AbstractBag,AbstractImmutableCollection,AbstractLazyIterable,AbstractMapIterable,AbstractMutableCollection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallSatisfy(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, String separator) voidappendString(Appendable appendable, String start, String separator, String end) asLazy()<V,R extends Collection<V>>
R<V,R extends Collection<V>>
R<P,V, R extends Collection<V>>
RcollectWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target) booleanbooleancontainsAll(Collection<?> collection) booleancontainsAllArguments(Object... elements) booleancontainsAllIterable(Iterable<?> source) int<V> Bag<V>countByEach(Function<? super T, ? extends Iterable<V>> function) <P> intcountWith(Predicate2<? super T, ? super P> predicate, P parameter) 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) detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter) <V,R extends Collection<V>>
RflatCollect(Function<? super T, ? extends Iterable<V>> function, R target) final void<P> voidforEachWith(Procedure2<? super T, ? super P> procedure, P parameter) voidforEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) <V,R extends MutableMultimap<V, T>>
R<V,R extends MutableMultimap<V, T>>
RgroupByEach(Function<? super T, ? extends Iterable<V>> function, R target) <V,R extends MutableMapIterable<V, T>>
RgroupByUniqueKey(Function<? super T, ? extends V> function, R target) doubleinjectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function) floatinjectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function) intinjectInto(int injectedValue, IntObjectToIntFunction<? super T> function) longinjectInto(long injectedValue, LongObjectToLongFunction<? super T> function) <IV> IVinjectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function) <R extends Collection<T>>
Rinto(R target) booleanisEmpty()max()max(Comparator<? super T> comparator) <V extends Comparable<? super V>>
Tmin()min(Comparator<? super T> comparator) <V extends Comparable<? super V>>
TbooleannoneSatisfy(Predicate<? super T> predicate) <P> booleannoneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) <R extends Collection<T>>
R<P,R extends Collection<T>>
RrejectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target) <R extends Collection<T>>
R<P,R extends Collection<T>>
RselectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target) doublesumOfDouble(DoubleFunction<? super T> function) doublesumOfFloat(FloatFunction<? super T> function) longsumOfInt(IntFunction<? super T> function) longsumOfLong(LongFunction<? super T> function) toBag()<K,V> MutableBiMap<K, V> toList()<K,V> MutableMap<K, V> toSet()toSortedBag(Comparator<? super T> comparator) <V extends Comparable<? super V>>
MutableSortedBag<T>toSortedBagBy(Function<? super T, ? extends V> function) <V extends Comparable<? super V>>
MutableList<T>toSortedListBy(Function<? super T, ? extends V> function) <K,V> MutableSortedMap<K, V> toSortedMap(Comparator<? super K> comparator, Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) <K,V> MutableSortedMap<K, V> toSortedMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) <KK extends Comparable<? super KK>,NK, NV>
MutableSortedMap<NK,NV> toSortedMapBy(Function<? super NK, KK> sortBy, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) toSortedSet(Comparator<? super T> comparator) <V extends Comparable<? super V>>
MutableSortedSet<T>toSortedSetBy(Function<? super T, ? extends V> function) toString()Returns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.<S,R extends Collection<Pair<T, S>>>
R<R extends Collection<Pair<T,Integer>>>
RzipWithIndex(R target) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEachMethods inherited from interface java.lang.Iterable
iterator, spliteratorMethods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, aggregateBy, aggregateInPlaceBy, appendString, chunk, collect, collectBoolean, collectBoolean, collectByte, collectByte, collectChar, collectChar, collectDouble, collectDouble, collectFloat, collectFloat, collectIf, collectInt, collectInt, collectLong, collectLong, collectShort, collectShort, collectWith, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, countBy, countBy, countByEach, countByWith, countByWith, detectIfNone, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, flatCollectWith, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, makeString, makeString, makeString, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, notEmpty, partition, partitionWith, reduce, reduceBy, reduceBy, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectInstancesOf, selectWith, size, sumByDouble, sumByFloat, sumByInt, sumByLong, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, tap, toArray, toArray, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toMap, toSortedList, toSortedList, zip, zipWithIndex
-
Constructor Details
-
AbstractRichIterable
public AbstractRichIterable()
-
-
Method Details
-
contains
- Specified by:
containsin interfaceRichIterable<T>
-
containsAllIterable
- Specified by:
containsAllIterablein interfaceRichIterable<T>
-
containsAllArguments
- Specified by:
containsAllArgumentsin interfaceRichIterable<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceRichIterable<T>
-
toList
- Specified by:
toListin interfaceRichIterable<T>
-
toSortedListBy
public <V extends Comparable<? super V>> MutableList<T> toSortedListBy(Function<? super T, ? extends V> function) - Specified by:
toSortedListByin interfaceRichIterable<T>
-
toSortedSet
- Specified by:
toSortedSetin interfaceRichIterable<T>
-
toSortedSet
- Specified by:
toSortedSetin interfaceRichIterable<T>
-
toSortedSetBy
public <V extends Comparable<? super V>> MutableSortedSet<T> toSortedSetBy(Function<? super T, ? extends V> function) - Specified by:
toSortedSetByin interfaceRichIterable<T>
-
toSet
- Specified by:
toSetin interfaceRichIterable<T>
-
toBag
- Specified by:
toBagin interfaceRichIterable<T>
-
toSortedBag
- Specified by:
toSortedBagin interfaceRichIterable<T>
-
toSortedBag
- Specified by:
toSortedBagin interfaceRichIterable<T>
-
toSortedBagBy
public <V extends Comparable<? super V>> MutableSortedBag<T> toSortedBagBy(Function<? super T, ? extends V> function) - Specified by:
toSortedBagByin interfaceRichIterable<T>
-
toMap
public <K,V> MutableMap<K,V> toMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) - Specified by:
toMapin interfaceRichIterable<T>
-
toSortedMap
public <K,V> MutableSortedMap<K,V> toSortedMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) - Specified by:
toSortedMapin interfaceRichIterable<T>
-
toSortedMap
public <K,V> MutableSortedMap<K,V> toSortedMap(Comparator<? super K> comparator, Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) - Specified by:
toSortedMapin interfaceRichIterable<T>
-
toSortedMapBy
public <KK extends Comparable<? super KK>,NK, MutableSortedMap<NK,NV> NV> toSortedMapBy(Function<? super NK, KK> sortBy, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) - Specified by:
toSortedMapByin interfaceRichIterable<T>
-
toBiMap
public <K,V> MutableBiMap<K,V> toBiMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) - Specified by:
toBiMapin interfaceRichIterable<T>
-
select
- Specified by:
selectin interfaceRichIterable<T>
-
selectWith
public <P,R extends Collection<T>> R selectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target) - Specified by:
selectWithin interfaceRichIterable<T>
-
reject
- Specified by:
rejectin interfaceRichIterable<T>
-
rejectWith
public <P,R extends Collection<T>> R rejectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target) - Specified by:
rejectWithin interfaceRichIterable<T>
-
collect
- Specified by:
collectin interfaceRichIterable<T>
-
collectWith
public <P,V, R collectWithR extends Collection<V>> (Function2<? super T, ? super P, ? extends V> function, P parameter, R target) - Specified by:
collectWithin interfaceRichIterable<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>
-
detectWithIfNone
public <P> T detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function) - Specified by:
detectWithIfNonein interfaceRichIterable<T>
-
min
- Specified by:
minin interfaceRichIterable<T>
-
max
- Specified by:
maxin interfaceRichIterable<T>
-
min
- Specified by:
minin interfaceRichIterable<T>
-
max
- Specified by:
maxin interfaceRichIterable<T>
-
minBy
- Specified by:
minByin interfaceRichIterable<T>
-
maxBy
- Specified by:
maxByin interfaceRichIterable<T>
-
asLazy
- Specified by:
asLazyin interfaceRichIterable<T>
-
flatCollect
public <V,R extends Collection<V>> R flatCollect(Function<? super T, ? extends Iterable<V>> function, R target) - Specified by:
flatCollectin interfaceRichIterable<T>
-
detect
- Specified by:
detectin interfaceRichIterable<T>
-
detectWith
- Specified by:
detectWithin interfaceRichIterable<T>
-
detectOptional
- Specified by:
detectOptionalin interfaceRichIterable<T>
-
detectWithOptional
- Specified by:
detectWithOptionalin interfaceRichIterable<T>
-
anySatisfy
- Specified by:
anySatisfyin interfaceRichIterable<T>
-
allSatisfy
- Specified by:
allSatisfyin interfaceRichIterable<T>
-
noneSatisfy
- Specified by:
noneSatisfyin interfaceRichIterable<T>
-
anySatisfyWith
- Specified by:
anySatisfyWithin interfaceRichIterable<T>
-
allSatisfyWith
- Specified by:
allSatisfyWithin interfaceRichIterable<T>
-
noneSatisfyWith
- Specified by:
noneSatisfyWithin interfaceRichIterable<T>
-
count
- Specified by:
countin interfaceRichIterable<T>
-
countWith
- Specified by:
countWithin interfaceRichIterable<T>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<T>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<T>
-
into
- Specified by:
intoin interfaceRichIterable<T>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<T>
-
sumOfInt
- Specified by:
sumOfIntin interfaceRichIterable<T>
-
sumOfFloat
- Specified by:
sumOfFloatin interfaceRichIterable<T>
-
sumOfLong
- Specified by:
sumOfLongin interfaceRichIterable<T>
-
sumOfDouble
- Specified by:
sumOfDoublein interfaceRichIterable<T>
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceInternalIterable<T>
-
forEach
- Specified by:
forEachin interfaceInternalIterable<T>- Specified by:
forEachin interfaceRichIterable<T>
-
forEachWith
- Specified by:
forEachWithin interfaceInternalIterable<T>
-
zip
- Specified by:
zipin interfaceRichIterable<T>
-
zipWithIndex
- Specified by:
zipWithIndexin interfaceRichIterable<T>
-
toString
Returns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.Assert.assertEquals("[]", Lists.mutable.empty().toString()); Assert.assertEquals("[1]", Lists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", Lists.mutable.with(1, 2, 3).toString());- Specified by:
toStringin interfaceRichIterable<T>- Overrides:
toStringin classObject- Returns:
- a string representation of this collection.
- See Also:
-
appendString
- Specified by:
appendStringin interfaceRichIterable<T>
-
appendString
- Specified by:
appendStringin interfaceRichIterable<T>
-
containsAll
- Specified by:
containsAllin interfaceRichIterable<T>
-
countByEach
- Specified by:
countByEachin interfaceRichIterable<T>- Since:
- 10.0.0
-
groupBy
public <V,R extends MutableMultimap<V, R groupByT>> (Function<? super T, ? extends V> function, R target) - Specified by:
groupByin interfaceRichIterable<T>
-
groupByEach
public <V,R extends MutableMultimap<V, R groupByEachT>> (Function<? super T, ? extends Iterable<V>> function, R target) - Specified by:
groupByEachin interfaceRichIterable<T>
-
groupByUniqueKey
public <V,R extends MutableMapIterable<V, R groupByUniqueKeyT>> (Function<? super T, ? extends V> function, R target) - Specified by:
groupByUniqueKeyin interfaceRichIterable<T>
-