# Class AbstractMultiSet.UniqueSet<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.apache.commons.collections4.multiset.AbstractMultiSet.UniqueSet<E>

Type Parameters:
  `E` - the element type.

All Implemented Interfaces:
  `Iterable<E>`, `Collection<E>`, `Set<E>`

Enclosing class:
  `AbstractMultiSet<E>`

protected static class AbstractMultiSet.UniqueSet<E> extends AbstractSet<E>
Inner class UniqueSet.

Since:
  4.1

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final AbstractMultiSet<E>`
  `parent`
  The parent multiset

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `UniqueSet(AbstractMultiSet<E> parent)`
  Constructs a new unique element view of the MultiSet.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  `boolean`
  `contains(Object key)`
  `boolean`
  `containsAll(Collection<?> coll)`
  `Iterator<E>`
  `iterator()`
  `boolean`
  `remove(Object key)`
  `int`
  `size()`

  ### Methods inherited from class java.util.AbstractSet

  `equals, hashCode, removeAll`

  ### Methods inherited from class java.util.AbstractCollection

  `add, addAll, isEmpty, retainAll, 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

  `parallelStream, removeIf, stream`

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

  `forEach`

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

  `add, addAll, isEmpty, retainAll, spliterator, toArray, toArray`

- ## Field Details

  - ### parent

    protected final AbstractMultiSet<E> parent
    The parent multiset

- ## Constructor Details

  - ### UniqueSet

    protected UniqueSet(AbstractMultiSet<E> parent)
    Constructs a new unique element view of the MultiSet.
    Parameters:
      `parent` - the parent MultiSet

- ## Method Details

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `Collection<E>`
    Specified by:
      `clear` in interface `Set<E>`
    Overrides:
      `clear` in class `AbstractCollection<E>`

  - ### contains

    public boolean contains(Object key)
    Specified by:
      `contains` in interface `Collection<E>`
    Specified by:
      `contains` in interface `Set<E>`
    Overrides:
      `contains` in class `AbstractCollection<E>`

  - ### containsAll

    public boolean containsAll(Collection<?> coll)
    Specified by:
      `containsAll` in interface `Collection<E>`
    Specified by:
      `containsAll` in interface `Set<E>`
    Overrides:
      `containsAll` in class `AbstractCollection<E>`

  - ### iterator

    public Iterator<E> iterator()
    Specified by:
      `iterator` in interface `Collection<E>`
    Specified by:
      `iterator` in interface `Iterable<E>`
    Specified by:
      `iterator` in interface `Set<E>`
    Specified by:
      `iterator` in class `AbstractCollection<E>`

  - ### remove

    public boolean remove(Object key)
    Specified by:
      `remove` in interface `Collection<E>`
    Specified by:
      `remove` in interface `Set<E>`
    Overrides:
      `remove` in class `AbstractCollection<E>`

  - ### size

    public int size()
    Specified by:
      `size` in interface `Collection<E>`
    Specified by:
      `size` in interface `Set<E>`
    Specified by:
      `size` in class `AbstractCollection<E>`