Package org.eclipse.collections.impl.bag
Class AbstractBag<T>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.bag.AbstractBag<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Bag<T>,InternalIterable<T>,RichIterable<T>
- Direct Known Subclasses:
AbstractImmutableBagIterable,AbstractMutableBagIterable
public abstract class AbstractBag<T> extends AbstractRichIterable<T> implements Collection<T>, Bag<T>
- Since:
- 7.0
-
-
Constructor Summary
Constructors Constructor Description AbstractBag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V,R extends Collection<V>>
Rcollect(Function<? super T,? extends V> function, R target)<R extends MutableBooleanCollection>
RcollectBoolean(BooleanFunction<? super T> booleanFunction, R target)<R extends MutableByteCollection>
RcollectByte(ByteFunction<? super T> byteFunction, R target)<R extends MutableCharCollection>
RcollectChar(CharFunction<? super T> charFunction, R target)<R extends MutableDoubleCollection>
RcollectDouble(DoubleFunction<? super T> doubleFunction, R target)<R extends MutableFloatCollection>
RcollectFloat(FloatFunction<? super T> floatFunction, R target)<V,R extends Collection<V>>
RcollectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function, R target)<R extends MutableIntCollection>
RcollectInt(IntFunction<? super T> intFunction, R target)<R extends MutableLongCollection>
RcollectLong(LongFunction<? super T> longFunction, R target)<R extends MutableShortCollection>
RcollectShort(ShortFunction<? super T> shortFunction, R target)<P,V,R extends Collection<V>>
RcollectWith(Function2<? super T,? super P,? extends V> function, P parameter, R target)intcount(Predicate<? super T> predicate)<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)<V,R extends MutableMultimap<V,T>>
RgroupBy(Function<? super T,? extends V> function, R target)<V,R extends MutableMultimap<V,T>>
RgroupByEach(Function<? super T,? extends Iterable<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)<IV,P>
IVinjectIntoWith(IV injectedValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)<R extends Collection<T>>
Rreject(Predicate<? super T> predicate, R target)<P,R extends Collection<T>>
RrejectWith(Predicate2<? super T,? super P> predicate, P parameter, R target)<R extends Collection<T>>
Rselect(Predicate<? super T> predicate, R target)<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)MutableBag<T>toBag()MutableList<T>toList()MutableSet<T>toSet()MutableSortedBag<T>toSortedBag()MutableSortedBag<T>toSortedBag(Comparator<? super T> comparator)MutableList<T>toSortedList(Comparator<? super T> comparator)MutableSortedSet<T>toSortedSet()MutableSortedSet<T>toSortedSet(Comparator<? super T> comparator)StringtoStringOfItemToCount()-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asLazy, contains, containsAll, containsAllArguments, containsAllIterable, countByEach, countWith, detect, detectOptional, detectWith, detectWithIfNone, detectWithOptional, forEach, forEachWith, forEachWithIndex, groupByUniqueKey, into, isEmpty, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, allSatisfyWithOccurrences, anySatisfyWithOccurrences, bottomOccurrences, collectWithOccurrences, collectWithOccurrences, detectWithOccurrences, distinctView, equals, forEachWithOccurrences, groupBy, groupByEach, hashCode, noneSatisfyWithOccurrences, occurrencesOf, partition, partitionWith, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectByOccurrences, selectDuplicates, selectInstancesOf, selectUnique, selectWith, sizeDistinct, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, tap, toImmutable, toMapOfItemToCount, topOccurrences, zipWithIndex
-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, countBy, countBy, countByEach, countByEach, countByWith, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectWith, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupByAndCollect, groupByUniqueKey, groupByUniqueKey, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, size, sumByDouble, sumByFloat, sumByInt, sumByLong, toArray, toArray, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toMap, toMap, toSortedBagBy, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zip, zipWithIndex
-
-
-
-
Method Detail
-
select
public <R extends Collection<T>> R select(Predicate<? super T> predicate, R target)
- Specified by:
selectin interfaceRichIterable<T>- Overrides:
selectin classAbstractRichIterable<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>- Overrides:
selectWithin classAbstractRichIterable<T>
-
reject
public <R extends Collection<T>> R reject(Predicate<? super T> predicate, R target)
- Specified by:
rejectin interfaceRichIterable<T>- Overrides:
rejectin classAbstractRichIterable<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>- Overrides:
rejectWithin classAbstractRichIterable<T>
-
count
public int count(Predicate<? super T> predicate)
- Specified by:
countin interfaceRichIterable<T>- Overrides:
countin classAbstractRichIterable<T>
-
collect
public <V,R extends Collection<V>> R collect(Function<? super T,? extends V> function, R target)
- Specified by:
collectin interfaceRichIterable<T>- Overrides:
collectin classAbstractRichIterable<T>
-
collectWith
public <P,V,R extends Collection<V>> R collectWith(Function2<? super T,? super P,? extends V> function, P parameter, R target)
- Specified by:
collectWithin interfaceRichIterable<T>- Overrides:
collectWithin classAbstractRichIterable<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>- Overrides:
collectIfin classAbstractRichIterable<T>
-
flatCollect
public <V,R extends Collection<V>> R flatCollect(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
flatCollectin interfaceRichIterable<T>- Overrides:
flatCollectin classAbstractRichIterable<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 <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 <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 <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 <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 <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 <R extends MutableLongCollection> R collectLong(LongFunction<? super T> longFunction, R target)
- Specified by:
collectLongin interfaceRichIterable<T>
-
flatCollectLong
public <R extends MutableLongCollection> R flatCollectLong(Function<? super T,? extends LongIterable> function, R target)
- Specified by:
flatCollectLongin interfaceRichIterable<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>
-
groupBy
public <V,R extends MutableMultimap<V,T>> R groupBy(Function<? super T,? extends V> function, R target)
- Specified by:
groupByin interfaceRichIterable<T>- Overrides:
groupByin classAbstractRichIterable<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>- Overrides:
groupByEachin classAbstractRichIterable<T>
-
sumOfInt
public long sumOfInt(IntFunction<? super T> function)
- Specified by:
sumOfIntin interfaceRichIterable<T>- Overrides:
sumOfIntin classAbstractRichIterable<T>
-
sumOfFloat
public double sumOfFloat(FloatFunction<? super T> function)
- Specified by:
sumOfFloatin interfaceRichIterable<T>- Overrides:
sumOfFloatin classAbstractRichIterable<T>
-
sumOfLong
public long sumOfLong(LongFunction<? super T> function)
- Specified by:
sumOfLongin interfaceRichIterable<T>- Overrides:
sumOfLongin classAbstractRichIterable<T>
-
sumOfDouble
public double sumOfDouble(DoubleFunction<? super T> function)
- Specified by:
sumOfDoublein interfaceRichIterable<T>- Overrides:
sumOfDoublein classAbstractRichIterable<T>
-
injectInto
public <IV> IV injectInto(IV injectedValue, Function2<? super IV,? super T,? extends IV> function)- Specified by:
injectIntoin interfaceRichIterable<T>- Overrides:
injectIntoin classAbstractRichIterable<T>
-
injectInto
public int injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)- Specified by:
injectIntoin interfaceRichIterable<T>- Overrides:
injectIntoin classAbstractRichIterable<T>
-
injectInto
public long injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)- Specified by:
injectIntoin interfaceRichIterable<T>- Overrides:
injectIntoin classAbstractRichIterable<T>
-
injectInto
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)- Specified by:
injectIntoin interfaceRichIterable<T>- Overrides:
injectIntoin classAbstractRichIterable<T>
-
injectInto
public float injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)- Specified by:
injectIntoin interfaceRichIterable<T>- Overrides:
injectIntoin classAbstractRichIterable<T>
-
injectIntoWith
public <IV,P> IV injectIntoWith(IV injectedValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)
-
toStringOfItemToCount
public String toStringOfItemToCount()
- Specified by:
toStringOfItemToCountin interfaceBag<T>
-
toList
public MutableList<T> toList()
- Specified by:
toListin interfaceRichIterable<T>- Overrides:
toListin classAbstractRichIterable<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>- Overrides:
toSetin classAbstractRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet()
- Specified by:
toSortedSetin interfaceRichIterable<T>- Overrides:
toSortedSetin classAbstractRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet(Comparator<? super T> comparator)
- Specified by:
toSortedSetin interfaceRichIterable<T>- Overrides:
toSortedSetin classAbstractRichIterable<T>
-
toBag
public MutableBag<T> toBag()
- Specified by:
toBagin interfaceRichIterable<T>- Overrides:
toBagin classAbstractRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag()
- Specified by:
toSortedBagin interfaceRichIterable<T>- Overrides:
toSortedBagin classAbstractRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag(Comparator<? super T> comparator)
- Specified by:
toSortedBagin interfaceRichIterable<T>- Overrides:
toSortedBagin classAbstractRichIterable<T>
-
-