Class OrderedMultiset<T>
java.lang.Object
org.javimmutable.collections.common.AbstractMultiset<T>
org.javimmutable.collections.inorder.OrderedMultiset<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,ICollection<T>,IMultiset<T>,InvariantCheckable,ISet<T>,IStreamable<T>,Mapped<T,,T> SplitableIterable<T>
IMultiset implementation built on top of an ordered map. 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.AbstractMultiset
map, occurrences -
Method Summary
Modifier and TypeMethodDescriptionprotected OrderedMultiset<T> Implemented by derived classes to create a new instance of the appropriate class.Implemented by derived classes to create a new empty mutable Map that operates in the same way as this multiset's underlying immutable Map.Returns a Collector that creates a multiset of the same type as this containing all of the collected values inserted over whatever starting values this already contained.static <T> OrderedMultiset<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.AbstractMultiset
checkInvariants, contains, containsAll, containsAll, containsAllOccurrences, containsAllOccurrences, containsAllOccurrences, containsAny, containsAny, containsAtLeast, count, delete, deleteAll, deleteAll, deleteAllOccurrences, deleteAllOccurrences, deleteAllOccurrences, deleteOccurrence, deleteOccurrence, entries, equals, getSet, getSpliteratorCharacteristics, hashCode, insert, insert, insertAll, insertAll, insertAll, intersection, intersection, intersection, intersection, intersection, isEmpty, iterator, occurrenceCount, occurrences, setCount, size, toString, union, union, unionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.javimmutable.collections.ICollection
isNonEmptyMethods inherited from interface org.javimmutable.collections.ISet
find, get, getValueOr, reject, selectMethods inherited from interface org.javimmutable.collections.IStreamable
parallelStream, spliterator, streamMethods inherited from interface org.javimmutable.collections.SplitableIterable
forEachThrows, indexedForEach, indexedForEachThrows, reduce, reduceThrows
-
Method Details
-
of
-
deleteAll
-
setCollector
Description copied from interface:ISetReturns 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:
setCollectorin interfaceISet<T>
-
multisetCollector
Description copied from interface:IMultisetReturns a Collector that creates a multiset of the same type as this containing all of the collected values inserted over whatever starting values this already contained.- Specified by:
multisetCollectorin interfaceIMultiset<T>
-
create
Description copied from class:AbstractMultisetImplemented by derived classes to create a new instance of the appropriate class.- Specified by:
createin classAbstractMultiset<T>- Parameters:
map- base map for new multisetoccurrences- total occurrences in map- Returns:
- new multiset built from map
-
emptyMutableMap
Description copied from class:AbstractMultisetImplemented by derived classes to create a new empty mutable Map that operates in the same way as this multiset's underlying immutable Map.- Specified by:
emptyMutableMapin classAbstractMultiset<T>- Returns:
- new empty Counter
-