protected class ForwardingSortedMultiset.StandardElementSet extends AbstractSet<E>
A sensible implementation of SortedMultiset.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.diffplug.common.collect.BoundType)
, Collection.isEmpty()
, SortedMultiset.lastEntry()
, SortedMultiset.subMultiset(E, com.diffplug.common.collect.BoundType, E, com.diffplug.common.collect.BoundType)
, SortedMultiset.tailMultiset(E, com.diffplug.common.collect.BoundType)
, the size()
and iterator()
methods of SortedMultiset.entrySet()
, and Multiset.remove(Object, int)
. In many situations, you may wish to override SortedMultiset.elementSet()
to forward to this implementation or a subclass thereof.
Constructor and Description |
---|
StandardElementSet()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
E |
ceiling(E e) |
void |
clear() |
Comparator<? super E> |
comparator() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
Iterator<E> |
descendingIterator() |
NavigableSet<E> |
descendingSet() |
E |
first() |
E |
floor(E e) |
SortedSet<E> |
headSet(E toElement) |
NavigableSet<E> |
headSet(E toElement,
boolean inclusive) |
E |
higher(E e) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
E |
last() |
E |
lower(E e) |
E |
pollFirst() |
E |
pollLast() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
NavigableSet<E> |
subSet(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive) |
SortedSet<E> |
subSet(E fromElement,
E toElement) |
SortedSet<E> |
tailSet(E fromElement) |
NavigableSet<E> |
tailSet(E fromElement,
boolean inclusive) |
equals, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
headSet, iterator, subSet, tailSet
comparator, first, last, spliterator
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
parallelStream, removeIf, stream
public StandardElementSet()
Constructor for use by subclasses.
public E lower(E e)
lower
in interface NavigableSet<E>
public E floor(E e)
floor
in interface NavigableSet<E>
public E ceiling(E e)
ceiling
in interface NavigableSet<E>
public E higher(E e)
higher
in interface NavigableSet<E>
public NavigableSet<E> descendingSet()
descendingSet
in interface NavigableSet<E>
public Iterator<E> descendingIterator()
descendingIterator
in interface NavigableSet<E>
public E pollFirst()
pollFirst
in interface NavigableSet<E>
public E pollLast()
pollLast
in interface NavigableSet<E>
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
subSet
in interface NavigableSet<E>
public NavigableSet<E> headSet(E toElement, boolean inclusive)
headSet
in interface NavigableSet<E>
public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
tailSet
in interface NavigableSet<E>
public Comparator<? super E> comparator()
comparator
in interface SortedSet<E>
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractCollection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractCollection<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
containsAll
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
isEmpty
in class AbstractCollection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractCollection<E>
public int size()
size
in interface Collection<E>
size
in interface Set<E>
size
in class AbstractCollection<E>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollection<E>