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>
@GwtIncompatible
public final class SafeTreeSet<E>
extends Object
implements Serializable, NavigableSet<E>
A wrapper around
TreeSet
that aggressively checks to see if elements are mutually
comparable. This implementation passes the navigable set test suites.- Author:
- Louis Wasserman
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSafeTreeSet
(Collection<? extends E> collection) SafeTreeSet
(Comparator<? super E> comparator) SafeTreeSet
(SortedSet<E> set) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> collection) @Nullable E
void
clear()
Comparator
<? super E> boolean
boolean
containsAll
(Collection<?> c) boolean
first()
@Nullable E
int
hashCode()
@Nullable E
boolean
isEmpty()
iterator()
last()
@Nullable E
@Nullable E
@Nullable E
pollLast()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
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
removeFirst, removeLast, reversed
-
Constructor Details
-
SafeTreeSet
public SafeTreeSet() -
SafeTreeSet
-
SafeTreeSet
-
SafeTreeSet
-
-
Method Details
-
add
-
addAll
-
ceiling
- Specified by:
ceiling
in interfaceNavigableSet<E>
-
clear
-
comparator
- Specified by:
comparator
in interfaceSortedSet<E>
-
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
descendingIterator
- Specified by:
descendingIterator
in interfaceNavigableSet<E>
-
descendingSet
- Specified by:
descendingSet
in interfaceNavigableSet<E>
-
first
-
floor
- Specified by:
floor
in interfaceNavigableSet<E>
-
headSet
-
headSet
- Specified by:
headSet
in interfaceNavigableSet<E>
-
higher
- Specified by:
higher
in interfaceNavigableSet<E>
-
isEmpty
-
iterator
-
last
-
lower
- Specified by:
lower
in interfaceNavigableSet<E>
-
pollFirst
- Specified by:
pollFirst
in interfaceNavigableSet<E>
-
pollLast
- Specified by:
pollLast
in interfaceNavigableSet<E>
-
remove
-
removeAll
-
retainAll
-
size
-
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) - Specified by:
subSet
in interfaceNavigableSet<E>
-
subSet
-
tailSet
-
tailSet
- Specified by:
tailSet
in interfaceNavigableSet<E>
-
toArray
-
toArray
-
equals
-
hashCode
-
toString
-