Class AbstractImmutableBag<T>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.bag.AbstractBag<T>
-
- org.eclipse.collections.impl.bag.immutable.AbstractImmutableBagIterable<T>
-
- org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag<T>
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Bag<T>
,ImmutableBag<T>
,ImmutableBagIterable<T>
,UnsortedBag<T>
,ImmutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
- Direct Known Subclasses:
ImmutableArrayBag
,ImmutableHashBag
public abstract class AbstractImmutableBag<T> extends AbstractImmutableBagIterable<T> implements ImmutableBag<T>
- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description AbstractImmutableBag()
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.bag.immutable.AbstractImmutableBagIterable
add, addAll, castToCollection, clear, parallelStream, remove, removeAll, retainAll, spliterator, stream, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from class org.eclipse.collections.impl.bag.AbstractBag
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, count, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toList, toSet, toSortedBag, toSortedBag, toSortedList, toSortedSet, toSortedSet, toStringOfItemToCount
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asLazy, contains, containsAll, containsAllArguments, containsAllIterable, 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, collectWithOccurrences, detectWithOccurrences, distinctView, equals, forEachWithOccurrences, hashCode, noneSatisfyWithOccurrences, occurrencesOf, reduceInPlace, reduceInPlace, sizeDistinct, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, iterator, removeIf, size, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.bag.ImmutableBag
collect, collectIf, flatCollect, flatCollectWith, groupBy, groupByEach, newWith, newWithAll, newWithout, reject, select, selectByOccurrences, selectDuplicates, selectInstancesOf, selectUnique, toImmutableBag, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.bag.ImmutableBagIterable
groupBy, groupByEach, reject, select, selectByOccurrences, selectDuplicates, selectInstancesOf, selectUnique, toMapOfItemToCount, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.collection.ImmutableCollection
aggregateBy, aggregateInPlaceBy, castToCollection, collect, collectIf, flatCollect, flatCollectWith, parallelStream, spliterator, stream, sumByDouble, sumByFloat, sumByInt, sumByLong, zip
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, 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, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
-
-
-
Method Detail
-
newWithoutAll
public ImmutableBag<T> newWithoutAll(Iterable<? extends T> elements)
- Specified by:
newWithoutAll
in interfaceImmutableBag<T>
- Specified by:
newWithoutAll
in interfaceImmutableCollection<T>
-
toImmutable
public ImmutableBag<T> toImmutable()
- Specified by:
toImmutable
in interfaceBag<T>
-
tap
public ImmutableBag<T> tap(Procedure<? super T> procedure)
- Specified by:
tap
in interfaceBag<T>
- Specified by:
tap
in interfaceImmutableBag<T>
- Specified by:
tap
in interfaceImmutableBagIterable<T>
- Specified by:
tap
in interfaceImmutableCollection<T>
- Specified by:
tap
in interfaceRichIterable<T>
- Specified by:
tap
in interfaceUnsortedBag<T>
-
selectWith
public <P> ImmutableBag<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectWith
in interfaceBag<T>
- Specified by:
selectWith
in interfaceImmutableBag<T>
- Specified by:
selectWith
in interfaceImmutableBagIterable<T>
- Specified by:
selectWith
in interfaceImmutableCollection<T>
- Specified by:
selectWith
in interfaceRichIterable<T>
- Specified by:
selectWith
in interfaceUnsortedBag<T>
-
rejectWith
public <P> ImmutableBag<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
rejectWith
in interfaceBag<T>
- Specified by:
rejectWith
in interfaceImmutableBag<T>
- Specified by:
rejectWith
in interfaceImmutableBagIterable<T>
- Specified by:
rejectWith
in interfaceImmutableCollection<T>
- Specified by:
rejectWith
in interfaceRichIterable<T>
- Specified by:
rejectWith
in interfaceUnsortedBag<T>
-
partition
public PartitionImmutableBag<T> partition(Predicate<? super T> predicate)
- Specified by:
partition
in interfaceBag<T>
- Specified by:
partition
in interfaceImmutableBag<T>
- Specified by:
partition
in interfaceImmutableBagIterable<T>
- Specified by:
partition
in interfaceImmutableCollection<T>
- Specified by:
partition
in interfaceRichIterable<T>
- Specified by:
partition
in interfaceUnsortedBag<T>
-
partitionWith
public <P> PartitionImmutableBag<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
partitionWith
in interfaceBag<T>
- Specified by:
partitionWith
in interfaceImmutableBag<T>
- Specified by:
partitionWith
in interfaceImmutableBagIterable<T>
- Specified by:
partitionWith
in interfaceImmutableCollection<T>
- Specified by:
partitionWith
in interfaceRichIterable<T>
-
countBy
public <V> ImmutableBag<V> countBy(Function<? super T,? extends V> function)
- Specified by:
countBy
in interfaceImmutableBag<T>
- Specified by:
countBy
in interfaceImmutableCollection<T>
- Specified by:
countBy
in interfaceRichIterable<T>
- Overrides:
countBy
in classAbstractImmutableBagIterable<T>
- Since:
- 9.0
-
countByWith
public <V,P> ImmutableBag<V> countByWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
countByWith
in interfaceImmutableBag<T>
- Specified by:
countByWith
in interfaceImmutableCollection<T>
- Specified by:
countByWith
in interfaceRichIterable<T>
- Overrides:
countByWith
in classAbstractImmutableBagIterable<T>
- Since:
- 9.0
-
countByEach
public <V> ImmutableBag<V> countByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
countByEach
in interfaceImmutableBag<T>
- Specified by:
countByEach
in interfaceImmutableCollection<T>
- Specified by:
countByEach
in interfaceRichIterable<T>
- Overrides:
countByEach
in classAbstractImmutableBagIterable<T>
- Since:
- 10.0.0
-
collectWithOccurrences
public <V> ImmutableBag<V> collectWithOccurrences(ObjectIntToObjectFunction<? super T,? extends V> function)
- Specified by:
collectWithOccurrences
in interfaceBag<T>
- Specified by:
collectWithOccurrences
in interfaceImmutableBag<T>
- Specified by:
collectWithOccurrences
in interfaceImmutableBagIterable<T>
- Specified by:
collectWithOccurrences
in interfaceUnsortedBag<T>
-
collectWith
public <P,V> ImmutableBag<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
collectWith
in interfaceImmutableBag<T>
- Specified by:
collectWith
in interfaceImmutableCollection<T>
- Specified by:
collectWith
in interfaceRichIterable<T>
- Specified by:
collectWith
in interfaceUnsortedBag<T>
-
collectBoolean
public ImmutableBooleanBag collectBoolean(BooleanFunction<? super T> booleanFunction)
- Specified by:
collectBoolean
in interfaceImmutableBag<T>
- Specified by:
collectBoolean
in interfaceImmutableCollection<T>
- Specified by:
collectBoolean
in interfaceRichIterable<T>
- Specified by:
collectBoolean
in interfaceUnsortedBag<T>
-
collectByte
public ImmutableByteBag collectByte(ByteFunction<? super T> byteFunction)
- Specified by:
collectByte
in interfaceImmutableBag<T>
- Specified by:
collectByte
in interfaceImmutableCollection<T>
- Specified by:
collectByte
in interfaceRichIterable<T>
- Specified by:
collectByte
in interfaceUnsortedBag<T>
-
collectChar
public ImmutableCharBag collectChar(CharFunction<? super T> charFunction)
- Specified by:
collectChar
in interfaceImmutableBag<T>
- Specified by:
collectChar
in interfaceImmutableCollection<T>
- Specified by:
collectChar
in interfaceRichIterable<T>
- Specified by:
collectChar
in interfaceUnsortedBag<T>
-
collectDouble
public ImmutableDoubleBag collectDouble(DoubleFunction<? super T> doubleFunction)
- Specified by:
collectDouble
in interfaceImmutableBag<T>
- Specified by:
collectDouble
in interfaceImmutableCollection<T>
- Specified by:
collectDouble
in interfaceRichIterable<T>
- Specified by:
collectDouble
in interfaceUnsortedBag<T>
-
collectFloat
public ImmutableFloatBag collectFloat(FloatFunction<? super T> floatFunction)
- Specified by:
collectFloat
in interfaceImmutableBag<T>
- Specified by:
collectFloat
in interfaceImmutableCollection<T>
- Specified by:
collectFloat
in interfaceRichIterable<T>
- Specified by:
collectFloat
in interfaceUnsortedBag<T>
-
collectInt
public ImmutableIntBag collectInt(IntFunction<? super T> intFunction)
- Specified by:
collectInt
in interfaceImmutableBag<T>
- Specified by:
collectInt
in interfaceImmutableCollection<T>
- Specified by:
collectInt
in interfaceRichIterable<T>
- Specified by:
collectInt
in interfaceUnsortedBag<T>
-
collectLong
public ImmutableLongBag collectLong(LongFunction<? super T> longFunction)
- Specified by:
collectLong
in interfaceImmutableBag<T>
- Specified by:
collectLong
in interfaceImmutableCollection<T>
- Specified by:
collectLong
in interfaceRichIterable<T>
- Specified by:
collectLong
in interfaceUnsortedBag<T>
-
collectShort
public ImmutableShortBag collectShort(ShortFunction<? super T> shortFunction)
- Specified by:
collectShort
in interfaceImmutableBag<T>
- Specified by:
collectShort
in interfaceImmutableCollection<T>
- Specified by:
collectShort
in interfaceRichIterable<T>
- Specified by:
collectShort
in interfaceUnsortedBag<T>
-
topOccurrences
public ImmutableList<ObjectIntPair<T>> topOccurrences(int n)
- Specified by:
topOccurrences
in interfaceBag<T>
- Specified by:
topOccurrences
in interfaceImmutableBag<T>
-
bottomOccurrences
public ImmutableList<ObjectIntPair<T>> bottomOccurrences(int n)
- Specified by:
bottomOccurrences
in interfaceBag<T>
- Specified by:
bottomOccurrences
in interfaceImmutableBag<T>
-
groupByUniqueKey
public <V> ImmutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
- Specified by:
groupByUniqueKey
in interfaceImmutableCollection<T>
- Specified by:
groupByUniqueKey
in interfaceRichIterable<T>
-
chunk
public RichIterable<RichIterable<T>> chunk(int size)
- Specified by:
chunk
in interfaceRichIterable<T>
-
-