Top Description Fields Constructors Methods
org.eclipse.collections.impl.bag.immutable

pack-priv final Class ImmutableEmptyBag<T>

extends AbstractImmutableBag<T>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .Serializable, java.util.Collection, .Comparator, .Iterator, .Map, .NoSuchElementException, .Optional, org.eclipse.collections.api.LazyIterable, .RichIterable, org.eclipse.collections.api.bag.Bag, .ImmutableBag, .MutableBag, .MutableBagIterable, org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag, .ImmutableByteBag, .ImmutableCharBag, .ImmutableDoubleBag, .ImmutableFloatBag, .ImmutableIntBag, .ImmutableLongBag, .ImmutableShortBag, org.eclipse.collections.api.bag.sorted.MutableSortedBag, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ObjectIntToObjectFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.predicate.primitive.IntPredicate, .ObjectIntPredicate, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Bags, .Lists, .Maps, .Sets, .SortedBags, .SortedMaps, org.eclipse.collections.api.factory.primitive.BooleanBags, .ByteBags, .CharBags, .DoubleBags, .FloatBags, .IntBags, .LongBags, .ShortBags, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.ImmutableMap, .MutableMap, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.multimap.bag.ImmutableBagMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.bag.PartitionImmutableBag, org.eclipse.collections.api.set.ImmutableSet, .MutableSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.EmptyIterator, org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap, org.eclipse.collections.impl.multimap.bag.HashBagMultimap, org.eclipse.collections.impl.partition.bag.PartitionHashBag, org.eclipse.collections.impl.utility.ArrayIterate, .Iterate, .LazyIterate

This is a zero element ImmutableBag which is created by calling the Bags.immutable.empty().
Since
1.0

Field Summary

Modifier and TypeField and Description
private static final PartitionImmutableBag<Object>
pack-priv static final ImmutableBag<?>
private static final LazyIterable<?>
private static final long
private static final Object[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
allSatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfy.

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.

public <P> boolean
allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

public boolean
allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)

Implements org.eclipse.collections.api.bag.Bag.allSatisfyWithOccurrences.

Returns true if the predicate evaluates to true for all elements of the Bag.

public boolean
anySatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfy.

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

Returns true if the predicate evaluates to true for any element of the iterable.

public <P> boolean
anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfyWith.

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

Returns true if the predicate evaluates to true for any element of the collection, or return false.

public boolean
anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)

Implements org.eclipse.collections.api.bag.Bag.anySatisfyWithOccurrences.

Returns true if the predicate evaluates to true for any element of the Bag.

public void
appendString(Appendable appendable)

