Top Description Methods
org.eclipse.collections.api.bag.sorted

public Interface ImmutableSortedBag<T>

extends ImmutableBagIterable<T>, SortedBag<T>
Imports
org.eclipse.collections.api.bag.ImmutableBag, .ImmutableBagIterable, org.eclipse.collections.api.block.function.Function, .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, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.factory.SortedSets, org.eclipse.collections.api.list.ImmutableList, org.eclipse.collections.api.list.primitive.ImmutableBooleanList, .ImmutableByteList, .ImmutableCharList, .ImmutableDoubleList, .ImmutableFloatList, .ImmutableIntList, .ImmutableLongList, .ImmutableShortList, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.multimap.sortedbag.ImmutableSortedBagMultimap, org.eclipse.collections.api.partition.bag.sorted.PartitionImmutableSortedBag, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, .MutableSortedSet, org.eclipse.collections.api.tuple.Pair

ImmutableSortedBag is the non-modifiable equivalent interface to MutableSortedBag.
Since
4.2

Method Summary

Modifier and TypeMethod and Description
public <V> ImmutableList<V>
collect(Function<? super T, ? extends V> function)

Redeclares org.eclipse.collections.api.RichIterable.collect, org.eclipse.collections.api.collection.ImmutableCollection.collect, org.eclipse.collections.api.bag.sorted.SortedBag.collect.

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

public ImmutableBooleanList
collectBoolean(BooleanFunction<? super T> booleanFunction)

Redeclares org.eclipse.collections.api.RichIterable.collectBoolean, org.eclipse.collections.api.collection.ImmutableCollection.collectBoolean, org.eclipse.collections.api.bag.sorted.SortedBag.collectBoolean.

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

public ImmutableByteList
collectByte(ByteFunction<? super T> byteFunction)

Redeclares org.eclipse.collections.api.RichIterable.collectByte, org.eclipse.collections.api.collection.ImmutableCollection.collectByte, org.eclipse.collections.api.bag.sorted.SortedBag.collectByte.

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

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

Redeclares org.eclipse.collections.api.RichIterable.collectChar, org.eclipse.collections.api.collection.ImmutableCollection.collectChar, org.eclipse.collections.api.bag.sorted.SortedBag.collectChar.

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

public ImmutableDoubleList
collectDouble(DoubleFunction<? super T> doubleFunction)

Redeclares org.eclipse.collections.api.RichIterable.collectDouble, org.eclipse.collections.api.collection.ImmutableCollection.collectDouble, org.eclipse.collections.api.bag.sorted.SortedBag.collectDouble.

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

public ImmutableFloatList
collectFloat(FloatFunction<? super T> floatFunction)

Redeclares org.eclipse.collections.api.RichIterable.collectFloat, org.eclipse.collections.api.collection.ImmutableCollection.collectFloat, org.eclipse.collections.api.bag.sorted.SortedBag.collectFloat.

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

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

Redeclares org.eclipse.collections.api.RichIterable.collectIf, org.eclipse.collections.api.collection.ImmutableCollection.collectIf, org.eclipse.collections.api.bag.sorted.SortedBag.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 ImmutableIntList
collectInt(IntFunction<? super T> intFunction)

Redeclares org.eclipse.collections.api.RichIterable.collectInt, org.eclipse.collections.api.collection.ImmutableCollection.collectInt, org.eclipse.collections.api.bag.sorted.SortedBag.collectInt.

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

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

Redeclares org.eclipse.collections.api.RichIterable.collectLong, org.eclipse.collections.api.collection.ImmutableCollection.collectLong, org.eclipse.collections.api.bag.sorted.SortedBag.collectLong.

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

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

Redeclares org.eclipse.collections.api.RichIterable.collectShort, org.eclipse.collections.api.collection.ImmutableCollection.collectShort, org.eclipse.collections.api.bag.sorted.SortedBag.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> ImmutableList<V>
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Redeclares org.eclipse.collections.api.RichIterable.collectWith, org.eclipse.collections.api.collection.ImmutableCollection.collectWith, org.eclipse.collections.api.bag.sorted.SortedBag.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public default <V> ImmutableList<V>
collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)

Overrides default org.eclipse.collections.api.bag.sorted.SortedBag.collectWithIndex.

Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index.

public <V> ImmutableList<V>
collectWithOccurrences(ObjectIntToObjectFunction<? super T, ? extends V> function)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.collectWithOccurrences, org.eclipse.collections.api.bag.sorted.SortedBag.collectWithOccurrences.

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

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

Overrides default 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 default <V> ImmutableBag<V>
countByEach(Function<? super T, ? extends Iterable<V>> function)

Overrides default 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 default <V, P> ImmutableBag<V>
countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Overrides default 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 ImmutableSortedSet<T>
distinct()

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.distinct.

Returns a new SortedIterable containing the distinct elements in this iterable.

