Class AbstractMultiValuedMap.KeysMultiSet

java.lang.Object
java.util.AbstractCollection<K>
org.apache.commons.collections4.multiset.AbstractMultiSet<K>
org.apache.commons.collections4.multimap.AbstractMultiValuedMap.KeysMultiSet
All Implemented Interfaces:
Iterable<K>, Collection<K>, MultiSet<K>
Enclosing class:
AbstractMultiValuedMap<K,V>

private final class AbstractMultiValuedMap.KeysMultiSet extends AbstractMultiSet<K>
Inner class that provides a MultiSet keys view.
  • Constructor Details

    • KeysMultiSet

      private KeysMultiSet()
  • Method Details

    • contains

      public boolean contains(Object o)
      Description copied from class: AbstractMultiSet
      Determines if the multiset contains the given element.
      Specified by:
      contains in interface Collection<K>
      Overrides:
      contains in class AbstractMultiSet<K>
      Parameters:
      o - The object to search for
      Returns:
      true if the multiset contains the given element
    • createEntrySetIterator

      protected Iterator<MultiSet.Entry<K>> createEntrySetIterator()
      Description copied from class: AbstractMultiSet
      Creates an entry set iterator. Subclasses can override this to return iterators with different properties.
      Specified by:
      createEntrySetIterator in class AbstractMultiSet<K>
      Returns:
      The entrySet iterator
    • getCount

      public int getCount(Object object)
      Description copied from class: AbstractMultiSet
      Gets the number of occurrence of the given element in this multiset by iterating over its entrySet.
      Specified by:
      getCount in interface MultiSet<K>
      Overrides:
      getCount in class AbstractMultiSet<K>
      Parameters:
      object - The object to search for
      Returns:
      The number of occurrences of the object, zero if not found
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<K>
      Overrides:
      isEmpty in class AbstractCollection<K>
    • size

      public int size()
      Description copied from class: AbstractMultiSet
      Returns the number of elements in this multiset.
      Specified by:
      size in interface Collection<K>
      Specified by:
      size in interface MultiSet<K>
      Overrides:
      size in class AbstractMultiSet<K>
      Returns:
      current size of the multiset, or Integer.MAX_VALUE if the total exceeds it.
    • uniqueElements

      protected int uniqueElements()
      Description copied from class: AbstractMultiSet
      Returns the number of unique elements in this multiset.
      Specified by:
      uniqueElements in class AbstractMultiSet<K>
      Returns:
      The number of unique elements