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

pack-priv Class ImmutableEmptySortedBag<T>

extends AbstractImmutableSortedBag<T>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.Collection, .Comparator, .Iterator, .NoSuchElementException, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.bag.Bag, .ImmutableBag, .MutableBagIterable, org.eclipse.collections.api.bag.sorted.ImmutableSortedBag, .SortedBag, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction, 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, .SortedBags, .SortedMaps, .SortedSets, .Stacks, org.eclipse.collections.api.list.ImmutableList, org.eclipse.collections.api.map.ImmutableMap, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.multimap.sortedbag.ImmutableSortedBagMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.bag.sorted.PartitionImmutableSortedBag, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.EmptyIterator, org.eclipse.collections.impl.multimap.bag.sorted.mutable.TreeBagMultimap, org.eclipse.collections.impl.partition.bag.sorted.PartitionImmutableSortedBagImpl, .PartitionTreeBag, org.eclipse.collections.impl.utility.OrderedIterate

Field Summary

Modifier and TypeField and Description
private final Comparator<? super T>
pack-priv static final ImmutableSortedBag<?>
private static final long

Constructor Summary

AccessConstructor and Description
private
pack-priv
ImmutableEmptySortedBag(Comparator<? super T> comparator)

Method Summary

Modifier and TypeMethod and Description
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
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 RichIterable<RichIterable<T>>
public <V> ImmutableList<V>
public <V> ImmutableList<V>
collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)

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

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

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

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.collectWithIndex.

Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.

public <V> ImmutableList<V>
public Comparator<? super T>
comparator()

Implements org.eclipse.collections.api.bag.sorted.SortedBag.comparator.

Returns the comparator used to order the elements in this bag, or null if this bag uses the natural ordering of its elements.

public int
compareTo(SortedBag<T> o)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

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 <S> boolean
corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.corresponds.

Returns true if both OrderedIterables have the same length and predicate returns true for all corresponding elements e1 of this OrderedIterable and e2 of other.

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.sorted.immutable.AbstractImmutableSortedBag.countBy.

Overrides default org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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.sorted.immutable.AbstractImmutableSortedBag.countByEach.

Overrides default org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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.sorted.immutable.AbstractImmutableSortedBag.countByWith.

Overrides default org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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 int
detectIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.detectIndex.

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

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

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.distinct.

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

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 ImmutableSortedBag<T>
drop(int count)

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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)

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.dropWhile.

Returns the final elements that do not satisfy the Predicate.

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 other)

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 void
forEach(int startIndex, int endIndex, Procedure<? super T> procedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEach.

Iterates over the section of the iterable covered by the specified inclusive indexes.

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(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the section of the iterable covered by the specified inclusive indexes.

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

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

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

public T
public T
public T
getOnly()

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

Returns the element if the iterable has exactly one element.

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

Overrides org.eclipse.collections.impl.bag.sorted.immutable.AbstractImmutableSortedBag.groupBy.

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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> ImmutableSortedBagMultimap<V, T>
public <V> ImmutableMap<V, T>
groupByUniqueKey(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.bag.sorted.immutable.AbstractImmutableSortedBag.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 Iterator<T>
iterator()

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

Returns an iterator over elements of type T.

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, org.eclipse.collections.api.bag.sorted.SortedBag.max.

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

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, org.eclipse.collections.api.bag.sorted.SortedBag.min.

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

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

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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 ImmutableSortedBag<T>
newWithAll(Iterable<? extends T> elements)

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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 ImmutableSortedBag<T>
newWithout(T element)

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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 ImmutableSortedBag<T>
newWithoutAll(Iterable<? extends T> elements)

Overrides org.eclipse.collections.impl.bag.sorted.immutable.AbstractImmutableSortedBag.newWithoutAll.

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.newWithoutAll, 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 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 int
occurrencesOf(Object item)

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

The occurrences of a distinct item in the bag.

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

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

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

public ImmutableSortedBag<T>
public <P> ImmutableSortedBag<T>
public ImmutableSortedBag<T>
public ImmutableSortedBag<T>
public <S> ImmutableSortedBag<S>
public ImmutableSortedSet<T>
public <P> ImmutableSortedBag<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 ImmutableSortedBag<T>
take(int count)

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.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)

Implements org.eclipse.collections.api.bag.sorted.ImmutableSortedBag.takeWhile.

Returns the initial elements that satisfy the Predicate.

public ImmutableSortedBag<T>
public MutableSortedMap<T, Integer>
public MutableStack<T>
toStack()

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.toStack.

Converts the OrderedIterable to a mutable MutableStack implementation.

public ImmutableSortedSet<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.bag.sorted.immutable.AbstractImmutableSortedBag:
bottomOccurrencescollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithdetectLastIndexflatCollectpartitionpartitionWithtoImmutabletopOccurrencestoReversedwriteReplacezipzip