com.google.common.collect
Interface Multiset.Entry<E>

All Known Implementing Classes:
AbstractMultisetEntry
Enclosing interface:
Multiset<E>

public static interface Multiset.Entry<E>

A multiset entry (element-count pair). The Multiset.entrySet() method returns a view of the multiset whose elements are of this class. The behavior of a previously retrieved Entry instance after the underlying multiset has been modified is undefined.


Method Summary
 boolean equals(Object o)
          
 int getCount()
          Returns the number of occurrences of the corresponding element in the multiset.
 E getElement()
          Returns the multiset element corresponding to this entry.
 int hashCode()
          
 

Method Detail

getElement

E getElement()
Returns the multiset element corresponding to this entry.

Returns:
the element corresponding to this entry.

getCount

int getCount()
Returns the number of occurrences of the corresponding element in the multiset.

Returns:
the count for the element; always strictly greater than zero

equals

boolean equals(Object o)

Returns true if the given object is also a multiset entry and the two entries represent the same element and count. More formally, two entries a and b are equal if:

  ((a.getElement() == null)
      ? (b.getElement() == null) : a.getElement().equals(b.getElement()))
    && (a.getCount() == b.getCount())

Overrides:
equals in class Object

hashCode

int hashCode()

The hash code of a multiset entry e is defined to be:

  ((e.getElement() == null) ? 0 : e.getElement().hashCode())
    ^ e.getCount()

Overrides:
hashCode in class Object