Class AbstractMultiValuedMap.KeysMultiSet

  • All Implemented Interfaces:
    java.lang.Iterable<K>, java.util.Collection<K>, MultiSet<K>
    Enclosing class:
    AbstractMultiValuedMap<K,​V>

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

      • KeysMultiSet

        private KeysMultiSet()
    • Method Detail

      • contains

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

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

        public int size()
        Description copied from class: AbstractMultiSet
        Returns the number of elements in this multiset.
        Specified by:
        size in interface java.util.Collection<K>
        Specified by:
        size in interface MultiSet<K>
        Overrides:
        size in class AbstractMultiSet<K>
        Returns:
        current size of the multiset
      • 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
      • getCount

        public int getCount​(java.lang.Object object)
        Description copied from class: AbstractMultiSet
        Returns 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
      • createEntrySetIterator

        protected java.util.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