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>
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
- 
Method SummaryModifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c) voidclear()Comparator<? super T>booleanbooleancontainsAll(Collection<?> c) booleanfirst()inthashCode()booleanisEmpty()iterator()last()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<X> X[]toArray(X[] a) toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.SortedSetspliterator
- 
Constructor Details- 
SortedArraySetpublic SortedArraySet()
 
- 
- 
Method Details- 
clearpublic void clear()
- 
isEmptypublic boolean isEmpty()
- 
iterator
- 
sizepublic int size()
- 
add
- 
addAll
- 
containsAll- Specified by:
- containsAllin interface- Collection<T>
- Specified by:
- containsAllin interface- Set<T>
 
- 
contains
- 
removeAll
- 
retainAll
- 
remove
- 
toArray
- 
toArraypublic <X> X[] toArray(X[] a) 
- 
equals
- 
toString
- 
hashCodepublic int hashCode()
- 
comparator- Specified by:
- comparatorin interface- SortedSet<T>
 
- 
first
- 
last
- 
headSet
- 
subSet
- 
tailSet
 
-