Class ImmutableArrayBag<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>
-
- org.eclipse.collections.impl.bag.immutable.ImmutableArrayBag<T>
-
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,Bag<T>,ImmutableBag<T>,ImmutableBagIterable<T>,UnsortedBag<T>,ImmutableCollection<T>,InternalIterable<T>,RichIterable<T>
public class ImmutableArrayBag<T> extends AbstractImmutableBag<T> implements Serializable
- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanallSatisfy(Predicate<? super T> predicate)<P> booleanallSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)booleanallSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)booleananySatisfy(Predicate<? super T> predicate)<P> booleananySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)booleananySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)<V> ImmutableBag<V>collect(Function<? super T,? extends V> function)<V> ImmutableBag<V>collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)static <T> ImmutableArrayBag<T>copyFrom(Bag<? extends T> bag)Tdetect(Predicate<? super T> predicate)Optional<T>detectOptional(Predicate<? super T> predicate)<P> TdetectWith(Predicate2<? super T,? super P> predicate, P parameter)TdetectWithOccurrences(ObjectIntPredicate<? super T> predicate)<P> Optional<T>detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)RichIterable<T>distinctView()voideach(Procedure<? super T> procedure)booleanequals(Object other)<V> ImmutableBag<V>flatCollect(Function<? super T,? extends Iterable<V>> function)voidforEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)TgetFirst()TgetLast()TgetOnly()<V> ImmutableBagMultimap<V,T>groupBy(Function<? super T,? extends V> function)<V> ImmutableBagMultimap<V,T>groupByEach(Function<? super T,? extends Iterable<V>> function)inthashCode()Iterator<T>iterator()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)static <T> ImmutableArrayBag<T>newBagWith(T... elements)ImmutableBag<T>newWith(T element)ImmutableBag<T>newWithAll(Iterable<? extends T> elements)ImmutableBag<T>newWithout(T element)booleannoneSatisfy(Predicate<? super T> predicate)<P> booleannoneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)booleannoneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)intoccurrencesOf(Object item)ImmutableBag<T>reject(Predicate<? super T> predicate)ImmutableBag<T>select(Predicate<? super T> predicate)ImmutableBag<T>selectByOccurrences(IntPredicate predicate)<S> ImmutableBag<S>selectInstancesOf(Class<S> clazz)intsize()intsizeDistinct()MutableMap<T,Integer>toMapOfItemToCount()<S> ImmutableBag<Pair<T,S>>zip(Iterable<S> that)Deprecated.in 6.0.ImmutableSet<Pair<T,Integer>>zipWithIndex()Deprecated.in 6.0.-
Methods inherited from class org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag
bottomOccurrences, chunk, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, collectWith, collectWithOccurrences, countBy, countByEach, countByWith, groupByUniqueKey, newWithoutAll, partition, partitionWith, rejectWith, selectWith, tap, toImmutable, topOccurrences
-
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
appendString, appendString, asLazy, contains, containsAll, containsAllArguments, containsAllIterable, countWith, detectWithIfNone, forEach, forEachWith, forEachWithIndex, groupByUniqueKey, into, isEmpty, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.bag.Bag
aggregateBy, collectWithOccurrences, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCount
-
Methods inherited from interface java.util.Collection
contains, containsAll, isEmpty, removeIf, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.bag.ImmutableBag
flatCollectWith, selectDuplicates, selectUnique, toImmutableBag
-
Methods inherited from interface org.eclipse.collections.api.bag.ImmutableBagIterable
selectDuplicates, selectUnique
-
Methods inherited from interface org.eclipse.collections.api.collection.ImmutableCollection
aggregateBy, aggregateInPlaceBy, castToCollection, flatCollectWith, parallelStream, spliterator, stream, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
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, detectIfNone, detectWithIfNone, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, notEmpty, reduce, reject, rejectWith, select, selectWith, 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
-
newBagWith
public static <T> ImmutableArrayBag<T> newBagWith(T... elements)
-
copyFrom
public static <T> ImmutableArrayBag<T> copyFrom(Bag<? extends T> bag)
-
forEachWithOccurrences
public void forEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)
- Specified by:
forEachWithOccurrencesin interfaceBag<T>
-
anySatisfyWithOccurrences
public boolean anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
anySatisfyWithOccurrencesin interfaceBag<T>
-
allSatisfyWithOccurrences
public boolean allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
allSatisfyWithOccurrencesin interfaceBag<T>
-
noneSatisfyWithOccurrences
public boolean noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
noneSatisfyWithOccurrencesin interfaceBag<T>
-
detectWithOccurrences
public T detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
detectWithOccurrencesin interfaceBag<T>
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinctin interfaceBag<T>
-
size
public int size()
- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceRichIterable<T>
-
occurrencesOf
public int occurrencesOf(Object item)
- Specified by:
occurrencesOfin interfaceBag<T>
-
newWith
public ImmutableBag<T> newWith(T element)
- Specified by:
newWithin interfaceImmutableBag<T>- Specified by:
newWithin interfaceImmutableCollection<T>
-
newWithout
public ImmutableBag<T> newWithout(T element)
- Specified by:
newWithoutin interfaceImmutableBag<T>- Specified by:
newWithoutin interfaceImmutableCollection<T>
-
toMapOfItemToCount
public MutableMap<T,Integer> toMapOfItemToCount()
- Specified by:
toMapOfItemToCountin interfaceBag<T>- Specified by:
toMapOfItemToCountin interfaceImmutableBagIterable<T>
-
newWithAll
public ImmutableBag<T> newWithAll(Iterable<? extends T> elements)
- Specified by:
newWithAllin interfaceImmutableBag<T>- Specified by:
newWithAllin interfaceImmutableCollection<T>
-
selectByOccurrences
public ImmutableBag<T> selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceBag<T>- Specified by:
selectByOccurrencesin interfaceImmutableBag<T>- Specified by:
selectByOccurrencesin interfaceImmutableBagIterable<T>- Specified by:
selectByOccurrencesin interfaceUnsortedBag<T>
-
selectInstancesOf
public <S> ImmutableBag<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOfin interfaceBag<T>- Specified by:
selectInstancesOfin interfaceImmutableBag<T>- Specified by:
selectInstancesOfin interfaceImmutableBagIterable<T>- Specified by:
selectInstancesOfin interfaceImmutableCollection<T>- Specified by:
selectInstancesOfin interfaceRichIterable<T>- Specified by:
selectInstancesOfin interfaceUnsortedBag<T>
-
groupBy
public <V> ImmutableBagMultimap<V,T> groupBy(Function<? super T,? extends V> function)
- Specified by:
groupByin interfaceBag<T>- Specified by:
groupByin interfaceImmutableBag<T>- Specified by:
groupByin interfaceImmutableBagIterable<T>- Specified by:
groupByin interfaceImmutableCollection<T>- Specified by:
groupByin interfaceRichIterable<T>- Specified by:
groupByin interfaceUnsortedBag<T>
-
groupByEach
public <V> ImmutableBagMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
groupByEachin interfaceBag<T>- Specified by:
groupByEachin interfaceImmutableBag<T>- Specified by:
groupByEachin interfaceImmutableBagIterable<T>- Specified by:
groupByEachin interfaceImmutableCollection<T>- Specified by:
groupByEachin interfaceRichIterable<T>- Specified by:
groupByEachin interfaceUnsortedBag<T>
-
getFirst
public T getFirst()
- Specified by:
getFirstin interfaceRichIterable<T>
-
getLast
public T getLast()
- Specified by:
getLastin interfaceRichIterable<T>
-
getOnly
public T getOnly()
- Specified by:
getOnlyin interfaceRichIterable<T>
-
select
public ImmutableBag<T> select(Predicate<? super T> predicate)
- Specified by:
selectin interfaceBag<T>- Specified by:
selectin interfaceImmutableBag<T>- Specified by:
selectin interfaceImmutableBagIterable<T>- Specified by:
selectin interfaceImmutableCollection<T>- Specified by:
selectin interfaceRichIterable<T>- Specified by:
selectin interfaceUnsortedBag<T>
-
reject
public ImmutableBag<T> reject(Predicate<? super T> predicate)
- Specified by:
rejectin interfaceBag<T>- Specified by:
rejectin interfaceImmutableBag<T>- Specified by:
rejectin interfaceImmutableBagIterable<T>- Specified by:
rejectin interfaceImmutableCollection<T>- Specified by:
rejectin interfaceRichIterable<T>- Specified by:
rejectin interfaceUnsortedBag<T>
-
collect
public <V> ImmutableBag<V> collect(Function<? super T,? extends V> function)
- Specified by:
collectin interfaceImmutableBag<T>- Specified by:
collectin interfaceImmutableCollection<T>- Specified by:
collectin interfaceRichIterable<T>- Specified by:
collectin interfaceUnsortedBag<T>
-
collectIf
public <V> ImmutableBag<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
- Specified by:
collectIfin interfaceImmutableBag<T>- Specified by:
collectIfin interfaceImmutableCollection<T>- Specified by:
collectIfin interfaceRichIterable<T>- Specified by:
collectIfin interfaceUnsortedBag<T>
-
flatCollect
public <V> ImmutableBag<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
- Specified by:
flatCollectin interfaceImmutableBag<T>- Specified by:
flatCollectin interfaceImmutableCollection<T>- Specified by:
flatCollectin interfaceRichIterable<T>- Specified by:
flatCollectin interfaceUnsortedBag<T>
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
each
public void each(Procedure<? super T> procedure)
- Specified by:
eachin interfaceRichIterable<T>
-
anySatisfy
public boolean anySatisfy(Predicate<? super T> predicate)
- Specified by:
anySatisfyin interfaceRichIterable<T>- Overrides:
anySatisfyin classAbstractRichIterable<T>
-
anySatisfyWith
public <P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
anySatisfyWithin interfaceRichIterable<T>- Overrides:
anySatisfyWithin classAbstractRichIterable<T>
-
allSatisfy
public boolean allSatisfy(Predicate<? super T> predicate)
- Specified by:
allSatisfyin interfaceRichIterable<T>- Overrides:
allSatisfyin classAbstractRichIterable<T>
-
allSatisfyWith
public <P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
allSatisfyWithin interfaceRichIterable<T>- Overrides:
allSatisfyWithin classAbstractRichIterable<T>
-
noneSatisfy
public boolean noneSatisfy(Predicate<? super T> predicate)
- Specified by:
noneSatisfyin interfaceRichIterable<T>- Overrides:
noneSatisfyin classAbstractRichIterable<T>
-
noneSatisfyWith
public <P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
noneSatisfyWithin interfaceRichIterable<T>- Overrides:
noneSatisfyWithin classAbstractRichIterable<T>
-
detect
public T detect(Predicate<? super T> predicate)
- Specified by:
detectin interfaceRichIterable<T>- Overrides:
detectin classAbstractRichIterable<T>
-
detectWith
public <P> T detectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithin interfaceRichIterable<T>- Overrides:
detectWithin classAbstractRichIterable<T>
-
detectOptional
public Optional<T> detectOptional(Predicate<? super T> predicate)
- Specified by:
detectOptionalin interfaceRichIterable<T>- Overrides:
detectOptionalin classAbstractRichIterable<T>
-
detectWithOptional
public <P> Optional<T> detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithOptionalin interfaceRichIterable<T>- Overrides:
detectWithOptionalin classAbstractRichIterable<T>
-
min
public T min(Comparator<? super T> comparator)
- Specified by:
minin interfaceRichIterable<T>- Overrides:
minin classAbstractRichIterable<T>
-
max
public T max(Comparator<? super T> comparator)
- Specified by:
maxin interfaceRichIterable<T>- Overrides:
maxin classAbstractRichIterable<T>
-
min
public T min()
- Specified by:
minin interfaceRichIterable<T>- Overrides:
minin classAbstractRichIterable<T>
-
max
public T max()
- Specified by:
maxin interfaceRichIterable<T>- Overrides:
maxin classAbstractRichIterable<T>
-
minBy
public <V extends Comparable<? super V>> T minBy(Function<? super T,? extends V> function)
- Specified by:
minByin interfaceRichIterable<T>- Overrides:
minByin classAbstractRichIterable<T>
-
maxBy
public <V extends Comparable<? super V>> T maxBy(Function<? super T,? extends V> function)
- Specified by:
maxByin interfaceRichIterable<T>- Overrides:
maxByin classAbstractRichIterable<T>
-
zip
@Deprecated public <S> ImmutableBag<Pair<T,S>> zip(Iterable<S> that)
Deprecated.in 6.0. UseOrderedIterable.zip(Iterable)instead.- Specified by:
zipin interfaceImmutableBag<T>- Specified by:
zipin interfaceImmutableCollection<T>- Specified by:
zipin interfaceRichIterable<T>- Specified by:
zipin interfaceUnsortedBag<T>
-
zipWithIndex
@Deprecated public ImmutableSet<Pair<T,Integer>> zipWithIndex()
Deprecated.in 6.0. UseOrderedIterable.zipWithIndex()instead.- Specified by:
zipWithIndexin interfaceBag<T>- Specified by:
zipWithIndexin interfaceImmutableBag<T>- Specified by:
zipWithIndexin interfaceImmutableBagIterable<T>- Specified by:
zipWithIndexin interfaceImmutableCollection<T>- Specified by:
zipWithIndexin interfaceRichIterable<T>- Specified by:
zipWithIndexin interfaceUnsortedBag<T>
-
distinctView
public RichIterable<T> distinctView()
- Specified by:
distinctViewin interfaceBag<T>
-
-