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

pack-priv final Class SortedMultisets

extends Object
Class Inheritance
Annotations
@GwtCompatible
emulated:true
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.collect.BoundType.CLOSED, .BoundType.OPEN

Provides static utility methods for creating and working with SortedMultiset instances.
Author
Louis Wasserman

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
SortedMultisets.ElementSet<E extends @Nullable Object>

A skeleton implementation for SortedMultiset#elementSet.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static <E extends @Nullable Object> E
private static <E extends @Nullable Object> E
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SortedMultisetsback to summary
private SortedMultisets()

Method Detail

getElementOrNullback to summary
private static <E extends @Nullable Object> E getElementOrNull(Multiset.Entry<E> entry)
Annotations
@CheckForNull
getElementOrThrowback to summary
private static <E extends @Nullable Object> E getElementOrThrow(Multiset.Entry<E> entry)
com.google.common.collect back to summary

pack-priv Class SortedMultisets.ElementSet<E extends @Nullable Object>

extends Multisets.ElementSet<E extends @Nullable Object>
implements SortedSet<E extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection
Known Direct Subclasses
com.google.common.collect.SortedMultisets.NavigableElementSet
Annotations
@SuppressWarnings:JdkObsolete

A skeleton implementation for SortedMultiset#elementSet.

Field Summary

Modifier and TypeField and Description
private final SortedMultiset<E>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

Implements java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.
public E
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.
public SortedSet<E>
headSet(E
high endpoint (exclusive) of the returned set
toElement
)

Implements java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement.
public Iterator<E>
iterator()

Implements abstract com.google.common.collect.Multisets.ElementSet.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.
public E
last()

Implements java.util.SortedSet.last.

Returns the last (highest) element currently in this set.
pack-priv final SortedMultiset<E>
public SortedSet<E>
subSet(E
low endpoint (inclusive) of the returned set
fromElement
,
E
high endpoint (exclusive) of the returned set
toElement
)

Implements java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive.
public SortedSet<E>
tailSet(E
low endpoint (inclusive) of the returned set
fromElement
)

Implements java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement.
Inherited from com.google.common.collect.Multisets.ElementSet:
clearcontainscontainsAllisEmptyremovesize

Field Detail

multisetback to summary
private final SortedMultiset<E> multiset
Annotations
@Weak

Constructor Detail

ElementSetback to summary
pack-priv ElementSet(SortedMultiset<E> multiset)

Method Detail

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

Implements java.util.SortedSet.comparator.

Doc from java.util.SortedSet.comparator.

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

Returns:Comparator<? super E>

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

Annotations
@Override
firstback to summary
public E first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.

Returns:E

the first (lowest) element currently in this set

Annotations
@Override
@ParametricNullness
headSetback to summary
public SortedSet<E> headSet(E toElement)

Implements java.util.SortedSet.headSet.

Doc from java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
toElement:E

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are strictly less than toElement

Annotations
@Override
iteratorback to summary
public Iterator<E> iterator()

Implements abstract com.google.common.collect.Multisets.ElementSet.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<E>

an iterator over the elements in this set

Annotations
@Override
lastback to summary
public E last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

Returns the last (highest) element currently in this set.

Returns:E

the last (highest) element currently in this set

Annotations
@Override
@ParametricNullness
multisetback to summary
pack-priv final SortedMultiset<E> multiset()

Implements abstract com.google.common.collect.Multisets.ElementSet.multiset.

Annotations
@Override
subSetback to summary
public SortedSet<E> subSet(E fromElement, E toElement)

Implements java.util.SortedSet.subSet.

Doc from java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromElement:E

low endpoint (inclusive) of the returned set

toElement:E

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive

Annotations
@Override
tailSetback to summary
public SortedSet<E> tailSet(E fromElement)

Implements java.util.SortedSet.tailSet.

Doc from java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromElement:E

low endpoint (inclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are greater than or equal to fromElement

Annotations
@Override