Package com.google.common.collect
Class Multisets.ImmutableEntry<E>
- java.lang.Object
-
- com.google.common.collect.Multisets.AbstractEntry<E>
-
- com.google.common.collect.Multisets.ImmutableEntry<E>
-
- All Implemented Interfaces:
Multiset.Entry<E>
,java.io.Serializable
- Direct Known Subclasses:
RegularImmutableMultiset.NonTerminalEntry
- Enclosing class:
- Multisets
static class Multisets.ImmutableEntry<E> extends Multisets.AbstractEntry<E> implements java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description private int
count
private E
element
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ImmutableEntry(E element, int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCount()
Returns the count of the associated element in the underlying multiset.E
getElement()
Returns the multiset element corresponding to this entry.Multisets.ImmutableEntry<E>
nextInBucket()
-
Methods inherited from class com.google.common.collect.Multisets.AbstractEntry
equals, hashCode, toString
-
-
-
-
Field Detail
-
element
@Nullable private final E element
-
count
private final int count
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
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 interfaceMultiset.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 interfaceMultiset.Entry<E>
- Returns:
- the count of the element; never negative
-
nextInBucket
public Multisets.ImmutableEntry<E> nextInBucket()
-
-