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:
Iterable<E>
,Collection<E>
,NavigableSet<E>
,Set<E>
,SortedSet<E>
- Enclosing class:
- ForwardingSortedMultiset<E extends @Nullable Object>
protected class ForwardingSortedMultiset.StandardElementSet extends 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.- Since:
- 15.0
-
-
Constructor Summary
Constructors Constructor Description StandardElementSet()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable E
ceiling(E e)
void
clear()
Comparator<? super E>
comparator()
boolean
contains(@Nullable Object o)
boolean
containsAll(Collection<?> c)
Iterator<E>
descendingIterator()
NavigableSet<E>
descendingSet()
E
first()
@Nullable E
floor(E e)
SortedSet<E>
headSet(E toElement)
NavigableSet<E>
headSet(E toElement, boolean inclusive)
@Nullable E
higher(E e)
boolean
isEmpty()
Iterator<E>
iterator()
E
last()
@Nullable E
lower(E e)
@Nullable E
pollFirst()
@Nullable E
pollLast()
boolean
remove(@Nullable 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)
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.NavigableSet
headSet, iterator, subSet, tailSet
-
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
comparator, first, last, spliterator
-
-
-
-
Constructor Detail
-
StandardElementSet
public StandardElementSet()
Constructor for use by subclasses.
-
-
Method Detail
-
lower
public @Nullable E lower(E e)
- Specified by:
lower
in interfaceNavigableSet<E extends @Nullable Object>
-
floor
public @Nullable E floor(E e)
- Specified by:
floor
in interfaceNavigableSet<E extends @Nullable Object>
-
ceiling
public @Nullable E ceiling(E e)
- Specified by:
ceiling
in interfaceNavigableSet<E extends @Nullable Object>
-
higher
public @Nullable E higher(E e)
- Specified by:
higher
in interfaceNavigableSet<E extends @Nullable Object>
-
descendingSet
public NavigableSet<E> descendingSet()
- Specified by:
descendingSet
in interfaceNavigableSet<E extends @Nullable Object>
-
descendingIterator
public Iterator<E> descendingIterator()
- Specified by:
descendingIterator
in interfaceNavigableSet<E extends @Nullable Object>
-
pollFirst
public @Nullable E pollFirst()
- Specified by:
pollFirst
in interfaceNavigableSet<E extends @Nullable Object>
-
pollLast
public @Nullable E pollLast()
- Specified by:
pollLast
in interfaceNavigableSet<E extends @Nullable Object>
-
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSet
in interfaceNavigableSet<E extends @Nullable Object>
-
headSet
public NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSet
in interfaceNavigableSet<E extends @Nullable Object>
-
tailSet
public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
- Specified by:
tailSet
in interfaceNavigableSet<E extends @Nullable Object>
-
iterator
public Iterator<E> iterator()
-
comparator
public Comparator<? super E> comparator()
- Specified by:
comparator
in interfaceSortedSet<E extends @Nullable Object>
-
subSet
public SortedSet<E> subSet(E fromElement, E toElement)
-
headSet
public SortedSet<E> headSet(E toElement)
-
tailSet
public SortedSet<E> tailSet(E fromElement)
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<E extends @Nullable Object>
- Specified by:
clear
in interfaceSet<E extends @Nullable Object>
- Overrides:
clear
in classAbstractCollection<E extends @Nullable Object>
-
contains
public boolean contains(@Nullable Object o)
- Specified by:
contains
in interfaceCollection<E extends @Nullable Object>
- Specified by:
contains
in interfaceSet<E extends @Nullable Object>
- Overrides:
contains
in classAbstractCollection<E extends @Nullable Object>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<E extends @Nullable Object>
- Specified by:
containsAll
in interfaceSet<E extends @Nullable Object>
- Overrides:
containsAll
in classAbstractCollection<E extends @Nullable Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<E extends @Nullable Object>
- Specified by:
isEmpty
in interfaceSet<E extends @Nullable Object>
- Overrides:
isEmpty
in classAbstractCollection<E extends @Nullable Object>
-
remove
public boolean remove(@Nullable Object o)
- Specified by:
remove
in interfaceCollection<E extends @Nullable Object>
- Specified by:
remove
in interfaceSet<E extends @Nullable Object>
- Overrides:
remove
in classAbstractCollection<E extends @Nullable Object>
-
size
public int size()
- Specified by:
size
in interfaceCollection<E extends @Nullable Object>
- Specified by:
size
in interfaceSet<E extends @Nullable Object>
- Specified by:
size
in classAbstractCollection<E extends @Nullable Object>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<E extends @Nullable Object>
- Specified by:
removeAll
in interfaceSet<E extends @Nullable Object>
- Overrides:
removeAll
in classAbstractSet<E extends @Nullable Object>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<E extends @Nullable Object>
- Specified by:
retainAll
in interfaceSet<E extends @Nullable Object>
- Overrides:
retainAll
in classAbstractCollection<E extends @Nullable Object>
-
-