Class OrderedSet<T>
java.lang.Object
org.javimmutable.collections.common.AbstractSet<T>
org.javimmutable.collections.common.AbstractSetUsingMap<T>
org.javimmutable.collections.inorder.OrderedSet<T>
- All Implemented Interfaces:
Serializable
,Iterable<T>
,ICollection<T>
,InvariantCheckable
,ISet<T>
,IStreamable<T>
,Mapped<T,
,T> SplitableIterable<T>
ISet
implementation built on top of an ordered set. During iteration
elements are returned in the same order they were inserted into the set. Performance is
slower than hash or tree sets but should be sufficient for most algorithms where insert
order matters.- See Also:
-
Field Summary
Fields inherited from class org.javimmutable.collections.common.AbstractSetUsingMap
map
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ISetBuilder
<T> builder()
Implemented by derived classes to create a new instance of the appropriate class.Implemented by derived classes to create a new empty Setstatic <T> OrderedSet
<T> of()
Returns a Collector that creates a set of the same type as this containing all of the collected values inserted over whatever starting values this already contained.Methods inherited from class org.javimmutable.collections.common.AbstractSetUsingMap
checkInvariants, checkSetInvariants, contains, delete, deleteAll, getSpliteratorCharacteristics, insert, intersection, intersection, isEmpty, iterator, size, union
Methods inherited from class org.javimmutable.collections.common.AbstractSet
containsAll, containsAll, containsAny, containsAny, deleteAll, equals, getSet, hashCode, insertAll, insertAll, intersection, intersection, toString, union
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.javimmutable.collections.ICollection
isNonEmpty
Methods inherited from interface org.javimmutable.collections.ISet
find, get, getValueOr, reject, select
Methods inherited from interface org.javimmutable.collections.IStreamable
parallelStream, spliterator, stream
Methods inherited from interface org.javimmutable.collections.SplitableIterable
forEachThrows, indexedForEach, indexedForEachThrows, reduce, reduceThrows
-
Method Details
-
of
-
builder
-
deleteAll
-
setCollector
Description copied from interface:ISet
Returns a Collector that creates a set of the same type as this containing all of the collected values inserted over whatever starting values this already contained.- Specified by:
setCollector
in interfaceISet<T>
-
create
Description copied from class:AbstractSetUsingMap
Implemented by derived classes to create a new instance of the appropriate class.- Specified by:
create
in classAbstractSetUsingMap<T>
-
emptyMutableSet
Description copied from class:AbstractSet
Implemented by derived classes to create a new empty Set- Specified by:
emptyMutableSet
in classAbstractSet<T>
-