Class Multisets.ViewMultiset<E>

  • All Implemented Interfaces:
    Multiset<E>, java.lang.Iterable<E>, java.util.Collection<E>
    Direct Known Subclasses:
    Multisets.FilteredMultiset
    Enclosing class:
    Multisets

    private abstract static class Multisets.ViewMultiset<E>
    extends AbstractMultiset<E>
    An AbstractMultiset with additional default implementations, some of them linear-time implementations in terms of elementSet and entrySet.
    • Constructor Detail

      • ViewMultiset

        private ViewMultiset()
    • Method Detail

      • size

        public int size()
        Description copied from interface: Multiset
        Returns the total number of all occurrences of all elements in this multiset.

        Note: this method does not return the number of distinct elements in the multiset, which is given by entrySet().size().

        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface Multiset<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in class AbstractMultiset<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Description copied from interface: Multiset

        Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.

        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface Multiset<E>
        Specified by:
        iterator in class java.util.AbstractCollection<E>