Class SafeTreeSet<E>
- java.lang.Object
-
- com.google.common.collect.testing.SafeTreeSet<E>
-
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,NavigableSet<E>,Set<E>,SortedSet<E>
@GwtIncompatible public final class SafeTreeSet<E> extends Object implements Serializable, NavigableSet<E>
A wrapper aroundTreeSetthat aggressively checks to see if elements are mutually comparable. This implementation passes the navigable set test suites.- Author:
- Louis Wasserman
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SafeTreeSet()SafeTreeSet(Collection<? extends E> collection)SafeTreeSet(Comparator<? super E> comparator)SafeTreeSet(SortedSet<E> set)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E element)booleanaddAll(Collection<? extends E> collection)Eceiling(E e)voidclear()Comparator<? super E>comparator()booleancontains(Object object)booleancontainsAll(Collection<?> c)Iterator<E>descendingIterator()NavigableSet<E>descendingSet()booleanequals(Object obj)Efirst()Efloor(E e)inthashCode()SortedSet<E>headSet(E toElement)NavigableSet<E>headSet(E toElement, boolean inclusive)Ehigher(E e)booleanisEmpty()Iterator<E>iterator()Elast()Elower(E e)EpollFirst()EpollLast()booleanremove(Object object)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()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)Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
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.SortedSet
spliterator
-
-
-
-
Constructor Detail
-
SafeTreeSet
public SafeTreeSet()
-
SafeTreeSet
public SafeTreeSet(Collection<? extends E> collection)
-
SafeTreeSet
public SafeTreeSet(Comparator<? super E> comparator)
-
SafeTreeSet
public SafeTreeSet(SortedSet<E> set)
-
-
Method Detail
-
addAll
public boolean addAll(Collection<? extends E> collection)
-
clear
public void clear()
-
comparator
public Comparator<? super E> comparator()
- Specified by:
comparatorin interfaceSortedSet<E>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
descendingIterator
public Iterator<E> descendingIterator()
- Specified by:
descendingIteratorin interfaceNavigableSet<E>
-
descendingSet
public NavigableSet<E> descendingSet()
- Specified by:
descendingSetin interfaceNavigableSet<E>
-
headSet
public NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSetin interfaceNavigableSet<E>
-
isEmpty
public boolean isEmpty()
-
pollFirst
public E pollFirst()
- Specified by:
pollFirstin interfaceNavigableSet<E>
-
pollLast
public E pollLast()
- Specified by:
pollLastin interfaceNavigableSet<E>
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
size
public int size()
-
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSetin interfaceNavigableSet<E>
-
tailSet
public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
- Specified by:
tailSetin interfaceNavigableSet<E>
-
toArray
public <T> T[] toArray(T[] a)
-
hashCode
public int hashCode()
-
-