Package org.apache.commons.collections4.multiset

# Class AbstractSortedMultiSetDecorator<E>

java.lang.Object
org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
org.apache.commons.collections4.multiset.AbstractMultiSetDecorator<E>
org.apache.commons.collections4.multiset.AbstractSortedMultiSetDecorator<E>

Type Parameters:
  `E` - The type held in the multiset

All Implemented Interfaces:
  `Serializable`, `Iterable<E>`, `Collection<E>`, `MultiSet<E>`, `SortedMultiSet<E>`

Direct Known Subclasses:
  `UnmodifiableSortedMultiSet`

public abstract class AbstractSortedMultiSetDecorator<E> extends AbstractMultiSetDecorator<E> implements SortedMultiSet<E>
Decorates another `SortedMultiSet` to provide additional behavior.

Methods are forwarded directly to the decorated multiset.

Since:
  4.6.0
See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.commons.collections4.MultiSet

  `MultiSet.Entry<E>`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractSortedMultiSetDecorator()`
  Constructor only used in deserialization, do not use otherwise.
  `protected`
  `AbstractSortedMultiSetDecorator(SortedMultiSet<E> multiset)`
  Constructor that wraps (not copies).

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Comparator<? super E>`
  `comparator()`
  Returns the comparator associated with this sorted multiset, or null if it uses its elements' natural ordering.
  `protected SortedMultiSet<E>`
  `decorated()`
  Gets the multiset being decorated.
  `E`
  `first()`
  Returns the first (lowest) member.
  `E`
  `last()`
  Returns the last (highest) member.

  ### Methods inherited from class org.apache.commons.collections4.multiset.AbstractMultiSetDecorator

  `add, entrySet, equals, getCount, hashCode, remove, setCount, uniqueSet`

  ### Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator

  `add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, setCollection, size, toArray, toArray, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Collection

  `addAll, clear, contains, isEmpty, parallelStream, removeIf, spliterator, stream, toArray, toArray`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

  ### Methods inherited from interface org.apache.commons.collections4.MultiSet

  `add, add, containsAll, entrySet, equals, getCount, hashCode, iterator, remove, remove, removeAll, retainAll, setCount, size, uniqueSet`

- ## Constructor Details

  - ### AbstractSortedMultiSetDecorator

    protected AbstractSortedMultiSetDecorator()
    Constructor only used in deserialization, do not use otherwise.

  - ### AbstractSortedMultiSetDecorator

    protected AbstractSortedMultiSetDecorator(SortedMultiSet<E> multiset)
    Constructor that wraps (not copies).
    Parameters:
      `multiset` - The multiset to decorate, must not be null
    Throws:
      `NullPointerException` - if multiset is null

- ## Method Details

  - ### comparator

    public Comparator<? super E> comparator()
    Description copied from interface: `SortedMultiSet`
    Returns the comparator associated with this sorted multiset, or null if it uses its elements' natural ordering.
    Specified by:
      `comparator` in interface `SortedMultiSet<E>`
    Returns:
      The comparator in use, or null if natural ordering.

  - ### decorated

    protected SortedMultiSet<E> decorated()
    Gets the multiset being decorated.
    Overrides:
      `decorated` in class `AbstractMultiSetDecorator<E>`
    Returns:
      The decorated multiset

  - ### first

    public E first()
    Description copied from interface: `SortedMultiSet`
    Returns the first (lowest) member.
    Specified by:
      `first` in interface `SortedMultiSet<E>`
    Returns:
      The first element in the sorted multiset.

  - ### last

    public E last()
    Description copied from interface: `SortedMultiSet`
    Returns the last (highest) member.
    Specified by:
      `last` in interface `SortedMultiSet<E>`
    Returns:
      The last element in the sorted multiset.