• 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:58 PST 2010 -->
6<TITLE>
7ImmutableMultiset (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="ImmutableMultiset (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/ImmutableMultiset.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/ImmutableMultimap.Builder.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.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/ImmutableMultiset.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="ImmutableMultiset.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;<A HREF="#nested_class_summary">NESTED</A>&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>
93Class ImmutableMultiset&lt;E&gt;</H2>
94<PRE>
95<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/google/common/collect/ImmutableCollection.html" title="class in com.google.common.collect">com.google.common.collect.ImmutableCollection</A>&lt;E&gt;
97      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.ImmutableMultiset&lt;E&gt;</B>
98</PRE>
99<DL>
100<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;E&gt;, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;E&gt;, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;E&gt;</DD>
101</DL>
102<HR>
103<DL>
104<DT><PRE>public class <B>ImmutableMultiset&lt;E&gt;</B><DT>extends <A HREF="../../../../com/google/common/collect/ImmutableCollection.html" title="class in com.google.common.collect">ImmutableCollection</A>&lt;E&gt;<DT>implements <A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;E&gt;</DL>
105</PRE>
106
107<P>
108An immutable hash-based multiset. Does not permit null elements.
109
110 <p>Its iterator orders elements according to the first appearance of the
111 element among the items passed to the factory method or builder. When the
112 multiset contains multiple instances of an element, those instances are
113 consecutive in the iteration order.
114<P>
115
116<P>
117<DL>
118<DT><B>Since:</B></DT>
119  <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD>
120<DT><B>Author:</B></DT>
121  <DD>Jared Levy</DD>
122<DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#com.google.common.collect.ImmutableMultiset">Serialized Form</A></DL>
123<HR>
124
125<P>
126<!-- ======== NESTED CLASS SUMMARY ======== -->
127
128<A NAME="nested_class_summary"><!-- --></A>
129<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
130<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
131<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
132<B>Nested Class Summary</B></FONT></TH>
133</TR>
134<TR BGCOLOR="white" CLASS="TableRowColor">
135<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
136<CODE>static&nbsp;class</CODE></FONT></TD>
137<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.html" title="class in com.google.common.collect">ImmutableMultiset.Builder</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.html" title="type parameter in ImmutableMultiset.Builder">E</A>&gt;</B></CODE>
138
139<BR>
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A builder for creating immutable multiset instances, especially
141 <code>public static final</code> multisets ("constant multisets").</TD>
142</TR>
143</TABLE>
144&nbsp;<A NAME="nested_classes_inherited_from_class_com.google.common.collect.Multiset"><!-- --></A>
145<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
146<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
147<TH ALIGN="left"><B>Nested classes/interfaces inherited from interface com.google.common.collect.<A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A></B></TH>
148</TR>
149<TR BGCOLOR="white" CLASS="TableRowColor">
150<TD><CODE><A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="interface in com.google.common.collect">Multiset.Entry</A>&lt;<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="type parameter in Multiset.Entry">E</A>&gt;</CODE></TD>
151</TR>
152</TABLE>
153&nbsp;
154
155<!-- ========== METHOD SUMMARY =========== -->
156
157<A NAME="method_summary"><!-- --></A>
158<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
159<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
160<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
161<B>Method Summary</B></FONT></TH>
162</TR>
163<TR BGCOLOR="white" CLASS="TableRowColor">
164<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
165<CODE>&nbsp;int</CODE></FONT></TD>
166<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#add(E, int)">add</A></B>(<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&nbsp;element,
167    int&nbsp;occurrences)</CODE>
168
169<BR>
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guaranteed to throw an exception and leave the collection unmodified.</TD>
171</TR>
172<TR BGCOLOR="white" CLASS="TableRowColor">
173<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
174<CODE>static
175<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
176<TR ALIGN="right" VALIGN="">
177<TD NOWRAP><FONT SIZE="-1">
178<CODE>&lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.html" title="class in com.google.common.collect">ImmutableMultiset.Builder</A>&lt;E&gt;</CODE></FONT></TD>
179</TR>
180</TABLE>
181</CODE></FONT></TD>
182<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#builder()">builder</A></B>()</CODE>
183
184<BR>
185&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new builder.</TD>
186</TR>
187<TR BGCOLOR="white" CLASS="TableRowColor">
188<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
189<CODE>&nbsp;boolean</CODE></FONT></TD>
190<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#contains(java.lang.Object)">contains</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;element)</CODE>
191
192<BR>
193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines whether this multiset contains the specified element.</TD>
194</TR>
195<TR BGCOLOR="white" CLASS="TableRowColor">
196<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
197<CODE>static
198<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
199<TR ALIGN="right" VALIGN="">
200<TD NOWRAP><FONT SIZE="-1">
201<CODE>&lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt;</CODE></FONT></TD>
202</TR>
203</TABLE>
204</CODE></FONT></TD>
205<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#copyOf(java.lang.Iterable)">copyOf</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;? extends E&gt;&nbsp;elements)</CODE>
206
207<BR>
208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an immutable multiset containing the given elements.</TD>
209</TR>
210<TR BGCOLOR="white" CLASS="TableRowColor">
211<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
212<CODE>static
213<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
214<TR ALIGN="right" VALIGN="">
215<TD NOWRAP><FONT SIZE="-1">
216<CODE>&lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt;</CODE></FONT></TD>
217</TR>
218</TABLE>
219</CODE></FONT></TD>
220<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#copyOf(java.util.Iterator)">copyOf</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A>&lt;? extends E&gt;&nbsp;elements)</CODE>
221
222<BR>
223&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an immutable multiset containing the given elements.</TD>
224</TR>
225<TR BGCOLOR="white" CLASS="TableRowColor">
226<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
227<CODE>&nbsp;int</CODE></FONT></TD>
228<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#count(java.lang.Object)">count</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;element)</CODE>
229
230<BR>
231&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of occurrences of an element in this multiset (the
232 <i>count</i> of the element).</TD>
233</TR>
234<TR BGCOLOR="white" CLASS="TableRowColor">
235<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
236<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></FONT></TD>
237<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#elementSet()">elementSet</A></B>()</CODE>
238
239<BR>
240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the set of distinct elements contained in this multiset.</TD>
241</TR>
242<TR BGCOLOR="white" CLASS="TableRowColor">
243<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
244<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="interface in com.google.common.collect">Multiset.Entry</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;&gt;</CODE></FONT></TD>
245<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#entrySet()">entrySet</A></B>()</CODE>
246
247<BR>
248&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a view of the contents of this multiset, grouped into <code>Multiset.Entry</code> instances, each providing an element of the multiset and
249 the count of that element.</TD>
250</TR>
251<TR BGCOLOR="white" CLASS="TableRowColor">
252<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
253<CODE>&nbsp;boolean</CODE></FONT></TD>
254<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.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;object)</CODE>
255
256<BR>
257&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares the specified object with this multiset for equality.</TD>
258</TR>
259<TR BGCOLOR="white" CLASS="TableRowColor">
260<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
261<CODE>&nbsp;int</CODE></FONT></TD>
262<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#hashCode()">hashCode</A></B>()</CODE>
263
264<BR>
265&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the hash code for this multiset.</TD>
266</TR>
267<TR BGCOLOR="white" CLASS="TableRowColor">
268<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
269<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/UnmodifiableIterator.html" title="class in com.google.common.collect">UnmodifiableIterator</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></FONT></TD>
270<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#iterator()">iterator</A></B>()</CODE>
271
272<BR>
273&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an unmodifiable iterator across the elements in this collection.</TD>
274</TR>
275<TR BGCOLOR="white" CLASS="TableRowColor">
276<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
277<CODE>static
278<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
279<TR ALIGN="right" VALIGN="">
280<TD NOWRAP><FONT SIZE="-1">
281<CODE>&lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt;</CODE></FONT></TD>
282</TR>
283</TABLE>
284</CODE></FONT></TD>
285<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#of()">of</A></B>()</CODE>
286
287<BR>
288&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the empty immutable multiset.</TD>
289</TR>
290<TR BGCOLOR="white" CLASS="TableRowColor">
291<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
292<CODE>static
293<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
294<TR ALIGN="right" VALIGN="">
295<TD NOWRAP><FONT SIZE="-1">
296<CODE>&lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt;</CODE></FONT></TD>
297</TR>
298</TABLE>
299</CODE></FONT></TD>
300<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#of(E...)">of</A></B>(E...&nbsp;elements)</CODE>
301
302<BR>
303&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an immutable multiset containing the given elements.</TD>
304</TR>
305<TR BGCOLOR="white" CLASS="TableRowColor">
306<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
307<CODE>&nbsp;int</CODE></FONT></TD>
308<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#remove(java.lang.Object, int)">remove</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;element,
309       int&nbsp;occurrences)</CODE>
310
311<BR>
312&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guaranteed to throw an exception and leave the collection unmodified.</TD>
313</TR>
314<TR BGCOLOR="white" CLASS="TableRowColor">
315<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
316<CODE>&nbsp;int</CODE></FONT></TD>
317<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#setCount(E, int)">setCount</A></B>(<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&nbsp;element,
318         int&nbsp;count)</CODE>
319
320<BR>
321&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guaranteed to throw an exception and leave the collection unmodified.</TD>
322</TR>
323<TR BGCOLOR="white" CLASS="TableRowColor">
324<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
325<CODE>&nbsp;boolean</CODE></FONT></TD>
326<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#setCount(E, int, int)">setCount</A></B>(<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&nbsp;element,
327         int&nbsp;oldCount,
328         int&nbsp;newCount)</CODE>
329
330<BR>
331&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guaranteed to throw an exception and leave the collection unmodified.</TD>
332</TR>
333<TR BGCOLOR="white" CLASS="TableRowColor">
334<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
335<CODE>&nbsp;int</CODE></FONT></TD>
336<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#size()">size</A></B>()</CODE>
337
338<BR>
339&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
340</TR>
341<TR BGCOLOR="white" CLASS="TableRowColor">
342<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
343<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>
344<TD><CODE><B><A HREF="../../../../com/google/common/collect/ImmutableMultiset.html#toString()">toString</A></B>()</CODE>
345
346<BR>
347&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
348</TR>
349</TABLE>
350&nbsp;<A NAME="methods_inherited_from_class_com.google.common.collect.ImmutableCollection"><!-- --></A>
351<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
352<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
353<TH ALIGN="left"><B>Methods inherited from class com.google.common.collect.<A HREF="../../../../com/google/common/collect/ImmutableCollection.html" title="class in com.google.common.collect">ImmutableCollection</A></B></TH>
354</TR>
355<TR BGCOLOR="white" CLASS="TableRowColor">
356<TD><CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html#add(E)">add</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#addAll(java.util.Collection)">addAll</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#asList()">asList</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#clear()">clear</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#containsAll(java.util.Collection)">containsAll</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#isEmpty()">isEmpty</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#remove(java.lang.Object)">remove</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#removeAll(java.util.Collection)">removeAll</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#retainAll(java.util.Collection)">retainAll</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#toArray()">toArray</A>, <A HREF="../../../../com/google/common/collect/ImmutableCollection.html#toArray(T[])">toArray</A></CODE></TD>
357</TR>
358</TABLE>
359&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
360<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
361<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
362<TH ALIGN="left"><B>Methods inherited from class java.lang.<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></B></TH>
363</TR>
364<TR BGCOLOR="white" CLASS="TableRowColor">
365<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
366</TR>
367</TABLE>
368&nbsp;<A NAME="methods_inherited_from_class_com.google.common.collect.Multiset"><!-- --></A>
369<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
370<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
371<TH ALIGN="left"><B>Methods inherited from interface com.google.common.collect.<A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A></B></TH>
372</TR>
373<TR BGCOLOR="white" CLASS="TableRowColor">
374<TD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#add(E)">add</A>, <A HREF="../../../../com/google/common/collect/Multiset.html#containsAll(java.util.Collection)">containsAll</A>, <A HREF="../../../../com/google/common/collect/Multiset.html#remove(java.lang.Object)">remove</A>, <A HREF="../../../../com/google/common/collect/Multiset.html#removeAll(java.util.Collection)">removeAll</A>, <A HREF="../../../../com/google/common/collect/Multiset.html#retainAll(java.util.Collection)">retainAll</A></CODE></TD>
375</TR>
376</TABLE>
377&nbsp;<A NAME="methods_inherited_from_class_java.util.Collection"><!-- --></A>
378<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
379<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
380<TH ALIGN="left"><B>Methods inherited from interface java.util.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A></B></TH>
381</TR>
382<TR BGCOLOR="white" CLASS="TableRowColor">
383<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util">addAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#clear()" title="class or interface in java.util">clear</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#toArray()" title="class or interface in java.util">toArray</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#toArray(T[])" title="class or interface in java.util">toArray</A></CODE></TD>
384</TR>
385</TABLE>
386&nbsp;
387<P>
388
389<!-- ============ METHOD DETAIL ========== -->
390
391<A NAME="method_detail"><!-- --></A>
392<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
393<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
394<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
395<B>Method Detail</B></FONT></TH>
396</TR>
397</TABLE>
398
399<A NAME="of()"><!-- --></A><H3>
400of</H3>
401<PRE>
402public static &lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt; <B>of</B>()</PRE>
403<DL>
404<DD>Returns the empty immutable multiset.
405<P>
406<DD><DL>
407</DL>
408</DD>
409<DD><DL>
410</DL>
411</DD>
412</DL>
413<HR>
414
415<A NAME="of(java.lang.Object[])"><!-- --></A><A NAME="of(E...)"><!-- --></A><H3>
416of</H3>
417<PRE>
418public static &lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt; <B>of</B>(E...&nbsp;elements)</PRE>
419<DL>
420<DD>Returns an immutable multiset containing the given elements.
421
422 <p>The multiset is ordered by the first occurrence of each element. For
423 example, <code>ImmutableMultiset.of(2, 3, 1, 3)</code> yields a multiset with
424 elements in the order <code>2, 3, 3, 1</code>.
425<P>
426<DD><DL>
427</DL>
428</DD>
429<DD><DL>
430
431<DT><B>Throws:</B>
432<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if any of <code>elements</code> is null</DL>
433</DD>
434</DL>
435<HR>
436
437<A NAME="copyOf(java.lang.Iterable)"><!-- --></A><H3>
438copyOf</H3>
439<PRE>
440public static &lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt; <B>copyOf</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;? extends E&gt;&nbsp;elements)</PRE>
441<DL>
442<DD>Returns an immutable multiset containing the given elements.
443
444 <p>The multiset is ordered by the first occurrence of each element. For
445 example, <code>ImmutableMultiset.copyOf(Arrays.asList(2, 3, 1, 3))</code> yields
446 a multiset with elements in the order <code>2, 3, 3, 1</code>.
447
448 <p>Note that if <code>c</code> is a <code>Collection&lt;String&gt;</code>, then <code>ImmutableMultiset.copyOf(c)</code> returns an <code>ImmutableMultiset&lt;String&gt;</code>
449 containing each of the strings in <code>c</code>, while
450 <code>ImmutableMultiset.of(c)</code> returns an
451 <code>ImmutableMultiset&lt;Collection&lt;String&gt;&gt;</code> containing one element (the
452 given collection itself).
453
454 <p><b>Note:</b> Despite what the method name suggests, if <code>elements</code>
455 is an <code>ImmutableMultiset</code>, no copy will actually be performed, and
456 the given multiset itself will be returned.
457<P>
458<DD><DL>
459</DL>
460</DD>
461<DD><DL>
462
463<DT><B>Throws:</B>
464<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if any of <code>elements</code> is null</DL>
465</DD>
466</DL>
467<HR>
468
469<A NAME="copyOf(java.util.Iterator)"><!-- --></A><H3>
470copyOf</H3>
471<PRE>
472public static &lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="class in com.google.common.collect">ImmutableMultiset</A>&lt;E&gt; <B>copyOf</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A>&lt;? extends E&gt;&nbsp;elements)</PRE>
473<DL>
474<DD>Returns an immutable multiset containing the given elements.
475
476 <p>The multiset is ordered by the first occurrence of each element. For
477 example,
478 <code>ImmutableMultiset.copyOf(Arrays.asList(2, 3, 1, 3).iterator())</code>
479 yields a multiset with elements in the order <code>2, 3, 3, 1</code>.
480<P>
481<DD><DL>
482</DL>
483</DD>
484<DD><DL>
485
486<DT><B>Throws:</B>
487<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if any of <code>elements</code> is null</DL>
488</DD>
489</DL>
490<HR>
491
492<A NAME="count(java.lang.Object)"><!-- --></A><H3>
493count</H3>
494<PRE>
495public int <B>count</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
496                 <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;element)</PRE>
497<DL>
498<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#count(java.lang.Object)">Multiset</A></CODE></B></DD>
499<DD>Returns the number of occurrences of an element in this multiset (the
500 <i>count</i> of the element). Note that for an <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"><CODE>Object.equals(java.lang.Object)</CODE></A>-based
501 multiset, this gives the same result as <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html?is-external=true#frequency(java.util.Collection, java.lang.Object)" title="class or interface in java.util"><CODE>Collections.frequency(java.util.Collection<?>, java.lang.Object)</CODE></A>
502 (which would presumably perform more poorly).
503
504 <p><b>Note:</b> the utility method <A HREF="../../../../com/google/common/collect/Iterables.html#frequency(java.lang.Iterable, java.lang.Object)"><CODE>Iterables.frequency(java.lang.Iterable<?>, java.lang.Object)</CODE></A> generalizes
505 this operation; it correctly delegates to this method when dealing with a
506 multiset, but it can also accept any other iterable type.
507<P>
508<DD><DL>
509<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#count(java.lang.Object)">count</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
510</DD>
511<DD><DL>
512<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to count occurrences of
513<DT><B>Returns:</B><DD>the number of occurrences of the element in this multiset; possibly
514     zero but never negative</DL>
515</DD>
516</DL>
517<HR>
518
519<A NAME="iterator()"><!-- --></A><H3>
520iterator</H3>
521<PRE>
522public <A HREF="../../../../com/google/common/collect/UnmodifiableIterator.html" title="class in com.google.common.collect">UnmodifiableIterator</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt; <B>iterator</B>()</PRE>
523<DL>
524<DD><B>Description copied from class: <CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html#iterator()">ImmutableCollection</A></CODE></B></DD>
525<DD>Returns an unmodifiable iterator across the elements in this collection.
526<P>
527<DD><DL>
528<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#iterator()">iterator</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang">iterator</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#iterator()" title="class or interface in java.util">iterator</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html#iterator()">iterator</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html" title="class in com.google.common.collect">ImmutableCollection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
529</DD>
530<DD><DL>
531</DL>
532</DD>
533</DL>
534<HR>
535
536<A NAME="size()"><!-- --></A><H3>
537size</H3>
538<PRE>
539public int <B>size</B>()</PRE>
540<DL>
541<DD><DL>
542<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#size()" title="class or interface in java.util">size</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
543</DD>
544<DD><DL>
545</DL>
546</DD>
547</DL>
548<HR>
549
550<A NAME="contains(java.lang.Object)"><!-- --></A><H3>
551contains</H3>
552<PRE>
553public boolean <B>contains</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
554                        <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;element)</PRE>
555<DL>
556<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#contains(java.lang.Object)">Multiset</A></CODE></B></DD>
557<DD>Determines whether this multiset contains the specified element.
558
559 <p>This method refines <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util"><CODE>Collection.contains(java.lang.Object)</CODE></A> to further specify that
560 it <b>may not</b> throw an exception in response to <code>element</code> being
561 null or of the wrong type.
562<P>
563<DD><DL>
564<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#contains(java.lang.Object)">contains</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util">contains</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html#contains(java.lang.Object)">contains</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html" title="class in com.google.common.collect">ImmutableCollection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
565</DD>
566<DD><DL>
567<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to check for
568<DT><B>Returns:</B><DD><code>true</code> if this multiset contains at least one occurrence of
569     the element</DL>
570</DD>
571</DL>
572<HR>
573
574<A NAME="add(java.lang.Object,int)"><!-- --></A><A NAME="add(E, int)"><!-- --></A><H3>
575add</H3>
576<PRE>
577public int <B>add</B>(<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&nbsp;element,
578               int&nbsp;occurrences)</PRE>
579<DL>
580<DD>Guaranteed to throw an exception and leave the collection unmodified.
581<P>
582<DD><DL>
583<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#add(E, int)">add</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
584</DD>
585<DD><DL>
586<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add occurrences of; may be <code>null</code> only
587     if explicitly allowed by the implementation<DD><CODE>occurrences</CODE> - the number of occurrences of the element to add. May be
588     zero, in which case no change will be made.
589<DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero
590<DT><B>Throws:</B>
591<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - always</DL>
592</DD>
593</DL>
594<HR>
595
596<A NAME="remove(java.lang.Object, int)"><!-- --></A><H3>
597remove</H3>
598<PRE>
599public int <B>remove</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;element,
600                  int&nbsp;occurrences)</PRE>
601<DL>
602<DD>Guaranteed to throw an exception and leave the collection unmodified.
603<P>
604<DD><DL>
605<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#remove(java.lang.Object, int)">remove</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
606</DD>
607<DD><DL>
608<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to conditionally remove occurrences of<DD><CODE>occurrences</CODE> - the number of occurrences of the element to remove. May
609     be zero, in which case no change will be made.
610<DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero
611<DT><B>Throws:</B>
612<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - always</DL>
613</DD>
614</DL>
615<HR>
616
617<A NAME="setCount(java.lang.Object,int)"><!-- --></A><A NAME="setCount(E, int)"><!-- --></A><H3>
618setCount</H3>
619<PRE>
620public int <B>setCount</B>(<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&nbsp;element,
621                    int&nbsp;count)</PRE>
622<DL>
623<DD>Guaranteed to throw an exception and leave the collection unmodified.
624<P>
625<DD><DL>
626<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#setCount(E, int)">setCount</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
627</DD>
628<DD><DL>
629<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add or remove occurrences of; may be null
630     only if explicitly allowed by the implementation<DD><CODE>count</CODE> - the desired count of the element in this multiset
631<DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero
632<DT><B>Throws:</B>
633<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - always</DL>
634</DD>
635</DL>
636<HR>
637
638<A NAME="setCount(java.lang.Object,int,int)"><!-- --></A><A NAME="setCount(E, int, int)"><!-- --></A><H3>
639setCount</H3>
640<PRE>
641public boolean <B>setCount</B>(<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&nbsp;element,
642                        int&nbsp;oldCount,
643                        int&nbsp;newCount)</PRE>
644<DL>
645<DD>Guaranteed to throw an exception and leave the collection unmodified.
646<P>
647<DD><DL>
648<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#setCount(E, int, int)">setCount</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
649</DD>
650<DD><DL>
651<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to conditionally set the count of; may be null
652     only if explicitly allowed by the implementation<DD><CODE>oldCount</CODE> - the expected present count of the element in this multiset<DD><CODE>newCount</CODE> - the desired count of the element in this multiset
653<DT><B>Returns:</B><DD><code>true</code> if the condition for modification was met. This
654     implies that the multiset was indeed modified, unless
655     <code>oldCount == newCount</code>.
656<DT><B>Throws:</B>
657<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - always</DL>
658</DD>
659</DL>
660<HR>
661
662<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
663equals</H3>
664<PRE>
665public boolean <B>equals</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
666                      <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;object)</PRE>
667<DL>
668<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#equals(java.lang.Object)">Multiset</A></CODE></B></DD>
669<DD>Compares the specified object with this multiset for equality. Returns
670 <code>true</code> if the given object is also a multiset and contains equal
671 elements with equal counts, regardless of order.
672<P>
673<DD><DL>
674<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#equals(java.lang.Object)">equals</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><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>
675</DD>
676<DD><DL>
677</DL>
678</DD>
679</DL>
680<HR>
681
682<A NAME="hashCode()"><!-- --></A><H3>
683hashCode</H3>
684<PRE>
685public int <B>hashCode</B>()</PRE>
686<DL>
687<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#hashCode()">Multiset</A></CODE></B></DD>
688<DD>Returns the hash code for this multiset. This is defined as the sum of
689
690 <pre>  (element == null ? 0 : element.hashCode()) ^ count(element)</pre>
691
692 over all distinct elements in the multiset. It follows that a multiset and
693 its entry set always have the same hash code.
694<P>
695<DD><DL>
696<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#hashCode()">hashCode</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><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>
697</DD>
698<DD><DL>
699</DL>
700</DD>
701</DL>
702<HR>
703
704<A NAME="toString()"><!-- --></A><H3>
705toString</H3>
706<PRE>
707public <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>
708<DL>
709<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#toString()">Multiset</A></CODE></B></DD>
710<DD>
711
712 <p>It is recommended, though not mandatory, that this method return the
713 result of invoking <A HREF="../../../../com/google/common/collect/Multiset.html#toString()"><CODE>Multiset.toString()</CODE></A> on the <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>, yielding a
714 result such as
715 <pre>
716     [a x 3, c, d x 2, e]
717 </pre>
718<P>
719<DD><DL>
720<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#toString()">toString</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../../com/google/common/collect/ImmutableCollection.html" title="class in com.google.common.collect">ImmutableCollection</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
721</DD>
722<DD><DL>
723</DL>
724</DD>
725</DL>
726<HR>
727
728<A NAME="elementSet()"><!-- --></A><H3>
729elementSet</H3>
730<PRE>
731public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt; <B>elementSet</B>()</PRE>
732<DL>
733<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()">Multiset</A></CODE></B></DD>
734<DD>Returns the set of distinct elements contained in this multiset. The
735 element set is backed by the same data as the multiset, so any change to
736 either is immediately reflected in the other. The order of the elements in
737 the element set is unspecified.
738
739 <p>If the element set supports any removal operations, these necessarily
740 cause <b>all</b> occurrences of the removed element(s) to be removed from
741 the multiset. Implementations are not expected to support the add
742 operations, although this is possible.
743
744 <p>A common use for the element set is to find the number of distinct
745 elements in the multiset: <code>elementSet().size()</code>.
746<P>
747<DD><DL>
748<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()">elementSet</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
749</DD>
750<DD><DL>
751
752<DT><B>Returns:</B><DD>a view of the set of distinct elements in this multiset</DL>
753</DD>
754</DL>
755<HR>
756
757<A NAME="entrySet()"><!-- --></A><H3>
758entrySet</H3>
759<PRE>
760public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="interface in com.google.common.collect">Multiset.Entry</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;&gt; <B>entrySet</B>()</PRE>
761<DL>
762<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()">Multiset</A></CODE></B></DD>
763<DD>Returns a view of the contents of this multiset, grouped into <code>Multiset.Entry</code> instances, each providing an element of the multiset and
764 the count of that element. This set contains exactly one entry for each
765 distinct element in the multiset (thus it always has the same size as the
766 <A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()"><CODE>Multiset.elementSet()</CODE></A>). The order of the elements in the element set is
767 unspecified.
768
769 <p>The entry set is backed by the same data as the multiset, so any change
770 to either is immediately reflected in the other. However, multiset changes
771 may or may not be reflected in any <code>Entry</code> instances already
772 retrieved from the entry set (this is implementation-dependent).
773 Furthermore, implementations are not required to support modifications to
774 the entry set at all, and the <code>Entry</code> instances themselves don't
775 even have methods for modification. See the specific implementation class
776 for more details on how its entry set handles modifications.
777<P>
778<DD><DL>
779<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()">entrySet</A></CODE> in interface <CODE><A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect">Multiset</A>&lt;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.html" title="type parameter in ImmutableMultiset">E</A>&gt;</CODE></DL>
780</DD>
781<DD><DL>
782
783<DT><B>Returns:</B><DD>a set of entries representing the data of this multiset</DL>
784</DD>
785</DL>
786<HR>
787
788<A NAME="builder()"><!-- --></A><H3>
789builder</H3>
790<PRE>
791public static &lt;E&gt; <A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.html" title="class in com.google.common.collect">ImmutableMultiset.Builder</A>&lt;E&gt; <B>builder</B>()</PRE>
792<DL>
793<DD>Returns a new builder. The generated builder is equivalent to the builder
794 created by the <A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.html" title="class in com.google.common.collect"><CODE>ImmutableMultiset.Builder</CODE></A> constructor.
795<P>
796<DD><DL>
797</DL>
798</DD>
799<DD><DL>
800</DL>
801</DD>
802</DL>
803<!-- ========= END OF CLASS DATA ========= -->
804<HR>
805
806
807<!-- ======= START OF BOTTOM NAVBAR ====== -->
808<A NAME="navbar_bottom"><!-- --></A>
809<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
810<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
811<TR>
812<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
813<A NAME="navbar_bottom_firstrow"><!-- --></A>
814<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
815  <TR ALIGN="center" VALIGN="top">
816  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
817  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
818  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
819  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ImmutableMultiset.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
820  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
821  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
822  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
823  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
824  </TR>
825</TABLE>
826</TD>
827<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
828</EM>
829</TD>
830</TR>
831
832<TR>
833<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
834&nbsp;<A HREF="../../../../com/google/common/collect/ImmutableMultimap.Builder.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
835&nbsp;<A HREF="../../../../com/google/common/collect/ImmutableMultiset.Builder.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
836<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
837  <A HREF="../../../../index.html?com/google/common/collect/ImmutableMultiset.html" target="_top"><B>FRAMES</B></A>  &nbsp;
838&nbsp;<A HREF="ImmutableMultiset.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
839&nbsp;<SCRIPT type="text/javascript">
840  <!--
841  if(window==top) {
842    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
843  }
844  //-->
845</SCRIPT>
846<NOSCRIPT>
847  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
848</NOSCRIPT>
849
850
851</FONT></TD>
852</TR>
853<TR>
854<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
855  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
856<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
857DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
858</TR>
859</TABLE>
860<A NAME="skip-navbar_bottom"></A>
861<!-- ======== END OF BOTTOM NAVBAR ======= -->
862
863<HR>
864
865</BODY>
866</HTML>
867