Overrides default org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public void
appendString(Appendable appendable, String separator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.appendString.

Overrides default org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public void
appendString(Appendable appendable, String start, String separator, String end)

Overrides org.eclipse.collections.impl.AbstractRichIterable.appendString.

Implements org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public LazyIterable<T>
asLazy()

Overrides org.eclipse.collections.impl.AbstractRichIterable.asLazy.

Implements org.eclipse.collections.api.RichIterable.asLazy.

Returns a lazy (deferred) iterable, most likely implemented by calling LazyIterate.adapt(this).

public RichIterable<RichIterable<T>>
public <V> ImmutableBag<V>
collect(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.bag.ImmutableBag.collect, org.eclipse.collections.api.RichIterable.collect, org.eclipse.collections.api.collection.ImmutableCollection.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public ImmutableBooleanBag
public ImmutableByteBag
collectByte(ByteFunction<? super T> byteFunction)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.collectByte.

Implements org.eclipse.collections.api.bag.ImmutableBag.collectByte, org.eclipse.collections.api.RichIterable.collectByte, org.eclipse.collections.api.collection.ImmutableCollection.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public ImmutableCharBag
collectChar(CharFunction<? super T> charFunction)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.collectChar.

Implements org.eclipse.collections.api.bag.ImmutableBag.collectChar, org.eclipse.collections.api.RichIterable.collectChar, org.eclipse.collections.api.collection.ImmutableCollection.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public ImmutableDoubleBag
public ImmutableFloatBag
collectFloat(FloatFunction<? super T> floatFunction)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.collectFloat.

Implements org.eclipse.collections.api.bag.ImmutableBag.collectFloat, org.eclipse.collections.api.RichIterable.collectFloat, org.eclipse.collections.api.collection.ImmutableCollection.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <V> ImmutableBag<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.bag.ImmutableBag.collectIf, org.eclipse.collections.api.RichIterable.collectIf, org.eclipse.collections.api.collection.ImmutableCollection.collectIf.

Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate.

public ImmutableIntBag
collectInt(IntFunction<? super T> intFunction)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.collectInt.

Implements org.eclipse.collections.api.bag.ImmutableBag.collectInt, org.eclipse.collections.api.RichIterable.collectInt, org.eclipse.collections.api.collection.ImmutableCollection.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public ImmutableLongBag
collectLong(LongFunction<? super T> longFunction)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.collectLong.

Implements org.eclipse.collections.api.bag.ImmutableBag.collectLong, org.eclipse.collections.api.RichIterable.collectLong, org.eclipse.collections.api.collection.ImmutableCollection.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public ImmutableShortBag
collectShort(ShortFunction<? super T> shortFunction)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.collectShort.

Implements org.eclipse.collections.api.bag.ImmutableBag.collectShort, org.eclipse.collections.api.RichIterable.collectShort, org.eclipse.collections.api.collection.ImmutableCollection.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <P, V> ImmutableBag<V>
public <V> ImmutableBag<V>
public <V, R extends Collection<V>> R
collectWithOccurrences(ObjectIntToObjectFunction<? super T, ? extends V> function, R target)

Overrides default org.eclipse.collections.api.bag.Bag.collectWithOccurrences.

Iterates over the unique elements and their occurrences and collects the results of applying the specified function into the target collection.

public boolean
contains(Object object)

Overrides org.eclipse.collections.impl.AbstractRichIterable.contains.

Implements org.eclipse.collections.api.RichIterable.contains, java.util.Collection.contains.

Returns true if the iterable has an element which responds true to element.equals(object).

public boolean
containsAllArguments(Object... elements)

Overrides org.eclipse.collections.impl.AbstractRichIterable.containsAllArguments.

Implements org.eclipse.collections.api.RichIterable.containsAllArguments.

Returns true if all elements in the specified var arg array are contained in this collection.

public boolean
containsAllIterable(Iterable<?> source)

Overrides org.eclipse.collections.impl.AbstractRichIterable.containsAllIterable.

Implements org.eclipse.collections.api.RichIterable.containsAllIterable.

Returns true if all elements in source are contained in this collection.

public int
count(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.bag.AbstractBag.count.

Implements org.eclipse.collections.api.RichIterable.count.

Return the total number of elements that answer true to the specified predicate.

public <V> ImmutableBag<V>
countBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.countBy.

Overrides default org.eclipse.collections.api.bag.ImmutableBag.countBy, org.eclipse.collections.api.RichIterable.countBy, org.eclipse.collections.api.collection.ImmutableCollection.countBy.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V, R extends MutableBagIterable<V>> R
countBy(Function<? super T, ? extends V> function, R target)

Overrides default org.eclipse.collections.api.RichIterable.countBy.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V> ImmutableBag<V>
countByEach(Function<? super T, ? extends Iterable<V>> function)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.countByEach.

Overrides default org.eclipse.collections.api.bag.ImmutableBag.countByEach, org.eclipse.collections.api.RichIterable.countByEach, org.eclipse.collections.api.collection.ImmutableCollection.countByEach.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V, R extends MutableBagIterable<V>> R
countByEach(Function<? super T, ? extends Iterable<V>> function, R target)

Overrides default org.eclipse.collections.api.RichIterable.countByEach.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V, P> ImmutableBag<V>
countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.countByWith.

Overrides default org.eclipse.collections.api.bag.ImmutableBag.countByWith, org.eclipse.collections.api.RichIterable.countByWith, org.eclipse.collections.api.collection.ImmutableCollection.countByWith.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.

public <V, P, R extends MutableBagIterable<V>> R
countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target)

Overrides default org.eclipse.collections.api.RichIterable.countByWith.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.

public <P> int
countWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.countWith.

Implements org.eclipse.collections.api.RichIterable.countWith.

Returns the total number of elements that evaluate to true for the specified predicate.

public T
detect(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detect.

Implements org.eclipse.collections.api.RichIterable.detect.

Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true.

public T
detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)

Overrides default org.eclipse.collections.api.RichIterable.detectIfNone.

Returns the first element of the iterable for which the predicate evaluates to true.

public Optional<T>
detectOptional(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectOptional.

Implements org.eclipse.collections.api.RichIterable.detectOptional.

Returns the first element of the iterable for which the predicate evaluates to true as an Optional.

public <P> T
detectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectWith.

Implements org.eclipse.collections.api.RichIterable.detectWith.

Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true.

public <P> T
detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectWithIfNone.

Implements org.eclipse.collections.api.RichIterable.detectWithIfNone.

Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter, or returns the value of evaluating the specified function.

public T
detectWithOccurrences(ObjectIntPredicate<? super T> predicate)

Implements org.eclipse.collections.api.bag.Bag.detectWithOccurrences.

Returns an element of the Bag that satisfies the predicate or null if such an element does not exist

public <P> Optional<T>
detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectWithOptional.

Implements org.eclipse.collections.api.RichIterable.detectWithOptional.

Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional.

public RichIterable<T>
distinctView()

Overrides default org.eclipse.collections.api.bag.Bag.distinctView.

Returns an unmodifiable view on the distinct elements with the same complexity as the Bag implementation.

public void
each(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.bag.Bag.equals, java.util.Collection.equals.

Two bags b1 and b2 are equal if m1.toMapOfItemToCount().equals(m2.toMapOfItemToCount()).

public <V> ImmutableBag<V>
public <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public void
forEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)

Implements org.eclipse.collections.api.bag.Bag.forEachWithOccurrences.

For each distinct item, with the number of occurrences, execute the specified procedure.

public T
getFirst()

Implements org.eclipse.collections.api.RichIterable.getFirst.

Returns the first element of an iterable.

public T
getLast()

Implements org.eclipse.collections.api.RichIterable.getLast.

Returns the last element of an iterable.

public T
getOnly()

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element.

public <V> ImmutableBagMultimap<V, T>
groupBy(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.bag.ImmutableBag.groupBy, org.eclipse.collections.api.bag.ImmutableBagIterable.groupBy, org.eclipse.collections.api.bag.Bag.groupBy, org.eclipse.collections.api.RichIterable.groupBy.

For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

public <V> ImmutableBagMultimap<V, T>
public <V> ImmutableMap<V, T>
groupByUniqueKey(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag.groupByUniqueKey.

Overrides default org.eclipse.collections.api.collection.ImmutableCollection.groupByUniqueKey.

Implements org.eclipse.collections.api.RichIterable.groupByUniqueKey.

For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.bag.Bag.hashCode, java.util.Collection.hashCode.

Returns the hash code for this Bag, defined as this.

public <IV> IV
injectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function)

Overrides org.eclipse.collections.impl.bag.AbstractBag.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public boolean
public Iterator<T>
iterator()

Implements java.lang.Iterable.iterator, java.util.Collection.iterator.

Returns an iterator over elements of type T.

public String
makeString()

Overrides default org.eclipse.collections.api.RichIterable.makeString.

Returns a string representation of this collection by delegating to makeString(String) and defaulting the separator parameter to the characters ", " (comma and space).

public String
makeString(String separator)

Overrides default org.eclipse.collections.api.RichIterable.makeString.

Returns a string representation of this collection by delegating to makeString(String, String, String) and defaulting the start and end parameters to "" (the empty String).

public String
makeString(String start, String separator, String end)

Overrides default org.eclipse.collections.api.RichIterable.makeString.

Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.

public T
max(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the comparator.

public T
max()

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the natural order.

public <V extends Comparable<? super V>> T
maxBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.maxBy.

Implements org.eclipse.collections.api.RichIterable.maxBy.

Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.

public T
min(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the comparator.

public T
min()

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the natural order.

public <V extends Comparable<? super V>> T
minBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.minBy.

Implements org.eclipse.collections.api.RichIterable.minBy.

Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.

public ImmutableBag<T>
newWith(T element)

Implements org.eclipse.collections.api.bag.ImmutableBag.newWith, org.eclipse.collections.api.collection.ImmutableCollection.newWith.

This method is similar to the with method in MutableCollection with the difference that a new copy of this collection with the element appended will be returned.

public ImmutableBag<T>
newWithAll(Iterable<? extends T> elements)

Implements org.eclipse.collections.api.bag.ImmutableBag.newWithAll, org.eclipse.collections.api.collection.ImmutableCollection.newWithAll.

This method is similar to the withAll method in MutableCollection with the difference that a new copy of this collection with the elements appended will be returned.

public ImmutableBag<T>
newWithout(T element)

Implements org.eclipse.collections.api.bag.ImmutableBag.newWithout, org.eclipse.collections.api.collection.ImmutableCollection.newWithout.

This method is similar to the without method in MutableCollection with the difference that a new copy of this collection with the element removed will be returned.

public boolean
noneSatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfy.

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.

public <P> boolean
noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

Returns true if the predicate evaluates to false for every element of the collection, or return false.

public boolean
noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)

Implements org.eclipse.collections.api.bag.Bag.noneSatisfyWithOccurrences.

Returns true if the Bag is empty or if the predicate evaluates to false for all elements of the Bag.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.RichIterable.notEmpty.

The English equivalent of !this.isEmpty()

public int
occurrencesOf(Object item)

Implements org.eclipse.collections.api.bag.Bag.occurrencesOf.

The occurrences of a distinct item in the bag.

public PartitionImmutableBag<T>
public <P> PartitionImmutableBag<T>
public ImmutableBag<T>
public <P> ImmutableBag<T>
public ImmutableBag<T>
public ImmutableBag<T>
public <S> ImmutableBag<S>
public ImmutableSet<T>
public <P> ImmutableBag<T>
public int
size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Collection.size.

Returns the number of items in this iterable.

public int
sizeDistinct()

Implements org.eclipse.collections.api.bag.Bag.sizeDistinct.

The size of the Bag when counting only distinct elements.

public ImmutableBag<T>
public Object[]
public <T> T[]
toArray(T[] a)

Overrides org.eclipse.collections.impl.bag.AbstractBag.toArray.

Overrides default org.eclipse.collections.api.RichIterable.toArray.

Implements java.util.Collection.toArray.

Converts this iterable to an array using the specified target array, assuming the target array is as long or longer than the iterable.

public MutableBag<T>
toBag()

Overrides org.eclipse.collections.impl.bag.AbstractBag.toBag.

Implements org.eclipse.collections.api.RichIterable.toBag.

Converts the collection to the default MutableBag implementation.

public MutableList<T>
toList()

Overrides org.eclipse.collections.impl.bag.AbstractBag.toList.

Implements org.eclipse.collections.api.RichIterable.toList.

Converts the collection to a MutableList implementation.

public <NK, NV> MutableMap<NK, NV>
toMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

Overrides org.eclipse.collections.impl.AbstractRichIterable.toMap.

Implements org.eclipse.collections.api.RichIterable.toMap.

Converts the collection to a MutableMap implementation using the specified key and value functions.

public <NK, NV, R extends Map<NK, NV>> R
toMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction, R target)

Overrides default org.eclipse.collections.api.RichIterable.toMap.

Same as toMap(Function, Function), except that the results are gathered into the specified target map.

public MutableMap<T, Integer>
public MutableSet<T>
toSet()

Overrides org.eclipse.collections.impl.bag.AbstractBag.toSet.

Implements org.eclipse.collections.api.RichIterable.toSet.

Converts the collection to a MutableSet implementation.

public MutableSortedBag<T>
toSortedBag()

Overrides org.eclipse.collections.impl.bag.AbstractBag.toSortedBag.

Implements org.eclipse.collections.api.RichIterable.toSortedBag.

Converts the collection to a MutableSortedBag implementation and sorts it using the natural order of the elements.

public MutableSortedBag<T>
toSortedBag(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.bag.AbstractBag.toSortedBag.

Implements org.eclipse.collections.api.RichIterable.toSortedBag.

Converts the collection to the MutableSortedBag implementation and sorts it using the specified comparator.

public MutableList<T>
toSortedList()

Overrides default org.eclipse.collections.api.RichIterable.toSortedList.

Converts the collection to a MutableList implementation and sorts it using the natural order of the elements.

public MutableList<T>
toSortedList(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.bag.AbstractBag.toSortedList.

Overrides default org.eclipse.collections.api.RichIterable.toSortedList.

Converts the collection to a MutableList implementation and sorts it using the specified comparator.

public <NK, NV> MutableSortedMap<NK, NV>
toSortedMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

Overrides org.eclipse.collections.impl.AbstractRichIterable.toSortedMap.

Implements org.eclipse.collections.api.RichIterable.toSortedMap.

Converts the collection to a MutableSortedMap implementation using the specified key and value functions sorted by the key elements' natural ordering.

public <NK, NV> MutableSortedMap<NK, NV>
toSortedMap(Comparator<? super NK> comparator, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

Overrides org.eclipse.collections.impl.AbstractRichIterable.toSortedMap.

Implements org.eclipse.collections.api.RichIterable.toSortedMap.

Converts the collection to a MutableSortedMap implementation using the specified key and value functions sorted by the given comparator.

public String
toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.RichIterable.toString.

Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.

private Object
public <S> ImmutableBag<Pair<T, S>>
zip(Iterable<S> that)

Implements org.eclipse.collections.api.bag.ImmutableBag.zip, org.eclipse.collections.api.RichIterable.zip, org.eclipse.collections.api.collection.ImmutableCollection.zip.

Deprecated in 6.0. Use OrderedIterable#zip(Iterable) instead.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public ImmutableSet<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.bag.immutable.AbstractImmutableBag:
bottomOccurrencesnewWithoutAlltoImmutabletopOccurrences