public ImmutableSortedBag<T>
drop(int count)

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public ImmutableSortedBag<T>
dropWhile(Predicate<? super T> predicate)

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.dropWhile.

Returns the final elements that do not satisfy the Predicate.

public <V> ImmutableList<V>
public default <P, V> ImmutableList<V>
flatCollectWith(Function2<? super T, ? super P, ? extends Iterable<V>> function, P parameter)

Overrides default org.eclipse.collections.api.RichIterable.flatCollectWith, org.eclipse.collections.api.collection.ImmutableCollection.flatCollectWith, org.eclipse.collections.api.bag.sorted.SortedBag.flatCollectWith.

Same as flatCollect, only with a Function2 that is passed an extra parameter.

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

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.groupBy, org.eclipse.collections.api.bag.sorted.SortedBag.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> ImmutableSortedBagMultimap<V, T>
groupByEach(Function<? super T, ? extends Iterable<V>> function)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.groupByEach, org.eclipse.collections.api.bag.sorted.SortedBag.groupByEach.

Similar to groupBy(Function), except the result of evaluating function will return a collection of keys for each value.

public ImmutableSortedBag<T>
newWith(T element)

Redeclares 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 ImmutableSortedBag<T>
newWithAll(Iterable<? extends T> elements)

Redeclares 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 ImmutableSortedBag<T>
newWithout(T element)

Redeclares 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 ImmutableSortedBag<T>
newWithoutAll(Iterable<? extends T> elements)

Redeclares org.eclipse.collections.api.collection.ImmutableCollection.newWithoutAll.

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

public PartitionImmutableSortedBag<T>
partition(Predicate<? super T> predicate)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.partition, org.eclipse.collections.api.bag.sorted.SortedBag.partition.

Filters a collection into a PartitionedIterable based on the evaluation of the predicate.

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

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.partitionWith, org.eclipse.collections.api.bag.sorted.SortedBag.partitionWith.

Filters a collection into a PartitionIterable based on the evaluation of the predicate.

public ImmutableSortedBag<T>
reject(Predicate<? super T> predicate)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.reject, org.eclipse.collections.api.bag.sorted.SortedBag.reject.

Returns all elements of the source collection that return false when evaluating of the predicate.

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

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.rejectWith, org.eclipse.collections.api.bag.sorted.SortedBag.rejectWith.

Similar to reject(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

public ImmutableSortedBag<T>
select(Predicate<? super T> predicate)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.select, org.eclipse.collections.api.bag.sorted.SortedBag.select.

Returns all elements of the source collection that return true when evaluating the predicate.

public ImmutableSortedBag<T>
selectByOccurrences(IntPredicate predicate)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.selectByOccurrences, org.eclipse.collections.api.bag.sorted.SortedBag.selectByOccurrences.

Returns all elements of the bag that have a number of occurrences that satisfy the predicate.

public default ImmutableSortedBag<T>
public <S> ImmutableSortedBag<S>
selectInstancesOf(Class<S> clazz)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.selectInstancesOf, org.eclipse.collections.api.bag.sorted.SortedBag.selectInstancesOf.

Returns all elements of the source collection that are instances of the Class clazz.

public default ImmutableSortedSet<T>
selectUnique()

Implements org.eclipse.collections.api.bag.ImmutableBagIterable.selectUnique, org.eclipse.collections.api.bag.sorted.SortedBag.selectUnique.

Returns a set containing all elements of the bag that have exactly one occurrence.

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

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.selectWith, org.eclipse.collections.api.bag.sorted.SortedBag.selectWith.

Similar to select(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

public ImmutableSortedBag<T>
take(int count)

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public ImmutableSortedBag<T>
takeWhile(Predicate<? super T> predicate)

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.takeWhile.

Returns the initial elements that satisfy the Predicate.

public ImmutableSortedBag<T>
tap(Procedure<? super T> procedure)

Redeclares org.eclipse.collections.api.bag.ImmutableBagIterable.tap, org.eclipse.collections.api.bag.sorted.SortedBag.tap.

Executes the Procedure for each element in the iterable and returns this.

public default ImmutableSortedBag<T>
toImmutableSortedBag()

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

Converts the RichIterable to the default ImmutableSortedBag implementation.

public MutableSortedMap<T, Integer>
public ImmutableSortedBag<T>
toReversed()

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.toReversed.

Returns a new ReversibleIterable in reverse order.

public <S> ImmutableList<Pair<T, S>>
zip(Iterable<S> that)

Redeclares org.eclipse.collections.api.RichIterable.zip, org.eclipse.collections.api.collection.ImmutableCollection.zip, org.eclipse.collections.api.ordered.SortedIterable.zip, org.eclipse.collections.api.ordered.ReversibleIterable.zip.

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

public ImmutableSortedSet<Pair<T, Integer>>
Inherited from org.eclipse.collections.api.bag.sorted.SortedBag:
comparatormaxminpartitionWhiletoImmutable