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

public Interface MutableSortedBag<T>

extends SortedBag<T>, MutableBagIterable<T>, Cloneable
Imports
org.eclipse.collections.api.bag.MutableBag, .MutableBagIterable, 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.MutableList, org.eclipse.collections.api.list.primitive.MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.multimap.sortedbag.MutableSortedBagMultimap, org.eclipse.collections.api.partition.bag.sorted.PartitionMutableSortedBag, org.eclipse.collections.api.set.sorted.MutableSortedSet, org.eclipse.collections.api.tuple.Pair

Since
4.2

Method Summary

Modifier and TypeMethod and Description
public MutableSortedBag<T>
asSynchronized()

Redeclares org.eclipse.collections.api.collection.MutableCollection.asSynchronized.

Returns a synchronized wrapper backed by this collection.

public MutableSortedBag<T>

Returns:

an unmodifiable view of this set
asUnmodifiable
()

Redeclares org.eclipse.collections.api.collection.MutableCollection.asUnmodifiable.

Returns an unmodifiable view of the set.

public MutableSortedBag<T>
public <V> MutableList<V>
collect(Function<? super T, ? extends V> function)

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

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectBoolean.

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectByte.

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectChar.

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectDouble.

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectFloat.

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

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectInt.

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

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

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

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.collectLong.

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

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

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.collectShort, org.eclipse.collections.api.RichIterable.collectShort.

Redeclares as abstract: org.eclipse.collections.api.collection.MutableCollection.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> MutableList<V>
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

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

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

public default <V> MutableList<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> MutableList<V>
collectWithOccurrences(ObjectIntToObjectFunction<? super T, ? extends V> function)

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

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

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

Overrides default org.eclipse.collections.api.RichIterable.countBy, org.eclipse.collections.api.collection.MutableCollection.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> MutableBag<V>
countByEach(Function<? super T, ? extends Iterable<V>> function)

Overrides default org.eclipse.collections.api.RichIterable.countByEach, org.eclipse.collections.api.collection.MutableCollection.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> MutableBag<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.MutableCollection.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 MutableSortedSet<T>
distinct()

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

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

public MutableSortedBag<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 MutableSortedBag<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> MutableList<V>
public default <P, V> MutableList<V>
flatCollectWith(Function2<? super T, ? super P, ? extends Iterable<V>> function, P parameter)

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

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

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

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

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

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

public MutableSortedBag<T>
newEmpty()

Redeclares org.eclipse.collections.api.collection.MutableCollection.newEmpty.

Creates a new empty mutable version of the same collection type.

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

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

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

public PartitionMutableSortedBag<T>
partitionWhile(Predicate<? super T> predicate)

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

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements.

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

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

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

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

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

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

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

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

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

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

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

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

public MutableSortedBag<T>
selectByOccurrences(IntPredicate predicate)

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

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

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

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

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

public default MutableSortedSet<T>
selectUnique()

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

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

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

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

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

public MutableSortedBag<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 MutableSortedBag<T>
takeWhile(Predicate<? super T> predicate)

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

Returns the initial elements that satisfy the Predicate.

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

Redeclares org.eclipse.collections.api.bag.sorted.SortedBag.tap, org.eclipse.collections.api.bag.MutableBagIterable.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 MutableSortedBag<T>
toReversed()

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

Returns a new ReversibleIterable in reverse order.

public default MutableSortedBag<T>
with(T element)

Overrides default org.eclipse.collections.api.bag.MutableBagIterable.with.

This method allows mutable and fixed size collections the ability to add elements to their existing elements.

public default MutableSortedBag<T>
withAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.bag.MutableBagIterable.withAll.

This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements.

public default MutableSortedBag<T>
public default MutableSortedBag<T>
without(T element)

Overrides default org.eclipse.collections.api.bag.MutableBagIterable.without.

This method allows mutable and fixed size collections the ability to remove elements from their existing elements.

public default MutableSortedBag<T>
withoutAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.bag.MutableBagIterable.withoutAll.

This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements.

public default MutableSortedBag<T>
public <S> MutableList<Pair<T, S>>
zip(Iterable<S> that)

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

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

public MutableSortedSet<Pair<T, Integer>>
Inherited from org.eclipse.collections.api.bag.MutableBagIterable:
addOccurrencesbottomOccurrencesremoveOccurrencessetOccurrencestopOccurrences
Inherited from org.eclipse.collections.api.bag.sorted.SortedBag:
comparatormaxmintoImmutable