E - the class of the elements of this list.static class CollectionsExt.ImmutableSortedMultiSet<E> extends CollectionsExt.AbstractImmutableMultiSet<SortedMultiSet<E>,E> implements SortedMultiSet<E>
MultiSet.Multiplicity| Modifier and Type | Field and Description |
|---|---|
private SortedMultiSet<E> |
mSet |
| Constructor and Description |
|---|
ImmutableSortedMultiSet(Set<CollectionsExt.Modification> mods,
SortedMultiSet<E> mSet) |
ImmutableSortedMultiSet(SortedMultiSet<E> mSet)
Creates a new empty
ImmutableSortedMultiSet
which equals mSet but cannot be modified
neither directly nor via its iterator. |
| Modifier and Type | Method and Description |
|---|---|
Comparator<? super E> |
comparator()
Returns the comparator used to order the elements in this set,
or
null
if this set uses the natural ordering of its elements. |
E |
first()
Returns the first (lowest) element currently in this set.
|
NavigableMap<E,MultiSet.Multiplicity> |
getMap()
Returns a view of the underlying map of this
MultiSet
as a map mapping each entry to its multiplicity. |
SortedSet<E> |
getSet()
Returns a view of the underlying set of this
MultiSet. |
SortedMultiSet<E> |
headSet(E toElement)
Returns a view of the portion of this multi-set
whose elements are strictly less than
toElement. |
E |
last()
Returns the last (highest) element currently in this set.
|
SortedMultiSet<E> |
subSet(E fromElement,
E toElement)
Returns a view of the portion of this multi-set
whose elements range from
fromElement inclusively
to toElement exclusively. |
SortedMultiSet<E> |
tailSet(E fromElement)
Returns a view of the portion of this multi-set
whose elements are greater than or equal to
fromElement. |
SortedMultiSet<E> |
unrestricted()
Returns the underlying multiset without the restrictions
imposed by this
CollectionsExt.ImmutableCollection. |
add, addAll, addAll, addWithMult, addWithMult, allowedModifications, clear, contains, containsAll, equals, getMaxMult, getMultiplicity, getMultiplicityObj, getObjWithMaxMult, getSetWithMults, hashCode, isEmpty, iterator, remove, removeAll, removeWithMult, removeWithMult, retainAll, setMultiplicity, size, sizeWithMult, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, addAll, addWithMult, addWithMult, clear, contains, containsAll, equals, getMaxMult, getMultiplicity, getMultiplicityObj, getObjWithMaxMult, getSetWithMults, hashCode, isEmpty, iterator, remove, removeAll, removeWithMult, removeWithMult, retainAll, setMultiplicity, size, sizeWithMult, toArray, toArray, toStringforEach, spliteratorprivate final SortedMultiSet<E> mSet
ImmutableSortedMultiSet(SortedMultiSet<E> mSet)
ImmutableSortedMultiSet
which equals mSet but cannot be modified
neither directly nor via its iterator.
yNullPointerException - if coll==null.ImmutableSortedMultiSet(Set<CollectionsExt.Modification> mods, SortedMultiSet<E> mSet)
public SortedMultiSet<E> unrestricted()
CollectionsExt.AbstractImmutableMultiSetCollectionsExt.ImmutableCollection.
Note that the result
may still throw UnsupportedOperationExceptions
depending on the implementation.unrestricted in class CollectionsExt.AbstractImmutableMultiSet<SortedMultiSet<E>,E>public SortedSet<E> getSet()
MultiSetMultiSet.
For certain implementations, this set is immutable
to prevent implicit modification of this MultiSet.getSet in interface MultiSet<E>getSet in interface SortedMultiSet<E>getSet in class CollectionsExt.AbstractImmutableMultiSet<SortedMultiSet<E>,E>Set containing exactly the objects
with strictly positive multiplicity in this MultiSet.public NavigableMap<E,MultiSet.Multiplicity> getMap()
MultiSetMultiSet
as a map mapping each entry to its multiplicity.getMap in interface MultiSet<E>getMap in interface SortedMultiSet<E>getMap in class CollectionsExt.AbstractImmutableMultiSet<SortedMultiSet<E>,E>public Comparator<? super E> comparator()
SortedMultiSetnull
if this set uses the natural ordering of its elements.comparator in interface SortedMultiSet<E>null
if this set uses the natural ordering of its elements.public E first()
SortedMultiSetfirst in interface SortedMultiSet<E>public E last()
SortedMultiSetlast in interface SortedMultiSet<E>public SortedMultiSet<E> headSet(E toElement)
SortedMultiSettoElement.
The returned multi-set is backed by this multi-set,
so changes in the returned set are reflected in this multi-set,
and vice-versa.
The returned multi-set supports all optional multi-set operations
that this multi-set supports.
The returned multi-set
will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
headSet in interface SortedMultiSet<E>toElement - high endpoint (exclusive) of the returned multi-set.toElement.public SortedMultiSet<E> tailSet(E fromElement)
SortedMultiSetfromElement.
The returned multi-set is backed by this multi-set,
so changes in the returned set are reflected in this multi-set,
and vice-versa.
The returned multi-set supports all optional multi-set operations
that this multi-set supports.
The returned multi-set
will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
tailSet in interface SortedMultiSet<E>fromElement - low endpoint (inclusive) of the returned multi-set.fromElement.public SortedMultiSet<E> subSet(E fromElement, E toElement)
SortedMultiSetfromElement inclusively
to toElement exclusively.
The returned multi-set is backed by this multi-set,
so changes in the returned set are reflected in this multi-set,
and vice-versa.
The returned multi-set supports all optional multi-set operations
that this multi-set supports.
The returned multi-set
will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
subSet in interface SortedMultiSet<E>fromElement - low endpoint (inclusive) of the returned multi-set.toElement - high endpoint (exclusive) of the returned multi-set.fromElement inclusively
to toElement exclusively.Copyright © 2012–2018 Simuline Organization (l2r). All rights reserved.