Top Description Fields Constructors Methods
com.google.common.collect

pack-priv final Class UnmodifiableSortedMultiset<E extends @Nullable Object>

extends Multisets.UnmodifiableMultiset<E extends @Nullable Object>
implements SortedMultiset<E extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
com.google.common.collect.SortedMultiset, com.google.common.collect.SortedIterable, java.lang.Iterable, com.google.common.collect.SortedMultisetBridge, com.google.common.collect.Multiset, java.util.Collection
Annotations
@GwtCompatible
emulated:true
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, com.google.common.collect.Multisets.UnmodifiableMultiset, com.google.errorprone.annotations.concurrent.LazyInit, java.util.Comparator, .NavigableSet, javax.annotation.CheckForNull, org.checkerframework.checker.nullness.qual.Nullable

Implementation of Multisets#unmodifiableSortedMultiset(SortedMultiset), split out into its own file so it can be GWT emulated (to deal with the differing elementSet() types in GWT and non-GWT).
Author
Louis Wasserman

Field Summary

Modifier and TypeField and Description
private transient UnmodifiableSortedMultiset<E>
private static final long
Inherited from com.google.common.collect.Multisets.UnmodifiableMultiset:
delegateelementSetentrySet

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Comparator<? super E>
comparator()

Implements com.google.common.collect.SortedMultiset.comparator.

Returns the comparator that orders this multiset, or Ordering#natural() if the natural ordering of the elements is used.
pack-priv NavigableSet<E>
protected SortedMultiset<E>
delegate()

Overrides com.google.common.collect.Multisets.UnmodifiableMultiset.delegate.

Returns the backing delegate instance that methods are forwarded to.
public SortedMultiset<E>
descendingMultiset()

Implements com.google.common.collect.SortedMultiset.descendingMultiset.

Returns a descending view of this multiset.
public NavigableSet<E>
public Multiset.Entry<E>
firstEntry()

Implements com.google.common.collect.SortedMultiset.firstEntry.

Returns the entry of the first element in this multiset, or null if this multiset is empty.
public SortedMultiset<E>
headMultiset(E upperBound, BoundType boundType)

Implements com.google.common.collect.SortedMultiset.headMultiset.

Returns a view of this multiset restricted to the elements less than upperBound, optionally including upperBound itself.
public Multiset.Entry<E>
lastEntry()

Implements com.google.common.collect.SortedMultiset.lastEntry.

Returns the entry of the last element in this multiset, or null if this multiset is empty.
public Multiset.Entry<E>
pollFirstEntry()

Implements com.google.common.collect.SortedMultiset.pollFirstEntry.

Returns and removes the entry associated with the lowest element in this multiset, or returns null if this multiset is empty.
public Multiset.Entry<E>
pollLastEntry()

Implements com.google.common.collect.SortedMultiset.pollLastEntry.

Returns and removes the entry associated with the greatest element in this multiset, or returns null if this multiset is empty.
public SortedMultiset<E>
subMultiset(E lowerBound, BoundType lowerBoundType, E upperBound, BoundType upperBoundType)

Implements com.google.common.collect.SortedMultiset.subMultiset.

Returns a view of this multiset restricted to the range between lowerBound and upperBound.
public SortedMultiset<E>
tailMultiset(E lowerBound, BoundType boundType)

Implements com.google.common.collect.SortedMultiset.tailMultiset.

Returns a view of this multiset restricted to the elements greater than lowerBound, optionally including lowerBound itself.
Inherited from com.google.common.collect.Multisets.UnmodifiableMultiset:
addaddaddAllclearentrySetiteratorremoveremoveremoveAllretainAllsetCountsetCount

Field Detail

descendingMultisetback to summary
private transient UnmodifiableSortedMultiset<E> descendingMultiset
Annotations
@LazyInit
@CheckForNull
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.google.common.collect.Multisets.UnmodifiableMultiset.serialVersionUID.

Constructor Detail

UnmodifiableSortedMultisetback to summary
pack-priv UnmodifiableSortedMultiset(SortedMultiset<E> delegate)

Method Detail

comparatorback to summary
public Comparator<? super E> comparator()

Implements com.google.common.collect.SortedMultiset.comparator.

Doc from com.google.common.collect.SortedMultiset.comparator.

Returns the comparator that orders this multiset, or Ordering#natural() if the natural ordering of the elements is used.

Annotations
@Override
createElementSetback to summary
pack-priv NavigableSet<E> createElementSet()

Overrides com.google.common.collect.Multisets.UnmodifiableMultiset.createElementSet.

