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)
int
count(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)
double
injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)
float
injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)
int
injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)
long
injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)
<IV> IV
injectInto(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)
double
sumOfDouble(DoubleFunction<? super T> function)
double
sumOfFloat(FloatFunction<? super T> function)
long
sumOfInt(IntFunction<? super T> function)
long
sumOfLong(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)
String
toStringOfItemToCount()
-
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:
select
in interfaceRichIterable<T>
- Overrides:
select
in classAbstractRichIterable<T>
-
selectWith
public <P,R extends Collection<T>> R selectWith(Predicate2<? super T,? super P> predicate, P parameter, R target)
- Specified by:
selectWith
in interfaceRichIterable<T>
- Overrides:
selectWith
in classAbstractRichIterable<T>
-
reject
public <R extends Collection<T>> R reject(Predicate<? super T> predicate, R target)
- Specified by:
reject
in interfaceRichIterable<T>
- Overrides:
reject
in classAbstractRichIterable<T>
-
rejectWith
public <P,R extends Collection<T>> R rejectWith(Predicate2<? super T,? super P> predicate, P parameter, R target)
- Specified by:
rejectWith
in interfaceRichIterable<T>
- Overrides:
rejectWith
in classAbstractRichIterable<T>
-
count
public int count(Predicate<? super T> predicate)
- Specified by:
count
in interfaceRichIterable<T>
- Overrides:
count
in classAbstractRichIterable<T>
-
collect
public <V,R extends Collection<V>> R collect(Function<? super T,? extends V> function, R target)
- Specified by:
collect
in interfaceRichIterable<T>
- Overrides:
collect
in 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:
collectWith
in interfaceRichIterable<T>
- Overrides:
collectWith
in 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:
collectIf
in interfaceRichIterable<T>
- Overrides:
collectIf
in classAbstractRichIterable<T>
-
flatCollect
public <V,R extends Collection<V>> R flatCollect(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
flatCollect
in interfaceRichIterable<T>
- Overrides:
flatCollect
in classAbstractRichIterable<T>
-
collectBoolean
public <R extends MutableBooleanCollection> R collectBoolean(BooleanFunction<? super T> booleanFunction, R target)
- Specified by:
collectBoolean
in interfaceRichIterable<T>
-
flatCollectBoolean
public <R extends MutableBooleanCollection> R flatCollectBoolean(Function<? super T,? extends BooleanIterable> function, R target)
- Specified by:
flatCollectBoolean
in interfaceRichIterable<T>
-
collectByte
public <R extends MutableByteCollection> R collectByte(ByteFunction<? super T> byteFunction, R target)
- Specified by:
collectByte
in interfaceRichIterable<T>
-
flatCollectByte
public <R extends MutableByteCollection> R flatCollectByte(Function<? super T,? extends ByteIterable> function, R target)
- Specified by:
flatCollectByte
in interfaceRichIterable<T>
-
collectChar
public <R extends MutableCharCollection> R collectChar(CharFunction<? super T> charFunction, R target)
- Specified by:
collectChar
in interfaceRichIterable<T>
-
flatCollectChar
public <R extends MutableCharCollection> R flatCollectChar(Function<? super T,? extends CharIterable> function, R target)
- Specified by:
flatCollectChar
in interfaceRichIterable<T>
-
collectDouble
public <R extends MutableDoubleCollection> R collectDouble(DoubleFunction<? super T> doubleFunction, R target)
- Specified by:
collectDouble
in interfaceRichIterable<T>
-
flatCollectDouble
public <R extends MutableDoubleCollection> R flatCollectDouble(Function<? super T,? extends DoubleIterable> function, R target)
- Specified by:
flatCollectDouble
in interfaceRichIterable<T>
-
collectFloat
public <R extends MutableFloatCollection> R collectFloat(FloatFunction<? super T> floatFunction, R target)
- Specified by:
collectFloat
in interfaceRichIterable<T>
-
flatCollectFloat
public <R extends MutableFloatCollection> R flatCollectFloat(Function<? super T,? extends FloatIterable> function, R target)
- Specified by:
flatCollectFloat
in interfaceRichIterable<T>
-
collectInt
public <R extends MutableIntCollection> R collectInt(IntFunction<? super T> intFunction, R target)
- Specified by:
collectInt
in interfaceRichIterable<T>
-
flatCollectInt
public <R extends MutableIntCollection> R flatCollectInt(Function<? super T,? extends IntIterable> function, R target)
- Specified by:
flatCollectInt
in interfaceRichIterable<T>
-
collectLong
public <R extends MutableLongCollection> R collectLong(LongFunction<? super T> longFunction, R target)
- Specified by:
collectLong
in interfaceRichIterable<T>
-
flatCollectLong
public <R extends MutableLongCollection> R flatCollectLong(Function<? super T,? extends LongIterable> function, R target)
- Specified by:
flatCollectLong
in interfaceRichIterable<T>
-
collectShort
public <R extends MutableShortCollection> R collectShort(ShortFunction<? super T> shortFunction, R target)
- Specified by:
collectShort
in interfaceRichIterable<T>
-
flatCollectShort
public <R extends MutableShortCollection> R flatCollectShort(Function<? super T,? extends ShortIterable> function, R target)
- Specified by:
flatCollectShort
in interfaceRichIterable<T>
-
groupBy
public <V,R extends MutableMultimap<V,T>> R groupBy(Function<? super T,? extends V> function, R target)
- Specified by:
groupBy
in interfaceRichIterable<T>
- Overrides:
groupBy
in classAbstractRichIterable<T>
-
groupByEach
public <V,R extends MutableMultimap<V,T>> R groupByEach(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
groupByEach
in interfaceRichIterable<T>
- Overrides:
groupByEach
in classAbstractRichIterable<T>
-
sumOfInt
public long sumOfInt(IntFunction<? super T> function)
- Specified by:
sumOfInt
in interfaceRichIterable<T>
- Overrides:
sumOfInt
in classAbstractRichIterable<T>
-
sumOfFloat
public double sumOfFloat(FloatFunction<? super T> function)
- Specified by:
sumOfFloat
in interfaceRichIterable<T>
- Overrides:
sumOfFloat
in classAbstractRichIterable<T>
-
sumOfLong
public long sumOfLong(LongFunction<? super T> function)
- Specified by:
sumOfLong
in interfaceRichIterable<T>
- Overrides:
sumOfLong
in classAbstractRichIterable<T>
-
sumOfDouble
public double sumOfDouble(DoubleFunction<? super T> function)
- Specified by:
sumOfDouble
in interfaceRichIterable<T>
- Overrides:
sumOfDouble
in classAbstractRichIterable<T>
-
injectInto
public <IV> IV injectInto(IV injectedValue, Function2<? super IV,? super T,? extends IV> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
- Overrides:
injectInto
in classAbstractRichIterable<T>
-
injectInto
public int injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
- Overrides:
injectInto
in classAbstractRichIterable<T>
-
injectInto
public long injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
- Overrides:
injectInto
in classAbstractRichIterable<T>
-
injectInto
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
- Overrides:
injectInto
in classAbstractRichIterable<T>
-
injectInto
public float injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
- Overrides:
injectInto
in 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:
toStringOfItemToCount
in interfaceBag<T>
-
toList
public MutableList<T> toList()
- Specified by:
toList
in interfaceRichIterable<T>
- Overrides:
toList
in classAbstractRichIterable<T>
-
toSortedList
public MutableList<T> toSortedList(Comparator<? super T> comparator)
- Specified by:
toSortedList
in interfaceRichIterable<T>
-
toSet
public MutableSet<T> toSet()
- Specified by:
toSet
in interfaceRichIterable<T>
- Overrides:
toSet
in classAbstractRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet()
- Specified by:
toSortedSet
in interfaceRichIterable<T>
- Overrides:
toSortedSet
in classAbstractRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet(Comparator<? super T> comparator)
- Specified by:
toSortedSet
in interfaceRichIterable<T>
- Overrides:
toSortedSet
in classAbstractRichIterable<T>
-
toBag
public MutableBag<T> toBag()
- Specified by:
toBag
in interfaceRichIterable<T>
- Overrides:
toBag
in classAbstractRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag()
- Specified by:
toSortedBag
in interfaceRichIterable<T>
- Overrides:
toSortedBag
in classAbstractRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag(Comparator<? super T> comparator)
- Specified by:
toSortedBag
in interfaceRichIterable<T>
- Overrides:
toSortedBag
in classAbstractRichIterable<T>
-
-