E - element type of this setW - element type of the wrapped setpublic class ConvertedNavigableSet<E,W> extends AbstractNavigableSet<E>
NavigableSet using a strictly invertable Converter.bounds| Constructor and Description |
|---|
ConvertedNavigableSet(NavigableSet<W> set,
Converter<E,W> converter)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E obj) |
void |
clear() |
Comparator<? super E> |
comparator() |
boolean |
contains(Object obj) |
protected NavigableSet<E> |
createSubSet(boolean reverse,
Bounds<E> newBounds)
Create a (possibly reversed) view of this instance with (possibly) tighter lower and/or upper bounds.
|
Converter<E,W> |
getConverter() |
boolean |
isEmpty()
Overridden in
AbstractIterationSet to minimize the use of AbstractIterationSet.size(). |
Iterator<E> |
iterator() |
boolean |
remove(Object obj) |
protected E |
searchAbove(E elem,
boolean inclusive)
Search for a higher element.
|
protected E |
searchBelow(E elem,
boolean inclusive)
Search for a lower element.
|
int |
size()
Calculate size.
|
ceiling, descendingIterator, descendingSet, first, floor, getComparator, headSet, headSet, higher, isWithinLowerBound, isWithinUpperBound, last, lower, pollFirst, pollLast, subSet, subSet, tailSet, tailSetequals, hashCode, toArray, toArrayremoveAlladdAll, containsAll, retainAll, toStringpublic ConvertedNavigableSet(NavigableSet<W> set, Converter<E,W> converter)
set - wrapped setconverter - element converterIllegalArgumentException - if either parameter is nullpublic Comparator<? super E> comparator()
public boolean contains(Object obj)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface NavigableSet<E>iterator in interface Set<E>iterator in class AbstractCollection<E>public boolean add(E obj)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public boolean remove(Object obj)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>public boolean isEmpty()
AbstractIterationSetAbstractIterationSet to minimize the use of AbstractIterationSet.size().isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractIterationSet<E>public int size()
AbstractIterationSet
The implementation in AbstractIterationSet iterates through all of the elements.
size in interface Collection<E>size in interface Set<E>size in class AbstractIterationSet<E>protected E searchBelow(E elem, boolean inclusive)
AbstractNavigableSetfloor() and lower().
The implementation in AbstractNavigableSet checks the bounds then returns the first element from a head set.
searchBelow in class AbstractNavigableSet<E>elem - upper limit for searchinclusive - true if elem itself is a candidateelem, or null if not foundprotected E searchAbove(E elem, boolean inclusive)
AbstractNavigableSetceiling() and higher().
The implementation in AbstractNavigableSet checks the bounds then returns the first element from a tail set.
searchAbove in class AbstractNavigableSet<E>elem - lower limit for searchinclusive - true if elem itself is a candidateelem, or null if not foundprotected NavigableSet<E> createSubSet(boolean reverse, Bounds<E> newBounds)
AbstractNavigableSetnewBounds are consistent with the new ordering (i.e., reversed relative to this instance's ordering if
reverse is true) and have already been range-checked against this instance's current bounds.createSubSet in class AbstractNavigableSet<E>reverse - whether the new set's ordering should be reversed relative to this instance's orderingnewBounds - new boundsCopyright © 2016. All rights reserved.