Class Multisets.ImmutableEntry<E>

    • Field Detail

      • element

        @Nullable
        private final E element
      • count

        private final int count
    • Constructor Detail

      • ImmutableEntry

        ImmutableEntry​(@Nullable
                       E element,
                       int count)
    • Method Detail

      • getElement

        @Nullable
        public final E getElement()
        Description copied from interface: Multiset.Entry
        Returns the multiset element corresponding to this entry. Multiple calls to this method always return the same instance.
        Specified by:
        getElement in interface Multiset.Entry<E>
        Returns:
        the element corresponding to this entry
      • getCount

        public final int getCount()
        Description copied from interface: Multiset.Entry
        Returns the count of the associated element in the underlying multiset. This count may either be an unchanging snapshot of the count at the time the entry was retrieved, or a live view of the current count of the element in the multiset, depending on the implementation. Note that in the former case, this method can never return zero, while in the latter, it will return zero if all occurrences of the element were since removed from the multiset.
        Specified by:
        getCount in interface Multiset.Entry<E>
        Returns:
        the count of the element; never negative