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 boolean
allSatisfy(Predicate<? super T> predicate)
<P> boolean
allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
boolean
anySatisfy(Predicate<? super T> predicate)
<P> boolean
anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
anySatisfyWithOccurrences(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)
T
detect(Predicate<? super T> predicate)
Optional<T>
detectOptional(Predicate<? super T> predicate)
<P> T
detectWith(Predicate2<? super T,? super P> predicate, P parameter)
T
detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
<P> Optional<T>
detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
RichIterable<T>
distinctView()
void
each(Procedure<? super T> procedure)
boolean
equals(Object other)
<V> ImmutableBag<V>
flatCollect(Function<? super T,? extends Iterable<V>> function)
void
forEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)
T
getFirst()
T
getLast()
T
getOnly()
<V> ImmutableBagMultimap<V,T>
groupBy(Function<? super T,? extends V> function)
<V> ImmutableBagMultimap<V,T>
groupByEach(Function<? super T,? extends Iterable<V>> function)
int
hashCode()
Iterator<T>
iterator()
T
max()
T
max(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
TmaxBy(Function<? super T,? extends V> function)
T
min()
T
min(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)
boolean
noneSatisfy(Predicate<? super T> predicate)
<P> boolean
noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
int
occurrencesOf(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)
int
size()
int
sizeDistinct()
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:
forEachWithOccurrences
in interfaceBag<T>
-
anySatisfyWithOccurrences
public boolean anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
anySatisfyWithOccurrences
in interfaceBag<T>
-
allSatisfyWithOccurrences
public boolean allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
allSatisfyWithOccurrences
in interfaceBag<T>
-
noneSatisfyWithOccurrences
public boolean noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
noneSatisfyWithOccurrences
in interfaceBag<T>
-
detectWithOccurrences
public T detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
- Specified by:
detectWithOccurrences
in interfaceBag<T>
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinct
in interfaceBag<T>
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceRichIterable<T>
-
occurrencesOf
public int occurrencesOf(Object item)
- Specified by:
occurrencesOf
in interfaceBag<T>
-
newWith
public ImmutableBag<T> newWith(T element)
- Specified by:
newWith
in interfaceImmutableBag<T>
- Specified by:
newWith
in interfaceImmutableCollection<T>
-
newWithout
public ImmutableBag<T> newWithout(T element)
- Specified by:
newWithout
in interfaceImmutableBag<T>
- Specified by:
newWithout
in interfaceImmutableCollection<T>
-
toMapOfItemToCount
public MutableMap<T,Integer> toMapOfItemToCount()
- Specified by:
toMapOfItemToCount
in interfaceBag<T>
- Specified by:
toMapOfItemToCount
in interfaceImmutableBagIterable<T>
-
newWithAll
public ImmutableBag<T> newWithAll(Iterable<? extends T> elements)
- Specified by:
newWithAll
in interfaceImmutableBag<T>
- Specified by:
newWithAll
in interfaceImmutableCollection<T>
-
selectByOccurrences
public ImmutableBag<T> selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrences
in interfaceBag<T>
- Specified by:
selectByOccurrences
in interfaceImmutableBag<T>
- Specified by:
selectByOccurrences
in interfaceImmutableBagIterable<T>
- Specified by:
selectByOccurrences
in interfaceUnsortedBag<T>
-
selectInstancesOf
public <S> ImmutableBag<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOf
in interfaceBag<T>
- Specified by:
selectInstancesOf
in interfaceImmutableBag<T>
- Specified by:
selectInstancesOf
in interfaceImmutableBagIterable<T>
- Specified by:
selectInstancesOf
in interfaceImmutableCollection<T>
- Specified by:
selectInstancesOf
in interfaceRichIterable<T>
- Specified by:
selectInstancesOf
in interfaceUnsortedBag<T>
-
groupBy
public <V> ImmutableBagMultimap<V,T> groupBy(Function<? super T,? extends V> function)
- Specified by:
groupBy
in interfaceBag<T>
- Specified by:
groupBy
in interfaceImmutableBag<T>
- Specified by:
groupBy
in interfaceImmutableBagIterable<T>
- Specified by:
groupBy
in interfaceImmutableCollection<T>
- Specified by:
groupBy
in interfaceRichIterable<T>
- Specified by:
groupBy
in interfaceUnsortedBag<T>
-
groupByEach
public <V> ImmutableBagMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
groupByEach
in interfaceBag<T>
- Specified by:
groupByEach
in interfaceImmutableBag<T>
- Specified by:
groupByEach
in interfaceImmutableBagIterable<T>
- Specified by:
groupByEach
in interfaceImmutableCollection<T>
- Specified by:
groupByEach
in interfaceRichIterable<T>
- Specified by:
groupByEach
in interfaceUnsortedBag<T>
-
getFirst
public T getFirst()
- Specified by:
getFirst
in interfaceRichIterable<T>
-
getLast
public T getLast()
- Specified by:
getLast
in interfaceRichIterable<T>
-
getOnly
public T getOnly()
- Specified by:
getOnly
in interfaceRichIterable<T>
-
select
public ImmutableBag<T> select(Predicate<? super T> predicate)
- Specified by:
select
in interfaceBag<T>
- Specified by:
select
in interfaceImmutableBag<T>
- Specified by:
select
in interfaceImmutableBagIterable<T>
- Specified by:
select
in interfaceImmutableCollection<T>
- Specified by:
select
in interfaceRichIterable<T>
- Specified by:
select
in interfaceUnsortedBag<T>
-
reject
public ImmutableBag<T> reject(Predicate<? super T> predicate)
- Specified by:
reject
in interfaceBag<T>
- Specified by:
reject
in interfaceImmutableBag<T>
- Specified by:
reject
in interfaceImmutableBagIterable<T>
- Specified by:
reject
in interfaceImmutableCollection<T>
- Specified by:
reject
in interfaceRichIterable<T>
- Specified by:
reject
in interfaceUnsortedBag<T>
-
collect
public <V> ImmutableBag<V> collect(Function<? super T,? extends V> function)
- Specified by:
collect
in interfaceImmutableBag<T>
- Specified by:
collect
in interfaceImmutableCollection<T>
- Specified by:
collect
in interfaceRichIterable<T>
- Specified by:
collect
in interfaceUnsortedBag<T>
-
collectIf
public <V> ImmutableBag<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
- Specified by:
collectIf
in interfaceImmutableBag<T>
- Specified by:
collectIf
in interfaceImmutableCollection<T>
- Specified by:
collectIf
in interfaceRichIterable<T>
- Specified by:
collectIf
in interfaceUnsortedBag<T>
-
flatCollect
public <V> ImmutableBag<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
- Specified by:
flatCollect
in interfaceImmutableBag<T>
- Specified by:
flatCollect
in interfaceImmutableCollection<T>
- Specified by:
flatCollect
in interfaceRichIterable<T>
- Specified by:
flatCollect
in interfaceUnsortedBag<T>
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
each
public void each(Procedure<? super T> procedure)
- Specified by:
each
in interfaceRichIterable<T>
-
anySatisfy
public boolean anySatisfy(Predicate<? super T> predicate)
- Specified by:
anySatisfy
in interfaceRichIterable<T>
- Overrides:
anySatisfy
in classAbstractRichIterable<T>
-
anySatisfyWith
public <P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
anySatisfyWith
in interfaceRichIterable<T>
- Overrides:
anySatisfyWith
in classAbstractRichIterable<T>
-
allSatisfy
public boolean allSatisfy(Predicate<? super T> predicate)
- Specified by:
allSatisfy
in interfaceRichIterable<T>
- Overrides:
allSatisfy
in classAbstractRichIterable<T>
-
allSatisfyWith
public <P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
allSatisfyWith
in interfaceRichIterable<T>
- Overrides:
allSatisfyWith
in classAbstractRichIterable<T>
-
noneSatisfy
public boolean noneSatisfy(Predicate<? super T> predicate)
- Specified by:
noneSatisfy
in interfaceRichIterable<T>
- Overrides:
noneSatisfy
in classAbstractRichIterable<T>
-
noneSatisfyWith
public <P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
noneSatisfyWith
in interfaceRichIterable<T>
- Overrides:
noneSatisfyWith
in classAbstractRichIterable<T>
-
detect
public T detect(Predicate<? super T> predicate)
- Specified by:
detect
in interfaceRichIterable<T>
- Overrides:
detect
in classAbstractRichIterable<T>
-
detectWith
public <P> T detectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWith
in interfaceRichIterable<T>
- Overrides:
detectWith
in classAbstractRichIterable<T>
-
detectOptional
public Optional<T> detectOptional(Predicate<? super T> predicate)
- Specified by:
detectOptional
in interfaceRichIterable<T>
- Overrides:
detectOptional
in classAbstractRichIterable<T>
-
detectWithOptional
public <P> Optional<T> detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithOptional
in interfaceRichIterable<T>
- Overrides:
detectWithOptional
in classAbstractRichIterable<T>
-
min
public T min(Comparator<? super T> comparator)
- Specified by:
min
in interfaceRichIterable<T>
- Overrides:
min
in classAbstractRichIterable<T>
-
max
public T max(Comparator<? super T> comparator)
- Specified by:
max
in interfaceRichIterable<T>
- Overrides:
max
in classAbstractRichIterable<T>
-
min
public T min()
- Specified by:
min
in interfaceRichIterable<T>
- Overrides:
min
in classAbstractRichIterable<T>
-
max
public T max()
- Specified by:
max
in interfaceRichIterable<T>
- Overrides:
max
in classAbstractRichIterable<T>
-
minBy
public <V extends Comparable<? super V>> T minBy(Function<? super T,? extends V> function)
- Specified by:
minBy
in interfaceRichIterable<T>
- Overrides:
minBy
in classAbstractRichIterable<T>
-
maxBy
public <V extends Comparable<? super V>> T maxBy(Function<? super T,? extends V> function)
- Specified by:
maxBy
in interfaceRichIterable<T>
- Overrides:
maxBy
in classAbstractRichIterable<T>
-
zip
@Deprecated public <S> ImmutableBag<Pair<T,S>> zip(Iterable<S> that)
Deprecated.in 6.0. UseOrderedIterable.zip(Iterable)
instead.- Specified by:
zip
in interfaceImmutableBag<T>
- Specified by:
zip
in interfaceImmutableCollection<T>
- Specified by:
zip
in interfaceRichIterable<T>
- Specified by:
zip
in interfaceUnsortedBag<T>
-
zipWithIndex
@Deprecated public ImmutableSet<Pair<T,Integer>> zipWithIndex()
Deprecated.in 6.0. UseOrderedIterable.zipWithIndex()
instead.- Specified by:
zipWithIndex
in interfaceBag<T>
- Specified by:
zipWithIndex
in interfaceImmutableBag<T>
- Specified by:
zipWithIndex
in interfaceImmutableBagIterable<T>
- Specified by:
zipWithIndex
in interfaceImmutableCollection<T>
- Specified by:
zipWithIndex
in interfaceRichIterable<T>
- Specified by:
zipWithIndex
in interfaceUnsortedBag<T>
-
distinctView
public RichIterable<T> distinctView()
- Specified by:
distinctView
in interfaceBag<T>
-
-