MultiSet to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| private | UnmodifiableMultiSet(final MultiSet<? extends E>
the multiset to decorate, may not be null multiset)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(final E
the object to add object)Overrides org. Implements org. |
| public int | add(final E
the object to add object, final int the number of occurrences to add, may be zero,
in which case no change is made to the multiset count)Overrides org. Implements org. |
| public boolean | addAll(final Collection<? extends E>
collection containing elements to be added to this collection coll)Overrides org. Implements java. |
| public void | clear()
Overrides org. Implements java. |
| public Set | entrySet()
Overrides org. Implements org. Set of all entries contained in the MultiSet.
|
| public Iterator | iterator()
Overrides org. Implements org. Iterator over the entire set of members,
including copies due to cardinality.
|
| private void | readObject(final ObjectInputStream
the input stream in)Read the collection in using a custom routine. |
| public boolean | remove(final Object
the object to remove object)Overrides org. Implements org. |
| public int | remove(final Object
the object to remove object, final int the number of occurrences to remove, may be zero,
in which case no change is made to the multiset count)Overrides org. Implements org. |
| public boolean | removeAll(final Collection<?>
the collection of elements to remove coll)Overrides org. Implements org. |
| public boolean | removeIf(Predicate<? super E>
a predicate which returns filter)true for elements to be
removedOverrides org. Overrides default java. |
| public boolean | retainAll(final Collection<?>
the collection of elements to retain coll)Overrides org. Implements org. |
| public int | setCount(final E
the object to update object, final int the number of occurrences of the object count)Overrides org. Implements org. |
| public Set | uniqueSet()
Overrides org. Implements org. Set of unique elements in the MultiSet.
|
| public static < the type of the elements in the multiset E> MultiSet | Returns: an unmodifiable MultiSetthe multiset to decorate, may not be null multiset)Factory method to create an unmodifiable multiset. |
| private void | writeObject(final ObjectOutputStream
the output stream out)Write the collection out using a custom routine. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| UnmodifiableMultiSet | back to summary |
|---|---|
| private UnmodifiableMultiSet(final MultiSet<? extends E> multiset) Constructor that wraps (not copies).
| |
| add | back to summary |
|---|---|
| public boolean add(final E object) Overrides org. Implements org. Doc from org. Adds one copy of the specified object to the MultiSet.
If the object is already in the
| |
| add | back to summary |
|---|---|
| public int add(final E object, final int count) Overrides org. Implements org. Doc from org. Adds a number of occurrences of the specified object to the MultiSet.
If the object is already in the
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(final Collection<? extends E> coll) Overrides org. Implements java. Doc from java. Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) If the specified collection has a defined encounter order, processing of its elements generally occurs in that order.
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Implements java. Doc from java. Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.
| |
| entrySet | back to summary |
|---|---|
| public Set Overrides org. Implements org. Doc from org. Returns a The returned set is backed by this multiset, so any change to either is immediately reflected in the other. | |
| iterator | back to summary |
|---|---|
| public Iterator Overrides org. Implements org. Doc from org. Returns an | |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException Read the collection in using a custom routine.
| |
| remove | back to summary |
|---|---|
| public boolean remove(final Object object) Overrides org. Implements org. Doc from org. Removes one occurrence of the given object from the MultiSet.
If the number of occurrences after this operations is reduced
to zero, the object will be removed from the | |
| remove | back to summary |
|---|---|
| public int remove(final Object object, final int count) Overrides org. Implements org. Doc from org. Removes a number of occurrences of the specified object from the MultiSet. If the number of occurrences to remove is greater than the actual number of occurrences in the multiset, the object will be removed from the multiset. | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(final Collection<?> coll) Overrides org. Implements org. Doc from org. Remove all occurrences of all elements from this MultiSet represented in the given collection.
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super E> filter) Overrides org. Overrides default java. Doc from java. Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller. | |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(final Collection<?> coll) Overrides org. Implements org. Doc from org. Remove any elements of this MultiSet that are not contained in the given collection.
| |
| setCount | back to summary |
|---|---|
| public int setCount(final E object, final int count) Overrides org. Implements org. Doc from org. Sets the number of occurrences of the specified object in the MultiSet to the given count.
If the provided count is zero, the object will be removed from the
| |
| uniqueSet | back to summary |
|---|---|
| public Set Overrides org. Implements org. Doc from org. Returns a
Uniqueness constraints are the same as those in The returned set is backed by this multiset, so any change to either is immediately reflected in the other. Only removal operations are supported, in which case all occurrences of the element are removed from the backing multiset. | |
| unmodifiableMultiSet | back to summary |
|---|---|
| public static <E> MultiSet Factory method to create an unmodifiable multiset. If the multiset passed in is already unmodifiable, it is returned.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(final ObjectOutputStream out) throws IOException Write the collection out using a custom routine.
| |