Package com.google.common.collect
Class ForwardingSortedMultiset.StandardElementSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- com.google.common.collect.ForwardingSortedMultiset.StandardElementSet
-
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.NavigableSet<E>
,java.util.Set<E>
,java.util.SortedSet<E>
- Enclosing class:
- ForwardingSortedMultiset<E>
protected class ForwardingSortedMultiset.StandardElementSet extends java.util.AbstractSet<E>
A sensible implementation ofSortedMultiset.elementSet()
in terms of the following methods:Collection.clear()
,SortedMultiset.comparator()
,Multiset.contains(java.lang.Object)
,Multiset.containsAll(java.util.Collection<?>)
,Multiset.count(java.lang.Object)
,SortedMultiset.firstEntry()
SortedMultiset.headMultiset(E, com.google.common.collect.BoundType)
,Collection.isEmpty()
,SortedMultiset.lastEntry()
,SortedMultiset.subMultiset(E, com.google.common.collect.BoundType, E, com.google.common.collect.BoundType)
,SortedMultiset.tailMultiset(E, com.google.common.collect.BoundType)
, thesize()
anditerator()
methods ofSortedMultiset.entrySet()
, andMultiset.remove(Object, int)
. In many situations, you may wish to overrideSortedMultiset.elementSet()
to forward to this implementation or a subclass thereof.
-
-
Constructor Summary
Constructors Constructor Description StandardElementSet()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
ceiling(E e)
void
clear()
java.util.Comparator<? super E>
comparator()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
java.util.Iterator<E>
descendingIterator()
java.util.NavigableSet<E>
descendingSet()
E
first()
E
floor(E e)
java.util.SortedSet<E>
headSet(E toElement)
java.util.NavigableSet<E>
headSet(E toElement, boolean inclusive)
E
higher(E e)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
E
last()
E
lower(E e)
E
pollFirst()
E
pollLast()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.util.NavigableSet<E>
subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
java.util.SortedSet<E>
subSet(E fromElement, E toElement)
java.util.SortedSet<E>
tailSet(E fromElement)
java.util.NavigableSet<E>
tailSet(E fromElement, boolean inclusive)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
lower
public E lower(E e)
- Specified by:
lower
in interfacejava.util.NavigableSet<E>
-
floor
public E floor(E e)
- Specified by:
floor
in interfacejava.util.NavigableSet<E>
-
ceiling
public E ceiling(E e)
- Specified by:
ceiling
in interfacejava.util.NavigableSet<E>
-
higher
public E higher(E e)
- Specified by:
higher
in interfacejava.util.NavigableSet<E>
-
descendingSet
public java.util.NavigableSet<E> descendingSet()
- Specified by:
descendingSet
in interfacejava.util.NavigableSet<E>
-
descendingIterator
public java.util.Iterator<E> descendingIterator()
- Specified by:
descendingIterator
in interfacejava.util.NavigableSet<E>
-
pollFirst
public E pollFirst()
- Specified by:
pollFirst
in interfacejava.util.NavigableSet<E>
-
pollLast
public E pollLast()
- Specified by:
pollLast
in interfacejava.util.NavigableSet<E>
-
subSet
public java.util.NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSet
in interfacejava.util.NavigableSet<E>
-
headSet
public java.util.NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSet
in interfacejava.util.NavigableSet<E>
-
tailSet
public java.util.NavigableSet<E> tailSet(E fromElement, boolean inclusive)
- Specified by:
tailSet
in interfacejava.util.NavigableSet<E>
-
comparator
public java.util.Comparator<? super E> comparator()
- Specified by:
comparator
in interfacejava.util.SortedSet<E>
-
subSet
public java.util.SortedSet<E> subSet(E fromElement, E toElement)
- Specified by:
subSet
in interfacejava.util.SortedSet<E>
-
headSet
public java.util.SortedSet<E> headSet(E toElement)
- Specified by:
headSet
in interfacejava.util.SortedSet<E>
-
tailSet
public java.util.SortedSet<E> tailSet(E fromElement)
- Specified by:
tailSet
in interfacejava.util.SortedSet<E>
-
first
public E first()
- Specified by:
first
in interfacejava.util.SortedSet<E>
-
last
public E last()
- Specified by:
last
in interfacejava.util.SortedSet<E>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
- Specified by:
clear
in interfacejava.util.Set<E>
- Overrides:
clear
in classjava.util.AbstractCollection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.Set<E>
- Overrides:
contains
in classjava.util.AbstractCollection<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
- Specified by:
containsAll
in interfacejava.util.Set<E>
- Overrides:
containsAll
in classjava.util.AbstractCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<E>
- Specified by:
isEmpty
in interfacejava.util.Set<E>
- Overrides:
isEmpty
in classjava.util.AbstractCollection<E>
-
iterator
public java.util.Iterator<E> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<E>
- Specified by:
iterator
in interfacejava.lang.Iterable<E>
- Specified by:
iterator
in interfacejava.util.Set<E>
- Specified by:
iterator
in classjava.util.AbstractCollection<E>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<E>
- Specified by:
remove
in interfacejava.util.Set<E>
- Overrides:
remove
in classjava.util.AbstractCollection<E>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<E>
- Specified by:
size
in interfacejava.util.Set<E>
- Specified by:
size
in classjava.util.AbstractCollection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<E>
- Specified by:
removeAll
in interfacejava.util.Set<E>
- Overrides:
removeAll
in classjava.util.AbstractSet<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<E>
- Specified by:
retainAll
in interfacejava.util.Set<E>
- Overrides:
retainAll
in classjava.util.AbstractCollection<E>
-
-