a whole bunch of stuff
[ephemerata.git] / KezvhLib / lib / com.google.com.collect / javadoc / com / google / common / collect / AbstractMultiset.html
blob800561ca3f4268d8f1921a6b768bf400660954f8
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.5.0_06) on Wed Aug 20 17:16:44 PDT 2008 -->
6 <TITLE>
7 AbstractMultiset (Google Collections Library - snapshot-20080820 (ALPHA))
8 </TITLE>
10 <META NAME="keywords" CONTENT="com.google.common.collect.AbstractMultiset class">
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
14 <SCRIPT type="text/javascript">
15 function windowTitle()
17 parent.document.title="AbstractMultiset (Google Collections Library - snapshot-20080820 (ALPHA))";
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
23 </HEAD>
25 <BODY BGCOLOR="white" onload="windowTitle();">
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36 <TR ALIGN="center" VALIGN="top">
37 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44 </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../../../com/google/common/collect/AbstractMapEntry.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;<A HREF="../../../../com/google/common/collect/AbstractMultisetEntry.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57 <A HREF="../../../../index.html?com/google/common/collect/AbstractMultiset.html" target="_top"><B>FRAMES</B></A> &nbsp;
58 &nbsp;<A HREF="AbstractMultiset.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60 <!--
61 if(window==top) {
62 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
64 //-->
65 </SCRIPT>
66 <NOSCRIPT>
67 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 com.google.common.collect</FONT>
88 <BR>
89 Class AbstractMultiset&lt;E&gt;</H2>
90 <PRE>
91 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
92 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">java.util.AbstractCollection</A>&lt;E&gt;
93 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.AbstractMultiset&lt;E&gt;</B>
94 </PRE>
95 <DL>
96 <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/lang/Iterable.html" 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" title="class or interface in java.util">Collection</A>&lt;E&gt;</DD>
97 </DL>
98 <DL>
99 <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../com/google/common/collect/ConcurrentMultiset.html" title="class in com.google.common.collect">ConcurrentMultiset</A>, <A HREF="../../../../com/google/common/collect/EnumMultiset.html" title="class in com.google.common.collect">EnumMultiset</A>, <A HREF="../../../../com/google/common/collect/HashMultiset.html" title="class in com.google.common.collect">HashMultiset</A>, <A HREF="../../../../com/google/common/collect/LinkedHashMultiset.html" title="class in com.google.common.collect">LinkedHashMultiset</A>, <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A></DD>
100 </DL>
101 <HR>
102 <DL>
103 <DT><PRE>public abstract class <B>AbstractMultiset&lt;E&gt;</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</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>
104 </PRE>
107 This class provides a skeletal implementation of the <A HREF="../../../../com/google/common/collect/Multiset.html" title="interface in com.google.common.collect"><CODE>Multiset</CODE></A>
108 interface. A new multiset implementation can be created easily by extending
109 this class and implementing the <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A> method, plus
110 optionally overriding <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#add(E, int)"><CODE>add(Object, int)</CODE></A> and
111 <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#remove(java.lang.Object, int)"><CODE>remove(Object, int)</CODE></A> to enable modifications to the multiset.
113 <p>The <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#contains(java.lang.Object)"><CODE>contains(java.lang.Object)</CODE></A>, <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#containsAll(java.util.Collection)"><CODE>containsAll(java.util.Collection<?>)</CODE></A>, <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#count(java.lang.Object)"><CODE>count(java.lang.Object)</CODE></A>, and
114 <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#size()"><CODE>size()</CODE></A> implementations all iterate across the set returned by
115 <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>, as do many methods acting on the set returned by
116 <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#elementSet"><CODE>elementSet</CODE></A>. Override those methods for better performance.
120 <DL>
121 <DT><B>Author:</B></DT>
122 <DD>Kevin Bourrillion</DD>
123 </DL>
124 <HR>
127 <!-- ======== NESTED CLASS SUMMARY ======== -->
129 <A NAME="nested_class_summary"><!-- --></A>
130 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
131 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
132 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
133 <B>Nested Class Summary</B></FONT></TH>
134 </TR>
135 </TABLE>
136 &nbsp;<A NAME="nested_classes_inherited_from_class_com.google.common.collect.Multiset"><!-- --></A>
137 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
138 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
139 <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>
140 </TR>
141 <TR BGCOLOR="white" CLASS="TableRowColor">
142 <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>
143 </TR>
144 </TABLE>
145 &nbsp;
147 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
149 <A NAME="constructor_summary"><!-- --></A>
150 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
151 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
152 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
153 <B>Constructor Summary</B></FONT></TH>
154 </TR>
155 <TR BGCOLOR="white" CLASS="TableRowColor">
156 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#AbstractMultiset()">AbstractMultiset</A></B>()</CODE>
158 <BR>
159 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
160 </TR>
161 </TABLE>
162 &nbsp;
163 <!-- ========== METHOD SUMMARY =========== -->
165 <A NAME="method_summary"><!-- --></A>
166 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
167 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
168 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
169 <B>Method Summary</B></FONT></TH>
170 </TR>
171 <TR BGCOLOR="white" CLASS="TableRowColor">
172 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
173 <CODE>&nbsp;boolean</CODE></FONT></TD>
174 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#add(E)">add</A></B>(<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&nbsp;element)</CODE>
176 <BR>
177 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ensures that this collection contains the specified element.</TD>
178 </TR>
179 <TR BGCOLOR="white" CLASS="TableRowColor">
180 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
181 <CODE>&nbsp;boolean</CODE></FONT></TD>
182 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#add(E, int)">add</A></B>(<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&nbsp;element,
183 int&nbsp;occurrences)</CODE>
185 <BR>
186 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a number of occurrences of an element to this multiset.</TD>
187 </TR>
188 <TR BGCOLOR="white" CLASS="TableRowColor">
189 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
190 <CODE>&nbsp;boolean</CODE></FONT></TD>
191 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#addAll(java.util.Collection)">addAll</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;? extends <A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;&nbsp;elementsToAdd)</CODE>
193 <BR>
194 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds all of the elements in the specified collection to this multiset.</TD>
195 </TR>
196 <TR BGCOLOR="white" CLASS="TableRowColor">
197 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
198 <CODE>&nbsp;void</CODE></FONT></TD>
199 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#clear()">clear</A></B>()</CODE>
201 <BR>
202 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all of the elements from this multiset.</TD>
203 </TR>
204 <TR BGCOLOR="white" CLASS="TableRowColor">
205 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
206 <CODE>&nbsp;boolean</CODE></FONT></TD>
207 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#contains(java.lang.Object)">contains</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</CODE>
209 <BR>
210 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this collection contains the specified element.</TD>
211 </TR>
212 <TR BGCOLOR="white" CLASS="TableRowColor">
213 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
214 <CODE>&nbsp;boolean</CODE></FONT></TD>
215 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#containsAll(java.util.Collection)">containsAll</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;elements)</CODE>
217 <BR>
218 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this multiset contains all of the elements in the
219 specified collection.</TD>
220 </TR>
221 <TR BGCOLOR="white" CLASS="TableRowColor">
222 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
223 <CODE>&nbsp;int</CODE></FONT></TD>
224 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#count(java.lang.Object)">count</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</CODE>
226 <BR>
227 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of occurrences of an element in this multiset (the
228 <i>count</i> of the element).</TD>
229 </TR>
230 <TR BGCOLOR="white" CLASS="TableRowColor">
231 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
232 <CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></FONT></TD>
233 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#createElementSet()">createElementSet</A></B>()</CODE>
235 <BR>
236 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new instance of this multiset's element set, which will be
237 returned by <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#elementSet"><CODE>elementSet</CODE></A>.</TD>
238 </TR>
239 <TR BGCOLOR="white" CLASS="TableRowColor">
240 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
241 <CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></FONT></TD>
242 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#elementSet()">elementSet</A></B>()</CODE>
244 <BR>
245 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the set of distinct elements contained in this multiset.</TD>
246 </TR>
247 <TR BGCOLOR="white" CLASS="TableRowColor">
248 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
249 <CODE>abstract &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html" 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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;&gt;</CODE></FONT></TD>
250 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#entrySet()">entrySet</A></B>()</CODE>
252 <BR>
253 &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
254 the count of that element.</TD>
255 </TR>
256 <TR BGCOLOR="white" CLASS="TableRowColor">
257 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
258 <CODE>&nbsp;boolean</CODE></FONT></TD>
259 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;other)</CODE>
261 <BR>
262 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicates whether some other object is "equal to" this one.</TD>
263 </TR>
264 <TR BGCOLOR="white" CLASS="TableRowColor">
265 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
266 <CODE>&nbsp;int</CODE></FONT></TD>
267 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#hashCode()">hashCode</A></B>()</CODE>
269 <BR>
270 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a hash code value for the object.</TD>
271 </TR>
272 <TR BGCOLOR="white" CLASS="TableRowColor">
273 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
274 <CODE>&nbsp;boolean</CODE></FONT></TD>
275 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#isEmpty()">isEmpty</A></B>()</CODE>
277 <BR>
278 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <tt>true</tt> if this collection contains no elements.</TD>
279 </TR>
280 <TR BGCOLOR="white" CLASS="TableRowColor">
281 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
282 <CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></FONT></TD>
283 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#iterator()">iterator</A></B>()</CODE>
285 <BR>
286 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an iterator over the elements contained in this collection.</TD>
287 </TR>
288 <TR BGCOLOR="white" CLASS="TableRowColor">
289 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
290 <CODE>&nbsp;boolean</CODE></FONT></TD>
291 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#remove(java.lang.Object)">remove</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</CODE>
293 <BR>
294 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a single instance of the specified element from this collection, if
295 it is present.</TD>
296 </TR>
297 <TR BGCOLOR="white" CLASS="TableRowColor">
298 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
299 <CODE>&nbsp;int</CODE></FONT></TD>
300 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#remove(java.lang.Object, int)">remove</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element,
301 int&nbsp;occurrences)</CODE>
303 <BR>
304 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Conditionally removes a number of occurrences of an element from this
305 multiset, provided that at least this many occurrences are present.</TD>
306 </TR>
307 <TR BGCOLOR="white" CLASS="TableRowColor">
308 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
309 <CODE>&nbsp;boolean</CODE></FONT></TD>
310 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#removeAll(java.util.Collection)">removeAll</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;elementsToRemove)</CODE>
312 <BR>
313 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all of this multiset's elements that are also contained in the
314 specified collection.</TD>
315 </TR>
316 <TR BGCOLOR="white" CLASS="TableRowColor">
317 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
318 <CODE>&nbsp;int</CODE></FONT></TD>
319 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#removeAllOccurrences(java.lang.Object)">removeAllOccurrences</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</CODE>
321 <BR>
322 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes <b>all</b> occurrences of the specified element from this multiset.</TD>
323 </TR>
324 <TR BGCOLOR="white" CLASS="TableRowColor">
325 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
326 <CODE>&nbsp;boolean</CODE></FONT></TD>
327 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#retainAll(java.util.Collection)">retainAll</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;elementsToRetain)</CODE>
329 <BR>
330 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retains only the elements in this multiset that are contained in the
331 specified collection.</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/AbstractMultiset.html#size()">size</A></B>()</CODE>
338 <BR>
339 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of elements in this collection.</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" title="class or interface in java.lang">String</A></CODE></FONT></TD>
344 <TD><CODE><B><A HREF="../../../../com/google/common/collect/AbstractMultiset.html#toString()">toString</A></B>()</CODE>
346 <BR>
347 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string representation of this collection.</TD>
348 </TR>
349 </TABLE>
350 &nbsp;<A NAME="methods_inherited_from_class_java.util.AbstractCollection"><!-- --></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 java.util.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A></B></TH>
354 </TR>
355 <TR BGCOLOR="white" CLASS="TableRowColor">
356 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#toArray()" title="class or interface in java.util">toArray</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#toArray(T[])" title="class or interface in java.util">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" 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#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#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#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_java.util.Collection"><!-- --></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 java.util.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A></B></TH>
372 </TR>
373 <TR BGCOLOR="white" CLASS="TableRowColor">
374 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#toArray()" title="class or interface in java.util">toArray</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#toArray(T[])" title="class or interface in java.util">toArray</A></CODE></TD>
375 </TR>
376 </TABLE>
377 &nbsp;
380 <!-- ========= CONSTRUCTOR DETAIL ======== -->
382 <A NAME="constructor_detail"><!-- --></A>
383 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
384 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
385 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
386 <B>Constructor Detail</B></FONT></TH>
387 </TR>
388 </TABLE>
390 <A NAME="AbstractMultiset()"><!-- --></A><H3>
391 AbstractMultiset</H3>
392 <PRE>
393 public <B>AbstractMultiset</B>()</PRE>
394 <DL>
395 </DL>
397 <!-- ============ METHOD DETAIL ========== -->
399 <A NAME="method_detail"><!-- --></A>
400 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
401 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
402 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
403 <B>Method Detail</B></FONT></TH>
404 </TR>
405 </TABLE>
407 <A NAME="entrySet()"><!-- --></A><H3>
408 entrySet</H3>
409 <PRE>
410 public abstract <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html" 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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;&gt; <B>entrySet</B>()</PRE>
411 <DL>
412 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()">Multiset</A></CODE></B></DD>
413 <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
414 the count of that element. This set contains exactly one entry for each
415 distinct element in the multiset (thus it always has the same size as the
416 <A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()"><CODE>Multiset.elementSet()</CODE></A>). The order of the elements in the element set is
417 unspecified.
419 <p>The entry set is backed by the same data as the multiset, so any change
420 to either is immediately reflected in the other. However, multiset changes
421 may or may not be reflected in any <code>Entry</code> instances already
422 retrieved from the entry set (this is implementation-dependent).
423 Furthermore, implementations are not required to support modifications to
424 the entry set at all, and the <code>Entry</code> instances themselves don't
425 even have methods for modification. See the specific implementation class
426 for more details on how its entry set handles modifications.
428 <DD><DL>
429 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
430 </DD>
431 <DD><DL>
433 <DT><B>Returns:</B><DD>a set of entries representing the data of this multiset</DL>
434 </DD>
435 </DL>
436 <HR>
438 <A NAME="size()"><!-- --></A><H3>
439 size</H3>
440 <PRE>
441 public int <B>size</B>()</PRE>
442 <DL>
443 <DD>Returns the number of elements in this collection. If the collection
444 contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
445 <tt>Integer.MAX_VALUE</tt>.
447 <p>This implementation iterates across <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A> and
448 sums the counts of the entries.
450 <DD><DL>
451 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#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" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#size()" title="class or interface in java.util">size</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
452 </DD>
453 <DD><DL>
455 <DT><B>Returns:</B><DD>the number of elements in this collection.</DL>
456 </DD>
457 </DL>
458 <HR>
460 <A NAME="isEmpty()"><!-- --></A><H3>
461 isEmpty</H3>
462 <PRE>
463 public boolean <B>isEmpty</B>()</PRE>
464 <DL>
465 <DD><B>Description copied from class: <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#isEmpty()" title="class or interface in java.util">java.util.AbstractCollection</A></CODE></B></DD>
466 <DD>Returns <tt>true</tt> if this collection contains no elements.<p>
468 This implementation returns <tt>size() == 0</tt>.
470 <DD><DL>
471 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#isEmpty()" title="class or interface in java.util">isEmpty</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#isEmpty()" title="class or interface in java.util">isEmpty</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
472 </DD>
473 <DD><DL>
475 <DT><B>Returns:</B><DD><tt>true</tt> if this collection contains no elements.</DL>
476 </DD>
477 </DL>
478 <HR>
480 <A NAME="contains(java.lang.Object)"><!-- --></A><H3>
481 contains</H3>
482 <PRE>
483 public boolean <B>contains</B>(<FONT SIZE="-1"><A HREF="../../../../com/google/common/base/Nullable.html" title="annotation in com.google.common.base">@Nullable</A></FONT>
484 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</PRE>
485 <DL>
486 <DD>Returns <code>true</code> if this collection contains the specified element.
488 <p>This implementation checks whether <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#elementSet"><CODE>elementSet</CODE></A> contains the
489 element.
491 <DD><DL>
492 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#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" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#contains(java.lang.Object)" title="class or interface in java.util">contains</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
493 </DD>
494 <DD><DL>
495 <DT><B>Parameters:</B><DD><CODE>element</CODE> - object to be checked for containment in this collection.
496 <DT><B>Returns:</B><DD><tt>true</tt> if this collection contains the specified element.</DL>
497 </DD>
498 </DL>
499 <HR>
501 <A NAME="iterator()"><!-- --></A><H3>
502 iterator</H3>
503 <PRE>
504 public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt; <B>iterator</B>()</PRE>
505 <DL>
506 <DD>Returns an iterator over the elements contained in this collection.
508 <p>This implementation usually invokes methods of the
509 <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A> iterator. However, the iterator's
510 <code>remove</code> method sometimes calls the multiset's <code>remove</code>.
512 <DD><DL>
513 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html#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" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#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" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#iterator()" title="class or interface in java.util">iterator</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
514 </DD>
515 <DD><DL>
517 <DT><B>Returns:</B><DD>an iterator over the elements contained in this collection.</DL>
518 </DD>
519 </DL>
520 <HR>
522 <A NAME="count(java.lang.Object)"><!-- --></A><H3>
523 count</H3>
524 <PRE>
525 public int <B>count</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</PRE>
526 <DL>
527 <DD>Returns the number of occurrences of an element in this multiset (the
528 <i>count</i> of the element). Note that for an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>-based
529 multiset, this gives the same result as <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html#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>
530 (which would presumably perform more poorly).
532 <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
533 this operation; it correctly delegates to this method when dealing with a
534 multiset, but it can also accept any other iterable type.
536 <p>This implementation iterates across <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A> and
537 sums the count of all entries.
539 <DD><DL>
540 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
541 </DD>
542 <DD><DL>
543 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to count occurrences of
544 <DT><B>Returns:</B><DD>the number of occurrences of the element in this multiset; possibly
545 zero but never negative</DL>
546 </DD>
547 </DL>
548 <HR>
550 <A NAME="add(java.lang.Object)"><!-- --></A><A NAME="add(E)"><!-- --></A><H3>
551 add</H3>
552 <PRE>
553 public boolean <B>add</B>(<FONT SIZE="-1"><A HREF="../../../../com/google/common/base/Nullable.html" title="annotation in com.google.common.base">@Nullable</A></FONT>
554 <A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&nbsp;element)</PRE>
555 <DL>
556 <DD>Ensures that this collection contains the specified element.
558 <p>This implementation calls <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#add(E, int)"><CODE>add(Object, int)</CODE></A> with one occurrence.
560 <DD><DL>
561 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#add(E)">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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#add(E)" title="class or interface in java.util">add</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#add(E)" title="class or interface in java.util">add</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
562 </DD>
563 <DD><DL>
564 <DT><B>Parameters:</B><DD><CODE>element</CODE> - element whose presence in this collection is to be ensured.
565 <DT><B>Returns:</B><DD><code>true</code> always</DL>
566 </DD>
567 </DL>
568 <HR>
570 <A NAME="add(java.lang.Object,int)"><!-- --></A><A NAME="add(E, int)"><!-- --></A><H3>
571 add</H3>
572 <PRE>
573 public boolean <B>add</B>(<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&nbsp;element,
574 int&nbsp;occurrences)</PRE>
575 <DL>
576 <DD>Adds a number of occurrences of an element to this multiset. Note that if
577 <code>occurrences == 1</code>, this method has the identical effect to <A HREF="../../../../com/google/common/collect/Multiset.html#add(E)"><CODE>Multiset.add(Object)</CODE></A>. This method is functionally equivalent (except in the case
578 of overflow) to the call <code>addAll(Collections.nCopies(element,
579 occurrences))</code>, which would presumably perform much more poorly.
581 <p>This implementation always throws an
582 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang"><CODE>UnsupportedOperationException</CODE></A>. To support adding elements, override
585 <DD><DL>
586 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
587 </DD>
588 <DD><DL>
589 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add occurrences of; may be <code>null</code> only
590 if explicitly allowed by the implementation<DD><CODE>occurrences</CODE> - the number of occurrences of this element to add. May
591 be zero, in which case no change will be made.
592 <DT><B>Returns:</B><DD>the previous count of this element before the operation; possibly
593 zero - TODO: make this the actual behavior!</DL>
594 </DD>
595 </DL>
596 <HR>
598 <A NAME="remove(java.lang.Object)"><!-- --></A><H3>
599 remove</H3>
600 <PRE>
601 public boolean <B>remove</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</PRE>
602 <DL>
603 <DD>Removes a single instance of the specified element from this collection, if
604 it is present.
606 <p>This implementation calls <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#remove(java.lang.Object, int)"><CODE>remove(Object, int)</CODE></A> with 1
607 occurrence.
609 <DD><DL>
610 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#remove(java.lang.Object)">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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#remove(java.lang.Object)" title="class or interface in java.util">remove</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#remove(java.lang.Object)" title="class or interface in java.util">remove</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
611 </DD>
612 <DD><DL>
613 <DT><B>Parameters:</B><DD><CODE>element</CODE> - element to be removed from this collection, if present.
614 <DT><B>Returns:</B><DD><tt>true</tt> if the collection contained the specified
615 element.</DL>
616 </DD>
617 </DL>
618 <HR>
620 <A NAME="remove(java.lang.Object, int)"><!-- --></A><H3>
621 remove</H3>
622 <PRE>
623 public int <B>remove</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element,
624 int&nbsp;occurrences)</PRE>
625 <DL>
626 <DD>Conditionally removes a number of occurrences of an element from this
627 multiset, provided that at least this many occurrences are present. If the
628 count of the element is less than <code>occurrences</code>, no change is made.
629 Note that if
630 <code>occurrences == 1</code>, this is functionally equivalent to the call
631 <code>remove(element)</code>.
633 <p>This implementation always throws an
634 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang"><CODE>UnsupportedOperationException</CODE></A>. To support removing elements,
635 override it.
637 <DD><DL>
638 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
639 </DD>
640 <DD><DL>
641 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to conditionally remove occurrences of<DD><CODE>occurrences</CODE> - the number of occurrences of this element to remove. May
642 be zero, in which case no change will be made.
643 <DT><B>Returns:</B><DD><code>true</code> if the condition for modification was met. Unless
644 <code>occurrences</code> is zero, this implies that the multiset was indeed
645 modified.</DL>
646 </DD>
647 </DL>
648 <HR>
650 <A NAME="removeAllOccurrences(java.lang.Object)"><!-- --></A><H3>
651 removeAllOccurrences</H3>
652 <PRE>
653 public int <B>removeAllOccurrences</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;element)</PRE>
654 <DL>
655 <DD>Removes <b>all</b> occurrences of the specified element from this multiset.
656 This method complements <A HREF="../../../../com/google/common/collect/Multiset.html#remove(java.lang.Object)"><CODE>Multiset.remove(Object)</CODE></A>, which removes only
657 one occurrence at a time.
659 TODO: Nuke this. Use setCount(e, 0).
661 <p>This implementation calls <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#remove(java.lang.Object, int)"><CODE>remove(Object, int)</CODE></A> with
662 <code>Integer.MAX_VALUE</code> occurrences.
664 <DD><DL>
665 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#removeAllOccurrences(java.lang.Object)">removeAllOccurrences</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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
666 </DD>
667 <DD><DL>
668 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element whose occurrences should all be removed
669 <DT><B>Returns:</B><DD>the number of occurrences successfully removed, possibly zero</DL>
670 </DD>
671 </DL>
672 <HR>
674 <A NAME="containsAll(java.util.Collection)"><!-- --></A><H3>
675 containsAll</H3>
676 <PRE>
677 public boolean <B>containsAll</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;elements)</PRE>
678 <DL>
679 <DD>Returns <code>true</code> if this multiset contains all of the elements in the
680 specified collection.
682 <p><b>Note:</b> this method does not take into account the occurrence
683 count of an element in the two collections; it may still return <code>true</code> even if <code>elements</code> contains several occurrences of an element
684 and this multiset contains only one. This is no different than any other
685 collection type like <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html" title="class or interface in java.util"><CODE>List</CODE></A>, but it may be unexpected to the user of
686 a multiset.
688 <p>This implementation checks whether <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#elementSet"><CODE>elementSet</CODE></A> contains the
689 elements.
691 <DD><DL>
692 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#containsAll(java.util.Collection)">containsAll</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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
693 </DD>
694 <DD><DL>
695 <DT><B>Parameters:</B><DD><CODE>elements</CODE> - collection to be checked for containment in this collection.
696 <DT><B>Returns:</B><DD><tt>true</tt> if this collection contains all of the elements
697 in the specified collection.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#contains(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.contains(Object)</CODE></A></DL>
698 </DD>
699 </DL>
700 <HR>
702 <A NAME="addAll(java.util.Collection)"><!-- --></A><H3>
703 addAll</H3>
704 <PRE>
705 public boolean <B>addAll</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;? extends <A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;&nbsp;elementsToAdd)</PRE>
706 <DL>
707 <DD>Adds all of the elements in the specified collection to this multiset.
709 <p>If the collection being added is a multiset, this implementation
710 iterates over that multiset's entry set to add the appropriate number of
711 occurrences of each of its elements to this multiset. Otherwise, it calls
712 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#addAll(java.util.Collection)" title="class or interface in java.util"><CODE>AbstractCollection.addAll(java.util.Collection<? extends E>)</CODE></A>.
714 <DD><DL>
715 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#addAll(java.util.Collection)" title="class or interface in java.util">addAll</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#addAll(java.util.Collection)" title="class or interface in java.util">addAll</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
716 </DD>
717 <DD><DL>
718 <DT><B>Parameters:</B><DD><CODE>elementsToAdd</CODE> - collection whose elements are to be added to this collection.
719 <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the
720 call.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#add(E)" title="class or interface in java.util"><CODE>AbstractCollection.add(Object)</CODE></A></DL>
721 </DD>
722 </DL>
723 <HR>
725 <A NAME="removeAll(java.util.Collection)"><!-- --></A><H3>
726 removeAll</H3>
727 <PRE>
728 public boolean <B>removeAll</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;elementsToRemove)</PRE>
729 <DL>
730 <DD>Removes all of this multiset's elements that are also contained in the
731 specified collection.
733 <p>This implementation iterates over the elements in the collection or, if
734 <code>elementsToRemove</code> is a multiset, the elements in its element set,
735 and calls <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#removeAllOccurrences(java.lang.Object)"><CODE>removeAllOccurrences(java.lang.Object)</CODE></A> on each element. In some cases,
736 this approach has better performance than
737 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#removeAll(java.util.Collection)" title="class or interface in java.util"><CODE>AbstractCollection.removeAll(java.util.Collection<?>)</CODE></A>.
739 <DD><DL>
740 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#removeAll(java.util.Collection)">removeAll</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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
741 </DD>
742 <DD><DL>
743 <DT><B>Parameters:</B><DD><CODE>elementsToRemove</CODE> - elements to be removed from this collection.
744 <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the
745 call.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#remove(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.remove(Object)</CODE></A>,
746 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#contains(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.contains(Object)</CODE></A></DL>
747 </DD>
748 </DL>
749 <HR>
751 <A NAME="retainAll(java.util.Collection)"><!-- --></A><H3>
752 retainAll</H3>
753 <PRE>
754 public boolean <B>retainAll</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;elementsToRetain)</PRE>
755 <DL>
756 <DD>Retains only the elements in this multiset that are contained in the
757 specified collection.
759 <p>This implementation iterates over <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#entrySet()"><CODE>entrySet()</CODE></A>, checking each
760 entry's element to see if it's contained in the provided collection.
761 If it's not found, the <code>remove</code> method of the entry set's
762 iterator is invoked. In some cases, this approach has better performance
763 than <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#removeAll(java.util.Collection)" title="class or interface in java.util"><CODE>AbstractCollection.removeAll(java.util.Collection<?>)</CODE></A>.
765 <DD><DL>
766 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/google/common/collect/Multiset.html#retainAll(java.util.Collection)">retainAll</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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
767 </DD>
768 <DD><DL>
769 <DT><B>Parameters:</B><DD><CODE>elementsToRetain</CODE> - elements to be retained in this collection.
770 <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the
771 call.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#remove(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.remove(Object)</CODE></A>,
772 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#contains(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.contains(Object)</CODE></A></DL>
773 </DD>
774 </DL>
775 <HR>
777 <A NAME="clear()"><!-- --></A><H3>
778 clear</H3>
779 <PRE>
780 public void <B>clear</B>()</PRE>
781 <DL>
782 <DD>Removes all of the elements from this multiset.
784 <p>This implementation calls <code>clear</code> on <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>.
786 <DD><DL>
787 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html#clear()" title="class or interface in java.util">clear</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#clear()" title="class or interface in java.util">clear</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
788 </DD>
789 <DD><DL>
790 </DL>
791 </DD>
792 </DL>
793 <HR>
795 <A NAME="elementSet()"><!-- --></A><H3>
796 elementSet</H3>
797 <PRE>
798 public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt; <B>elementSet</B>()</PRE>
799 <DL>
800 <DD>Returns the set of distinct elements contained in this multiset. The
801 element set is backed by the same data as the multiset, so any change to
802 either is immediately reflected in the other. The order of the elements in
803 the element set is unspecified.
805 <p>If the element set supports any removal operations, these necessarily
806 cause <b>all</b> occurrences of the removed element(s) to be removed from
807 the multiset. Implementations are not expected to support the add
808 operations, although this is possible.
810 <p>A common use for the element set is to find the number of distinct
811 elements in the multiset: <code>elementSet().size()</code>.
813 <p>The returned set's methods are implemented by calling
814 <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A> methods.
816 <DD><DL>
817 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
818 </DD>
819 <DD><DL>
821 <DT><B>Returns:</B><DD>a view of the set of distinct elements in this multiset</DL>
822 </DD>
823 </DL>
824 <HR>
826 <A NAME="createElementSet()"><!-- --></A><H3>
827 createElementSet</H3>
828 <PRE>
829 protected <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt; <B>createElementSet</B>()</PRE>
830 <DL>
831 <DD>Creates a new instance of this multiset's element set, which will be
832 returned by <A HREF="../../../../com/google/common/collect/AbstractMultiset.html#elementSet"><CODE>elementSet</CODE></A>.
834 <DD><DL>
835 </DL>
836 </DD>
837 <DD><DL>
838 </DL>
839 </DD>
840 </DL>
841 <HR>
843 <A NAME="equals(java.lang.Object)"><!-- --></A><H3>
844 equals</H3>
845 <PRE>
846 public boolean <B>equals</B>(<FONT SIZE="-1"><A HREF="../../../../com/google/common/base/Nullable.html" title="annotation in com.google.common.base">@Nullable</A></FONT>
847 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;other)</PRE>
848 <DL>
849 <DD>Indicates whether some other object is "equal to" this one.
851 The <code>equals</code> method implements an equivalence relation
852 on non-null object references:
853 <ul>
854 <li>It is <i>reflexive</i>: for any non-null reference value
855 <code>x</code>, <code>x.equals(x)</code> should return
856 <code>true</code>.
857 <li>It is <i>symmetric</i>: for any non-null reference values
858 <code>x</code> and <code>y</code>, <code>x.equals(y)</code>
859 should return <code>true</code> if and only if
860 <code>y.equals(x)</code> returns <code>true</code>.
861 <li>It is <i>transitive</i>: for any non-null reference values
862 <code>x</code>, <code>y</code>, and <code>z</code>, if
863 <code>x.equals(y)</code> returns <code>true</code> and
864 <code>y.equals(z)</code> returns <code>true</code>, then
865 <code>x.equals(z)</code> should return <code>true</code>.
866 <li>It is <i>consistent</i>: for any non-null reference values
867 <code>x</code> and <code>y</code>, multiple invocations of
868 <tt>x.equals(y)</tt> consistently return <code>true</code>
869 or consistently return <code>false</code>, provided no
870 information used in <code>equals</code> comparisons on the
871 objects is modified.
872 <li>For any non-null reference value <code>x</code>,
873 <code>x.equals(null)</code> should return <code>false</code>.
874 </ul>
876 The <tt>equals</tt> method for class <code>Object</code> implements
877 the most discriminating possible equivalence relation on objects;
878 that is, for any non-null reference values <code>x</code> and
879 <code>y</code>, this method returns <code>true</code> if and only
880 if <code>x</code> and <code>y</code> refer to the same object
881 (<code>x == y</code> has the value <code>true</code>).
883 Note that it is generally necessary to override the <tt>hashCode</tt>
884 method whenever this method is overridden, so as to maintain the
885 general contract for the <tt>hashCode</tt> method, which states
886 that equal objects must have equal hash codes.
888 <p>This implementation returns <code>true</code> if <code>other</code> is a multiset
889 of the same size and if, for each element, the two multisets have the same
890 count.
892 <DD><DL>
893 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#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" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#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" title="class or interface in java.lang">Object</A></CODE></DL>
894 </DD>
895 <DD><DL>
896 <DT><B>Parameters:</B><DD><CODE>other</CODE> - the reference object with which to compare.
897 <DT><B>Returns:</B><DD><code>true</code> if this object is the same as the obj
898 argument; <code>false</code> otherwise.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang"><CODE>Object.hashCode()</CODE></A>,
899 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html" title="class or interface in java.util"><CODE>Hashtable</CODE></A></DL>
900 </DD>
901 </DL>
902 <HR>
904 <A NAME="hashCode()"><!-- --></A><H3>
905 hashCode</H3>
906 <PRE>
907 public int <B>hashCode</B>()</PRE>
908 <DL>
909 <DD>Returns a hash code value for the object. This method is
910 supported for the benefit of hashtables such as those provided by
911 <code>java.util.Hashtable</code>.
913 The general contract of <code>hashCode</code> is:
914 <ul>
915 <li>Whenever it is invoked on the same object more than once during
916 an execution of a Java application, the <tt>hashCode</tt> method
917 must consistently return the same integer, provided no information
918 used in <tt>equals</tt> comparisons on the object is modified.
919 This integer need not remain consistent from one execution of an
920 application to another execution of the same application.
921 <li>If two objects are equal according to the <tt>equals(Object)</tt>
922 method, then calling the <code>hashCode</code> method on each of
923 the two objects must produce the same integer result.
924 <li>It is <em>not</em> required that if two objects are unequal
925 according to the <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>
926 method, then calling the <tt>hashCode</tt> method on each of the
927 two objects must produce distinct integer results. However, the
928 programmer should be aware that producing distinct integer results
929 for unequal objects may improve the performance of hashtables.
930 </ul>
932 As much as is reasonably practical, the hashCode method defined by
933 class <tt>Object</tt> does return distinct integers for distinct
934 objects. (This is typically implemented by converting the internal
935 address of the object into an integer, but this implementation
936 technique is not required by the
937 Java<font size="-2"><sup>TM</sup></font> programming language.)
939 <p>This implementation returns the hash code of <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>.
941 <DD><DL>
942 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">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#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" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#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" title="class or interface in java.lang">Object</A></CODE></DL>
943 </DD>
944 <DD><DL>
946 <DT><B>Returns:</B><DD>a hash code value for this object.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>,
947 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html" title="class or interface in java.util"><CODE>Hashtable</CODE></A></DL>
948 </DD>
949 </DL>
950 <HR>
952 <A NAME="toString()"><!-- --></A><H3>
953 toString</H3>
954 <PRE>
955 public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
956 <DL>
957 <DD>Returns a string representation of this collection. The string
958 representation consists of a list of the collection's elements in the
959 order they are returned by its iterator, enclosed in square brackets
960 (<tt>"[]"</tt>). Adjacent elements are separated by the characters
961 <tt>", "</tt> (comma and space). Elements are converted to strings as
962 by <tt>String.valueOf(Object)</tt>.<p>
964 This implementation creates an empty string buffer, appends a left
965 square bracket, and iterates over the collection appending the string
966 representation of each element in turn. After appending each element
967 except the last, the string <tt>", "</tt> is appended. Finally a right
968 bracket is appended. A string is obtained from the string buffer, and
969 returned.
971 <p>This implementation returns the result of invoking <code>toString</code> on
972 <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>.
974 <DD><DL>
975 <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/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html#toString()" title="class or interface in java.util">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/AbstractMultiset.html" title="type parameter in AbstractMultiset">E</A>&gt;</CODE></DL>
976 </DD>
977 <DD><DL>
979 <DT><B>Returns:</B><DD>a string representation of this collection.</DL>
980 </DD>
981 </DL>
982 <!-- ========= END OF CLASS DATA ========= -->
983 <HR>
986 <!-- ======= START OF BOTTOM NAVBAR ====== -->
987 <A NAME="navbar_bottom"><!-- --></A>
988 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
989 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
990 <TR>
991 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
992 <A NAME="navbar_bottom_firstrow"><!-- --></A>
993 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
994 <TR ALIGN="center" VALIGN="top">
995 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
996 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
997 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
998 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
999 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
1000 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
1001 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
1002 </TR>
1003 </TABLE>
1004 </TD>
1005 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
1006 </EM>
1007 </TD>
1008 </TR>
1010 <TR>
1011 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1012 &nbsp;<A HREF="../../../../com/google/common/collect/AbstractMapEntry.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
1013 &nbsp;<A HREF="../../../../com/google/common/collect/AbstractMultisetEntry.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
1014 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1015 <A HREF="../../../../index.html?com/google/common/collect/AbstractMultiset.html" target="_top"><B>FRAMES</B></A> &nbsp;
1016 &nbsp;<A HREF="AbstractMultiset.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
1017 &nbsp;<SCRIPT type="text/javascript">
1018 <!--
1019 if(window==top) {
1020 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
1022 //-->
1023 </SCRIPT>
1024 <NOSCRIPT>
1025 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
1026 </NOSCRIPT>
1029 </FONT></TD>
1030 </TR>
1031 <TR>
1032 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1033 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1034 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1035 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1036 </TR>
1037 </TABLE>
1038 <A NAME="skip-navbar_bottom"></A>
1039 <!-- ======== END OF BOTTOM NAVBAR ======= -->
1041 <HR>
1043 </BODY>
1044 </HTML>