Class SafeTreeSet<E>
java.lang.Object
com.google.common.collect.testing.SafeTreeSet<E>
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,NavigableSet<E>,SequencedCollection<E>,SequencedSet<E>,Set<E>,SortedSet<E>
A wrapper around
TreeSet that aggressively checks to see if elements are mutually
comparable. This implementation passes the navigable set test suites.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NavigableSet<E> private static final Comparator<Object> private static final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionSafeTreeSet(Collection<? extends E> collection) SafeTreeSet(Comparator<? super E> comparator) privateSafeTreeSet(NavigableSet<E> delegate) SafeTreeSet(SortedSet<E> set) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> collection) private <T> TcheckValid(T t) voidclear()Comparator<? super E> booleanbooleancontainsAll(Collection<?> c) booleanfirst()inthashCode()booleanisEmpty()iterator()last()pollLast()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.NavigableSet
removeFirst, removeLast, reversed
-
Field Details
-
NATURAL_ORDER
-
delegate
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
SafeTreeSet
public SafeTreeSet() -
SafeTreeSet
-
SafeTreeSet
-
SafeTreeSet
-
-
Method Details
-
add
-
addAll
-
ceiling
- Specified by:
ceilingin interfaceNavigableSet<E>
-
clear
public void clear() -
comparator
- Specified by:
comparatorin interfaceSortedSet<E>
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
descendingIterator
- Specified by:
descendingIteratorin interfaceNavigableSet<E>
-
descendingSet
- Specified by:
descendingSetin interfaceNavigableSet<E>
-
first
-
floor
- Specified by:
floorin interfaceNavigableSet<E>
-
headSet
-
headSet
- Specified by:
headSetin interfaceNavigableSet<E>
-
higher
- Specified by:
higherin interfaceNavigableSet<E>
-
isEmpty
public boolean isEmpty() -
iterator
-
last
-
lower
- Specified by:
lowerin interfaceNavigableSet<E>
-
pollFirst
- Specified by:
pollFirstin interfaceNavigableSet<E>
-
pollLast
- Specified by:
pollLastin interfaceNavigableSet<E>
-
remove
-
removeAll
-
retainAll
-
size
public int size() -
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) - Specified by:
subSetin interfaceNavigableSet<E>
-
subSet
-
tailSet
-
tailSet
- Specified by:
tailSetin interfaceNavigableSet<E>
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
checkValid
private <T> T checkValid(T t) -
equals
-
hashCode
public int hashCode() -
toString
-