Annotations
@Override
delegateback to summary
protected SortedMultiset<E> delegate()

Overrides com.google.common.collect.Multisets.UnmodifiableMultiset.delegate.

Doc from com.google.common.collect.ForwardingObject.delegate.

Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet#delegate. Concrete subclasses override this method to supply the instance being decorated.

Annotations
@Override
descendingMultisetback to summary
public SortedMultiset<E> descendingMultiset()

Implements com.google.common.collect.SortedMultiset.descendingMultiset.

Doc from com.google.common.collect.SortedMultiset.descendingMultiset.

Returns a descending view of this multiset. Modifications made to either map will be reflected in the other.

Annotations
@Override
elementSetback to summary
public NavigableSet<E> elementSet()

Overrides com.google.common.collect.Multisets.UnmodifiableMultiset.elementSet.

Implements com.google.common.collect.SortedMultiset.elementSet, com.google.common.collect.Multiset.elementSet.

Doc from com.google.common.collect.SortedMultiset.elementSet.

Returns a NavigableSet view of the distinct elements in this multiset.

Returns:NavigableSet<E>

Doc from com.google.common.collect.Multiset.elementSet.

a view of the set of distinct elements in this multiset

Annotations
@Override
firstEntryback to summary
public Multiset.Entry<E> firstEntry()

Implements com.google.common.collect.SortedMultiset.firstEntry.

Doc from com.google.common.collect.SortedMultiset.firstEntry.

Returns the entry of the first element in this multiset, or null if this multiset is empty.

Annotations
@Override
@CheckForNull
headMultisetback to summary
public SortedMultiset<E> headMultiset(E upperBound, BoundType boundType)

Implements com.google.common.collect.SortedMultiset.headMultiset.

Doc from com.google.common.collect.SortedMultiset.headMultiset.

Returns a view of this multiset restricted to the elements less than upperBound, optionally including upperBound itself. The returned multiset is a view of this multiset, so changes to one will be reflected in the other. The returned multiset supports all operations that this multiset supports.

The returned multiset will throw an IllegalArgumentException on attempts to add elements outside its range.

Annotations
@Override
lastEntryback to summary
public Multiset.Entry<E> lastEntry()

Implements com.google.common.collect.SortedMultiset.lastEntry.

Doc from com.google.common.collect.SortedMultiset.lastEntry.

Returns the entry of the last element in this multiset, or null if this multiset is empty.

Annotations
@Override
@CheckForNull
pollFirstEntryback to summary
public Multiset.Entry<E> pollFirstEntry()

Implements com.google.common.collect.SortedMultiset.pollFirstEntry.

Doc from com.google.common.collect.SortedMultiset.pollFirstEntry.

Returns and removes the entry associated with the lowest element in this multiset, or returns null if this multiset is empty.

Annotations
@Override
@CheckForNull
pollLastEntryback to summary
public Multiset.Entry<E> pollLastEntry()

Implements com.google.common.collect.SortedMultiset.pollLastEntry.

Doc from com.google.common.collect.SortedMultiset.pollLastEntry.

Returns and removes the entry associated with the greatest element in this multiset, or returns null if this multiset is empty.

Annotations
@Override
@CheckForNull
subMultisetback to summary
public SortedMultiset<E> subMultiset(E lowerBound, BoundType lowerBoundType, E upperBound, BoundType upperBoundType)

Implements com.google.common.collect.SortedMultiset.subMultiset.

Doc from com.google.common.collect.SortedMultiset.subMultiset.

Returns a view of this multiset restricted to the range between lowerBound and upperBound. The returned multiset is a view of this multiset, so changes to one will be reflected in the other. The returned multiset supports all operations that this multiset supports.

The returned multiset will throw an IllegalArgumentException on attempts to add elements outside its range.

This method is equivalent to tailMultiset(lowerBound, lowerBoundType).headMultiset(upperBound, upperBoundType).

Annotations
@Override
tailMultisetback to summary
public SortedMultiset<E> tailMultiset(E lowerBound, BoundType boundType)

Implements com.google.common.collect.SortedMultiset.tailMultiset.

Doc from com.google.common.collect.SortedMultiset.tailMultiset.

Returns a view of this multiset restricted to the elements greater than lowerBound, optionally including lowerBound itself. The returned multiset is a view of this multiset, so changes to one will be reflected in the other. The returned multiset supports all operations that this multiset supports.

The returned multiset will throw an IllegalArgumentException on attempts to add elements outside its range.

Annotations
@Override