Package org.apache.cxf.common.util
Class SortedArraySet<T>
- java.lang.Object
- 
- org.apache.cxf.common.util.SortedArraySet<T>
 
- 
- Type Parameters:
- T-
 - All Implemented Interfaces:
- Iterable<T>,- Collection<T>,- Set<T>,- SortedSet<T>
 
 public final class SortedArraySet<T> extends Object implements SortedSet<T> This class implements most of the Set interface, backed by a sorted Array. This makes iterators very fast, lookups are log(n), but adds are fairly expensive. This class is also threadsafe, but without synchronizations. Lookups and iterators will iterate over the state of the Set when the iterator was created. If no data is stored in the Set, it uses very little memory. The backing array is created on demand. This class is primarily useful for stuff that will be setup at startup, but then iterated over MANY times during runtime.
- 
- 
Constructor SummaryConstructors Constructor Description SortedArraySet()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T o)booleanaddAll(Collection<? extends T> c)voidclear()Comparator<? super T>comparator()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object o)Tfirst()inthashCode()SortedSet<T>headSet(T toElement)booleanisEmpty()Iterator<T>iterator()Tlast()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()SortedSet<T>subSet(T fromElement, T toElement)SortedSet<T>tailSet(T fromElement)Object[]toArray()<X> X[]toArray(X[] a)StringtoString()- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
 - 
Methods inherited from interface java.util.SortedSetspliterator
 
- 
 
- 
- 
- 
Method Detail- 
clearpublic void clear() 
 - 
isEmptypublic boolean isEmpty() 
 - 
sizepublic int size() 
 - 
addpublic boolean add(T o) 
 - 
addAllpublic boolean addAll(Collection<? extends T> c) 
 - 
containsAllpublic boolean containsAll(Collection<?> c) - Specified by:
- containsAllin interface- Collection<T>
- Specified by:
- containsAllin interface- Set<T>
 
 - 
containspublic boolean contains(Object o) 
 - 
removeAllpublic boolean removeAll(Collection<?> c) 
 - 
retainAllpublic boolean retainAll(Collection<?> c) 
 - 
removepublic boolean remove(Object o) 
 - 
toArraypublic Object[] toArray() 
 - 
toArraypublic <X> X[] toArray(X[] a) 
 - 
equalspublic boolean equals(Object o) 
 - 
hashCodepublic int hashCode() 
 - 
comparatorpublic Comparator<? super T> comparator() - Specified by:
- comparatorin interface- SortedSet<T>
 
 
- 
 
-