• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:47:59 PST 2010 -->
6<TITLE>
7Multiset.Entry (Guava Libraries 2010.01.04)
8</TITLE>
9
10<META NAME="date" CONTENT="2010-01-04">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="Multiset.Entry (Guava Libraries 2010.01.04)";
19    }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39  <TR ALIGN="center" VALIGN="top">
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Multiset.Entry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../com/google/common/collect/Multisets.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../index.html?com/google/common/collect/Multiset.Entry.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="Multiset.Entry.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<SCRIPT type="text/javascript">
64  <!--
65  if(window==top) {
66    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67  }
68  //-->
69</SCRIPT>
70<NOSCRIPT>
71  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
72</NOSCRIPT>
73
74
75</FONT></TD>
76</TR>
77<TR>
78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82</TR>
83</TABLE>
84<A NAME="skip-navbar_top"></A>
85<!-- ========= END OF TOP NAVBAR ========= -->
86
87<HR>
88<!-- ======== START OF CLASS DATA ======== -->
89<H2>
90<FONT SIZE="-1">
91com.google.common.collect</FONT>
92<BR>
93Interface Multiset.Entry&lt;E&gt;</H2>
94<DL>
95<DT><B>Enclosing interface:</B><DD><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/Multiset.html" title="type parameter in Multiset">E</A>&gt;</DD>
96</DL>
97<HR>
98<DL>
99<DT><PRE>public static interface <B>Multiset.Entry&lt;E&gt;</B></DL>
100</PRE>
101
102<P>
103An unmodifiable element-count pair for a multiset. The <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A> method returns a view of the multiset whose elements
104 are of this class. A multiset implementation may return Entry instances
105 that are either live "read-through" views to the Multiset, or immutable
106 snapshots. Note that this type is unrelated to the similarly-named type
107 <code>Map.Entry</code>.
108<P>
109
110<P>
111<HR>
112
113<P>
114
115<!-- ========== METHOD SUMMARY =========== -->
116
117<A NAME="method_summary"><!-- --></A>
118<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
119<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
120<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
121<B>Method Summary</B></FONT></TH>
122</TR>
123<TR BGCOLOR="white" CLASS="TableRowColor">
124<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
125<CODE>&nbsp;boolean</CODE></FONT></TD>
126<TD><CODE><B><A HREF="../../../../com/google/common/collect/Multiset.Entry.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</CODE>
127
128<BR>
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
130</TR>
131<TR BGCOLOR="white" CLASS="TableRowColor">
132<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
133<CODE>&nbsp;int</CODE></FONT></TD>
134<TD><CODE><B><A HREF="../../../../com/google/common/collect/Multiset.Entry.html#getCount()">getCount</A></B>()</CODE>
135
136<BR>
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the count of the associated element in the underlying multiset.</TD>
138</TR>
139<TR BGCOLOR="white" CLASS="TableRowColor">
140<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
141<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="type parameter in Multiset.Entry">E</A></CODE></FONT></TD>
142<TD><CODE><B><A HREF="../../../../com/google/common/collect/Multiset.Entry.html#getElement()">getElement</A></B>()</CODE>
143
144<BR>
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the multiset element corresponding to this entry.</TD>
146</TR>
147<TR BGCOLOR="white" CLASS="TableRowColor">
148<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
149<CODE>&nbsp;int</CODE></FONT></TD>
150<TD><CODE><B><A HREF="../../../../com/google/common/collect/Multiset.Entry.html#hashCode()">hashCode</A></B>()</CODE>
151
152<BR>
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
154</TR>
155<TR BGCOLOR="white" CLASS="TableRowColor">
156<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
158<TD><CODE><B><A HREF="../../../../com/google/common/collect/Multiset.Entry.html#toString()">toString</A></B>()</CODE>
159
160<BR>
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the canonical string representation of this entry, defined as
162 follows.</TD>
163</TR>
164</TABLE>
165&nbsp;
166<P>
167
168<!-- ============ METHOD DETAIL ========== -->
169
170<A NAME="method_detail"><!-- --></A>
171<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
172<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
173<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
174<B>Method Detail</B></FONT></TH>
175</TR>
176</TABLE>
177
178<A NAME="getElement()"><!-- --></A><H3>
179getElement</H3>
180<PRE>
181<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="type parameter in Multiset.Entry">E</A> <B>getElement</B>()</PRE>
182<DL>
183<DD>Returns the multiset element corresponding to this entry. Multiple calls
184 to this method always return the same instance.
185<P>
186<DD><DL>
187
188<DT><B>Returns:</B><DD>the element corresponding to this entry</DL>
189</DD>
190</DL>
191<HR>
192
193<A NAME="getCount()"><!-- --></A><H3>
194getCount</H3>
195<PRE>
196int <B>getCount</B>()</PRE>
197<DL>
198<DD>Returns the count of the associated element in the underlying multiset.
199 This count may either be an unchanging snapshot of the count at the time
200 the entry was retrieved, or a live view of the current count of the
201 element in the multiset, depending on the implementation. Note that in
202 the former case, this method can never return zero, while in the latter,
203 it will return zero if all occurrences of the element were since removed
204 from the multiset.
205<P>
206<DD><DL>
207
208<DT><B>Returns:</B><DD>the count of the element; never negative</DL>
209</DD>
210</DL>
211<HR>
212
213<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
214equals</H3>
215<PRE>
216boolean <B>equals</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</PRE>
217<DL>
218<DD>
219
220 <p>Returns <code>true</code> if the given object is also a multiset entry and
221 the two entries represent the same element and count. More formally, two
222 entries <code>a</code> and <code>b</code> are equal if:
223
224 <pre>  ((a.getElement() == null)
225      ? (b.getElement() == null) : a.getElement().equals(b.getElement()))
226    && (a.getCount() == b.getCount())</pre>
227<P>
228<DD><DL>
229<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
230</DD>
231<DD><DL>
232</DL>
233</DD>
234</DL>
235<HR>
236
237<A NAME="hashCode()"><!-- --></A><H3>
238hashCode</H3>
239<PRE>
240int <B>hashCode</B>()</PRE>
241<DL>
242<DD>
243
244 <p>The hash code of a multiset entry for element <code>element</code> and
245 count <code>count</code> is defined as:
246
247 <pre>  (element == null ? 0 : element.hashCode()) ^ count</pre>
248<P>
249<DD><DL>
250<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
251</DD>
252<DD><DL>
253</DL>
254</DD>
255</DL>
256<HR>
257
258<A NAME="toString()"><!-- --></A><H3>
259toString</H3>
260<PRE>
261<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
262<DL>
263<DD>Returns the canonical string representation of this entry, defined as
264 follows. If the count for this entry is one, this is simply the string
265 representation of the corresponding element. Otherwise, it is the string
266 representation of the element, followed by the three characters <code>" x "</code> (space, letter x, space), followed by the count.
267<P>
268<DD><DL>
269<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
270</DD>
271<DD><DL>
272</DL>
273</DD>
274</DL>
275<!-- ========= END OF CLASS DATA ========= -->
276<HR>
277
278
279<!-- ======= START OF BOTTOM NAVBAR ====== -->
280<A NAME="navbar_bottom"><!-- --></A>
281<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
282<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
283<TR>
284<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
285<A NAME="navbar_bottom_firstrow"><!-- --></A>
286<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
287  <TR ALIGN="center" VALIGN="top">
288  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
289  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
290  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
291  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Multiset.Entry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
292  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
293  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
294  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
295  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
296  </TR>
297</TABLE>
298</TD>
299<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
300</EM>
301</TD>
302</TR>
303
304<TR>
305<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
306&nbsp;<A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
307&nbsp;<A HREF="../../../../com/google/common/collect/Multisets.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
308<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
309  <A HREF="../../../../index.html?com/google/common/collect/Multiset.Entry.html" target="_top"><B>FRAMES</B></A>  &nbsp;
310&nbsp;<A HREF="Multiset.Entry.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
311&nbsp;<SCRIPT type="text/javascript">
312  <!--
313  if(window==top) {
314    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
315  }
316  //-->
317</SCRIPT>
318<NOSCRIPT>
319  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
320</NOSCRIPT>
321
322
323</FONT></TD>
324</TR>
325<TR>
326<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
327  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
328<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
329DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
330</TR>
331</TABLE>
332<A NAME="skip-navbar_bottom"></A>
333<!-- ======== END OF BOTTOM NAVBAR ======= -->
334
335<HR>
336
337</BODY>
338</HTML>
339