1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <!--NewPage--> 3 <HTML> 4 <HEAD> 5 <!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:47:59 PST 2010 --> 6 <TITLE> 7 TreeMultiset (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"> 15 function windowTitle() 16 { 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="TreeMultiset (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> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TreeMultiset.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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 <A HREF="../../../../com/google/common/collect/TreeMultimap.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A> 59 <A HREF="../../../../com/google/common/collect/UnmodifiableIterator.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/TreeMultiset.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="TreeMultiset.html" target="_top"><B>NO FRAMES</B></A> 63 <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: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81 DETAIL: FIELD | CONSTR | <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"> 91 com.google.common.collect</FONT> 92 <BR> 93 Class TreeMultiset<E></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="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">java.util.AbstractCollection</A><E> 97 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.TreeMultiset<E></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><E>, <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><E>, <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><E></DD> 101 </DL> 102 <HR> 103 <DL> 104 <DT><PRE>public final class <B>TreeMultiset<E></B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></DL> 105 </PRE> 106 107 <P> 108 A multiset which maintains the ordering of its elements, according to either 109 their natural order or an explicit <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util"><CODE>Comparator</CODE></A>. In all cases, this 110 implementation uses <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true#compareTo(T)" title="class or interface in java.lang"><CODE>Comparable.compareTo(T)</CODE></A> or <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true#compare(T, T)" title="class or interface in java.util"><CODE>Comparator.compare(T, T)</CODE></A> instead of <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> to determine 111 equivalence of instances. 112 113 <p><b>Warning:</b> The comparison must be <i>consistent with equals</i> as 114 explained by the <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang"><CODE>Comparable</CODE></A> class specification. Otherwise, the 115 resulting multiset will violate the <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util"><CODE>Collection</CODE></A> contract, which it is 116 specified in terms of <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>. 117 <P> 118 119 <P> 120 <DL> 121 <DT><B>Since:</B></DT> 122 <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD> 123 <DT><B>Author:</B></DT> 124 <DD>Neal Kanodia, Jared Levy</DD> 125 <DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#com.google.common.collect.TreeMultiset">Serialized Form</A></DL> 126 <HR> 127 128 <P> 129 <!-- ======== NESTED CLASS SUMMARY ======== --> 130 131 <A NAME="nested_class_summary"><!-- --></A> 132 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 133 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 134 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 135 <B>Nested Class Summary</B></FONT></TH> 136 </TR> 137 </TABLE> 138 <A NAME="nested_classes_inherited_from_class_com.google.common.collect.Multiset"><!-- --></A> 139 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 140 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 141 <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> 142 </TR> 143 <TR BGCOLOR="white" CLASS="TableRowColor"> 144 <TD><CODE><A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="interface in com.google.common.collect">Multiset.Entry</A><<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="type parameter in Multiset.Entry">E</A>></CODE></TD> 145 </TR> 146 </TABLE> 147 148 149 <!-- ========== METHOD SUMMARY =========== --> 150 151 <A NAME="method_summary"><!-- --></A> 152 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 153 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 154 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 155 <B>Method Summary</B></FONT></TH> 156 </TR> 157 <TR BGCOLOR="white" CLASS="TableRowColor"> 158 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 159 <CODE> boolean</CODE></FONT></TD> 160 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#add(E)">add</A></B>(E element)</CODE> 161 162 <BR> 163 Adds a single occurrence of the specified element to this multiset.</TD> 164 </TR> 165 <TR BGCOLOR="white" CLASS="TableRowColor"> 166 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 167 <CODE> int</CODE></FONT></TD> 168 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#add(E, int)">add</A></B>(E element, 169 int occurrences)</CODE> 170 171 <BR> 172 Adds a number of occurrences of an element to this multiset.</TD> 173 </TR> 174 <TR BGCOLOR="white" CLASS="TableRowColor"> 175 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 176 <CODE> boolean</CODE></FONT></TD> 177 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#addAll(java.util.Collection)">addAll</A></B>(<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><? extends E> elementsToAdd)</CODE> 178 179 <BR> 180 </TD> 181 </TR> 182 <TR BGCOLOR="white" CLASS="TableRowColor"> 183 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 184 <CODE> void</CODE></FONT></TD> 185 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#clear()">clear</A></B>()</CODE> 186 187 <BR> 188 </TD> 189 </TR> 190 <TR BGCOLOR="white" CLASS="TableRowColor"> 191 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 192 <CODE> boolean</CODE></FONT></TD> 193 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.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> element)</CODE> 194 195 <BR> 196 Determines whether this multiset contains the specified element.</TD> 197 </TR> 198 <TR BGCOLOR="white" CLASS="TableRowColor"> 199 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 200 <CODE> boolean</CODE></FONT></TD> 201 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#containsAll(java.util.Collection)">containsAll</A></B>(<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><?> elements)</CODE> 202 203 <BR> 204 Returns <code>true</code> if this multiset contains at least one occurrence of 205 each element in the specified collection.</TD> 206 </TR> 207 <TR BGCOLOR="white" CLASS="TableRowColor"> 208 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 209 <CODE> int</CODE></FONT></TD> 210 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.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> element)</CODE> 211 212 <BR> 213 Returns the number of occurrences of an element in this multiset (the 214 <i>count</i> of the element).</TD> 215 </TR> 216 <TR BGCOLOR="white" CLASS="TableRowColor"> 217 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 218 <CODE>static 219 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 220 <TR ALIGN="right" VALIGN=""> 221 <TD NOWRAP><FONT SIZE="-1"> 222 <CODE><E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>> 223 <BR> 224 <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A><E></CODE></FONT></TD> 225 </TR> 226 </TABLE> 227 </CODE></FONT></TD> 228 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#create()">create</A></B>()</CODE> 229 230 <BR> 231 Creates a new, empty multiset, sorted according to the elements' natural 232 order.</TD> 233 </TR> 234 <TR BGCOLOR="white" CLASS="TableRowColor"> 235 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 236 <CODE>static 237 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 238 <TR ALIGN="right" VALIGN=""> 239 <TD NOWRAP><FONT SIZE="-1"> 240 <CODE><E> <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A><E></CODE></FONT></TD> 241 </TR> 242 </TABLE> 243 </CODE></FONT></TD> 244 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#create(java.util.Comparator)">create</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><? super E> comparator)</CODE> 245 246 <BR> 247 Creates a new, empty multiset, sorted according to the specified 248 comparator.</TD> 249 </TR> 250 <TR BGCOLOR="white" CLASS="TableRowColor"> 251 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 252 <CODE>static 253 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 254 <TR ALIGN="right" VALIGN=""> 255 <TD NOWRAP><FONT SIZE="-1"> 256 <CODE><E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>> 257 <BR> 258 <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A><E></CODE></FONT></TD> 259 </TR> 260 </TABLE> 261 </CODE></FONT></TD> 262 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#create(java.lang.Iterable)">create</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><? extends E> elements)</CODE> 263 264 <BR> 265 Creates an empty multiset containing the given initial elements, sorted 266 according to the elements' natural order.</TD> 267 </TR> 268 <TR BGCOLOR="white" CLASS="TableRowColor"> 269 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 270 <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html?is-external=true" title="class or interface in java.util">SortedSet</A><<A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="type parameter in TreeMultiset">E</A>></CODE></FONT></TD> 271 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#elementSet()">elementSet</A></B>()</CODE> 272 273 <BR> 274 Returns the set of distinct elements contained in this multiset.</TD> 275 </TR> 276 <TR BGCOLOR="white" CLASS="TableRowColor"> 277 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 278 <CODE> <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><<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="interface in com.google.common.collect">Multiset.Entry</A><E>></CODE></FONT></TD> 279 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#entrySet()">entrySet</A></B>()</CODE> 280 281 <BR> 282 Returns a view of the contents of this multiset, grouped into <code>Multiset.Entry</code> instances, each providing an element of the multiset and 283 the count of that element.</TD> 284 </TR> 285 <TR BGCOLOR="white" CLASS="TableRowColor"> 286 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 287 <CODE> boolean</CODE></FONT></TD> 288 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.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> object)</CODE> 289 290 <BR> 291 Compares the specified object with this multiset for equality.</TD> 292 </TR> 293 <TR BGCOLOR="white" CLASS="TableRowColor"> 294 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 295 <CODE> int</CODE></FONT></TD> 296 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#hashCode()">hashCode</A></B>()</CODE> 297 298 <BR> 299 Returns the hash code for this multiset.</TD> 300 </TR> 301 <TR BGCOLOR="white" CLASS="TableRowColor"> 302 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 303 <CODE> boolean</CODE></FONT></TD> 304 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#isEmpty()">isEmpty</A></B>()</CODE> 305 306 <BR> 307 </TD> 308 </TR> 309 <TR BGCOLOR="white" CLASS="TableRowColor"> 310 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 311 <CODE> <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><E></CODE></FONT></TD> 312 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#iterator()">iterator</A></B>()</CODE> 313 314 <BR> 315 </TD> 316 </TR> 317 <TR BGCOLOR="white" CLASS="TableRowColor"> 318 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 319 <CODE> boolean</CODE></FONT></TD> 320 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#remove(java.lang.Object)">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> element)</CODE> 321 322 <BR> 323 Removes a <i>single</i> occurrence of the specified element from this 324 multiset, if present.</TD> 325 </TR> 326 <TR BGCOLOR="white" CLASS="TableRowColor"> 327 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 328 <CODE> int</CODE></FONT></TD> 329 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.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> element, 330 int occurrences)</CODE> 331 332 <BR> 333 Removes a number of occurrences of the specified element from this 334 multiset.</TD> 335 </TR> 336 <TR BGCOLOR="white" CLASS="TableRowColor"> 337 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 338 <CODE> boolean</CODE></FONT></TD> 339 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#removeAll(java.util.Collection)">removeAll</A></B>(<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><?> elementsToRemove)</CODE> 340 341 <BR> 342 </TD> 343 </TR> 344 <TR BGCOLOR="white" CLASS="TableRowColor"> 345 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 346 <CODE> boolean</CODE></FONT></TD> 347 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#retainAll(java.util.Collection)">retainAll</A></B>(<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><?> elementsToRetain)</CODE> 348 349 <BR> 350 </TD> 351 </TR> 352 <TR BGCOLOR="white" CLASS="TableRowColor"> 353 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 354 <CODE> int</CODE></FONT></TD> 355 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#setCount(E, int)">setCount</A></B>(E element, 356 int count)</CODE> 357 358 <BR> 359 Adds or removes the necessary occurrences of an element such that the 360 element attains the desired count.</TD> 361 </TR> 362 <TR BGCOLOR="white" CLASS="TableRowColor"> 363 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 364 <CODE> boolean</CODE></FONT></TD> 365 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#setCount(E, int, int)">setCount</A></B>(E element, 366 int oldCount, 367 int newCount)</CODE> 368 369 <BR> 370 Conditionally sets the count of an element to a new value, as described in 371 <A HREF="../../../../com/google/common/collect/Multiset.html#setCount(E, int)"><CODE>Multiset.setCount(Object, int)</CODE></A>, provided that the element has the expected 372 current count.</TD> 373 </TR> 374 <TR BGCOLOR="white" CLASS="TableRowColor"> 375 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 376 <CODE> int</CODE></FONT></TD> 377 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#size()">size</A></B>()</CODE> 378 379 <BR> 380 </TD> 381 </TR> 382 <TR BGCOLOR="white" CLASS="TableRowColor"> 383 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 384 <CODE> <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> 385 <TD><CODE><B><A HREF="../../../../com/google/common/collect/TreeMultiset.html#toString()">toString</A></B>()</CODE> 386 387 <BR> 388 </TD> 389 </TR> 390 </TABLE> 391 <A NAME="methods_inherited_from_class_java.util.AbstractCollection"><!-- --></A> 392 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 393 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 394 <TH ALIGN="left"><B>Methods inherited from class java.util.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">AbstractCollection</A></B></TH> 395 </TR> 396 <TR BGCOLOR="white" CLASS="TableRowColor"> 397 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.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/AbstractCollection.html?is-external=true#toArray(T[])" title="class or interface in java.util">toArray</A></CODE></TD> 398 </TR> 399 </TABLE> 400 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 401 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 402 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 403 <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> 404 </TR> 405 <TR BGCOLOR="white" CLASS="TableRowColor"> 406 <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> 407 </TR> 408 </TABLE> 409 <A NAME="methods_inherited_from_class_java.util.Collection"><!-- --></A> 410 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 411 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 412 <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> 413 </TR> 414 <TR BGCOLOR="white" CLASS="TableRowColor"> 415 <TD><CODE><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> 416 </TR> 417 </TABLE> 418 419 <P> 420 421 <!-- ============ METHOD DETAIL ========== --> 422 423 <A NAME="method_detail"><!-- --></A> 424 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 425 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 426 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 427 <B>Method Detail</B></FONT></TH> 428 </TR> 429 </TABLE> 430 431 <A NAME="create()"><!-- --></A><H3> 432 create</H3> 433 <PRE> 434 public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>> <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A><E> <B>create</B>()</PRE> 435 <DL> 436 <DD>Creates a new, empty multiset, sorted according to the elements' natural 437 order. All elements inserted into the multiset must implement the 438 <code>Comparable</code> interface. Furthermore, all such elements must be 439 <i>mutually comparable</i>: <code>e1.compareTo(e2)</code> must not throw a 440 <code>ClassCastException</code> for any elements <code>e1</code> and <code>e2</code> in 441 the multiset. If the user attempts to add an element to the multiset that 442 violates this constraint (for example, the user attempts to add a string 443 element to a set whose elements are integers), the <code>add(Object)</code> 444 call will throw a <code>ClassCastException</code>. 445 446 <p>The type specification is <code><E extends Comparable></code>, instead of the 447 more specific <code><E extends Comparable<? super E>></code>, to support 448 classes defined without generics. 449 <P> 450 <DD><DL> 451 </DL> 452 </DD> 453 </DL> 454 <HR> 455 456 <A NAME="create(java.util.Comparator)"><!-- --></A><H3> 457 create</H3> 458 <PRE> 459 public static <E> <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A><E> <B>create</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><? super E> comparator)</PRE> 460 <DL> 461 <DD>Creates a new, empty multiset, sorted according to the specified 462 comparator. All elements inserted into the multiset must be <i>mutually 463 comparable</i> by the specified comparator: <code>comparator.compare(e1, 464 e2)</code> must not throw a <code>ClassCastException</code> for any elements <code>e1</code> and <code>e2</code> in the multiset. If the user attempts to add an element 465 to the multiset that violates this constraint, the <code>add(Object)</code> call 466 will throw a <code>ClassCastException</code>. 467 <P> 468 <DD><DL> 469 <DT><B>Parameters:</B><DD><CODE>comparator</CODE> - the comparator that will be used to sort this multiset. A 470 null value indicates that the elements' <i>natural ordering</i> should 471 be used.</DL> 472 </DD> 473 </DL> 474 <HR> 475 476 <A NAME="create(java.lang.Iterable)"><!-- --></A><H3> 477 create</H3> 478 <PRE> 479 public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>> <A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="class in com.google.common.collect">TreeMultiset</A><E> <B>create</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><? extends E> elements)</PRE> 480 <DL> 481 <DD>Creates an empty multiset containing the given initial elements, sorted 482 according to the elements' natural order. 483 484 <p>The type specification is <code><E extends Comparable></code>, instead of the 485 more specific <code><E extends Comparable<? super E>></code>, to support 486 classes defined without generics. 487 <P> 488 <DD><DL> 489 </DL> 490 </DD> 491 </DL> 492 <HR> 493 494 <A NAME="elementSet()"><!-- --></A><H3> 495 elementSet</H3> 496 <PRE> 497 public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html?is-external=true" title="class or interface in java.util">SortedSet</A><<A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="type parameter in TreeMultiset">E</A>> <B>elementSet</B>()</PRE> 498 <DL> 499 <DD>Returns the set of distinct elements contained in this multiset. The 500 element set is backed by the same data as the multiset, so any change to 501 either is immediately reflected in the other. The order of the elements in 502 the element set is unspecified. 503 504 <p>If the element set supports any removal operations, these necessarily 505 cause <b>all</b> occurrences of the removed element(s) to be removed from 506 the multiset. Implementations are not expected to support the add 507 operations, although this is possible. 508 509 <p>A common use for the element set is to find the number of distinct 510 elements in the multiset: <code>elementSet().size()</code>. 511 512 <p>In <code>TreeMultiset</code>, the return type of this method is narrowed 513 from <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util"><CODE>Set</CODE></A> to <A HREF="http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html?is-external=true" title="class or interface in java.util"><CODE>SortedSet</CODE></A>. 514 <P> 515 <DD><DL> 516 <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><<A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="type parameter in TreeMultiset">E</A>></CODE></DL> 517 </DD> 518 <DD><DL> 519 520 <DT><B>Returns:</B><DD>a view of the set of distinct elements in this multiset</DL> 521 </DD> 522 </DL> 523 <HR> 524 525 <A NAME="count(java.lang.Object)"><!-- --></A><H3> 526 count</H3> 527 <PRE> 528 public 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> 529 <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> element)</PRE> 530 <DL> 531 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#count(java.lang.Object)">Multiset</A></CODE></B></DD> 532 <DD>Returns the number of occurrences of an element in this multiset (the 533 <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 534 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> 535 (which would presumably perform more poorly). 536 537 <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 538 this operation; it correctly delegates to this method when dealing with a 539 multiset, but it can also accept any other iterable type. 540 <P> 541 <DD><DL> 542 <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><<A HREF="../../../../com/google/common/collect/TreeMultiset.html" title="type parameter in TreeMultiset">E</A>></CODE></DL> 543 </DD> 544 <DD><DL> 545 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to count occurrences of 546 <DT><B>Returns:</B><DD>the number of occurrences of the element in this multiset; possibly 547 zero but never negative</DL> 548 </DD> 549 </DL> 550 <HR> 551 552 <A NAME="entrySet()"><!-- --></A><H3> 553 entrySet</H3> 554 <PRE> 555 public <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><<A HREF="../../../../com/google/common/collect/Multiset.Entry.html" title="interface in com.google.common.collect">Multiset.Entry</A><E>> <B>entrySet</B>()</PRE> 556 <DL> 557 <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 558 the count of that element. This set contains exactly one entry for each 559 distinct element in the multiset (thus it always has the same size as the 560 <A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()"><CODE>Multiset.elementSet()</CODE></A>). The order of the elements in the element set is 561 unspecified. 562 563 <p>The entry set is backed by the same data as the multiset, so any change 564 to either is immediately reflected in the other. However, multiset changes 565 may or may not be reflected in any <code>Entry</code> instances already 566 retrieved from the entry set (this is implementation-dependent). 567 Furthermore, implementations are not required to support modifications to 568 the entry set at all, and the <code>Entry</code> instances themselves don't 569 even have methods for modification. See the specific implementation class 570 for more details on how its entry set handles modifications. 571 572 <p>Invoking <A HREF="../../../../com/google/common/collect/Multiset.Entry.html#getCount()"><CODE>Multiset.Entry.getCount()</CODE></A> on an entry in the returned 573 set always returns the current count of that element in the multiset, as 574 opposed to the count at the time the entry was retrieved. 575 <P> 576 <DD><DL> 577 <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><E></CODE></DL> 578 </DD> 579 <DD><DL> 580 581 <DT><B>Returns:</B><DD>a set of entries representing the data of this multiset</DL> 582 </DD> 583 </DL> 584 <HR> 585 586 <A NAME="size()"><!-- --></A><H3> 587 size</H3> 588 <PRE> 589 public int <B>size</B>()</PRE> 590 <DL> 591 <DD><DL> 592 <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><E></CODE></DL> 593 </DD> 594 <DD><DL> 595 </DL> 596 </DD> 597 </DL> 598 <HR> 599 600 <A NAME="iterator()"><!-- --></A><H3> 601 iterator</H3> 602 <PRE> 603 public <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><E> <B>iterator</B>()</PRE> 604 <DL> 605 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#iterator()">Multiset</A></CODE></B></DD> 606 <DD> 607 608 <p>Elements that occur multiple times in the multiset will appear 609 multiple times in this iterator, though not necessarily sequentially. 610 <P> 611 <DD><DL> 612 <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><E></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><E></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><E></CODE></DL> 613 </DD> 614 <DD><DL> 615 </DL> 616 </DD> 617 </DL> 618 <HR> 619 620 <A NAME="add(java.lang.Object,int)"><!-- --></A><A NAME="add(E, int)"><!-- --></A><H3> 621 add</H3> 622 <PRE> 623 public int <B>add</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> 624 E element, 625 int occurrences)</PRE> 626 <DL> 627 <DD>Adds a number of occurrences of an element to this multiset. Note that if 628 <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 629 of overflow) to the call <code>addAll(Collections.nCopies(element, 630 occurrences))</code>, which would presumably perform much more poorly. 631 <P> 632 <DD><DL> 633 <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><E></CODE></DL> 634 </DD> 635 <DD><DL> 636 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add occurrences of; may be <code>null</code> only 637 if explicitly allowed by the implementation<DD><CODE>occurrences</CODE> - the number of occurrences of the element to add. May be 638 zero, in which case no change will be made. 639 <DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero 640 <DT><B>Throws:</B> 641 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the call would result in more than 642 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true#MAX_VALUE" title="class or interface in java.lang"><CODE>Integer.MAX_VALUE</CODE></A> occurrences of <code>element</code> in this 643 multiset.</DL> 644 </DD> 645 </DL> 646 <HR> 647 648 <A NAME="remove(java.lang.Object, int)"><!-- --></A><H3> 649 remove</H3> 650 <PRE> 651 public int <B>remove</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> 652 <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> element, 653 int occurrences)</PRE> 654 <DL> 655 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#remove(java.lang.Object, int)">Multiset</A></CODE></B></DD> 656 <DD>Removes a number of occurrences of the specified element from this 657 multiset. If the multiset contains fewer than this number of occurrences to 658 begin with, all occurrences will be removed. Note that if 659 <code>occurrences == 1</code>, this is functionally equivalent to the call 660 <code>remove(element)</code>. 661 <P> 662 <DD><DL> 663 <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><E></CODE></DL> 664 </DD> 665 <DD><DL> 666 <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 667 be zero, in which case no change will be made. 668 <DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero</DL> 669 </DD> 670 </DL> 671 <HR> 672 673 <A NAME="setCount(java.lang.Object,int)"><!-- --></A><A NAME="setCount(E, int)"><!-- --></A><H3> 674 setCount</H3> 675 <PRE> 676 public int <B>setCount</B>(E element, 677 int count)</PRE> 678 <DL> 679 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#setCount(E, int)">Multiset</A></CODE></B></DD> 680 <DD>Adds or removes the necessary occurrences of an element such that the 681 element attains the desired count. 682 <P> 683 <DD><DL> 684 <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><E></CODE></DL> 685 </DD> 686 <DD><DL> 687 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add or remove occurrences of; may be null 688 only if explicitly allowed by the implementation<DD><CODE>count</CODE> - the desired count of the element in this multiset 689 <DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero</DL> 690 </DD> 691 </DL> 692 <HR> 693 694 <A NAME="isEmpty()"><!-- --></A><H3> 695 isEmpty</H3> 696 <PRE> 697 public boolean <B>isEmpty</B>()</PRE> 698 <DL> 699 <DD><DL> 700 <DT><B>Specified by:</B><DD><CODE><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></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><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 701 </DD> 702 <DD><DL> 703 </DL> 704 </DD> 705 </DL> 706 <HR> 707 708 <A NAME="contains(java.lang.Object)"><!-- --></A><H3> 709 contains</H3> 710 <PRE> 711 public 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> 712 <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> element)</PRE> 713 <DL> 714 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#contains(java.lang.Object)">Multiset</A></CODE></B></DD> 715 <DD>Determines whether this multiset contains the specified element. 716 717 <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 718 it <b>may not</b> throw an exception in response to <code>element</code> being 719 null or of the wrong type. 720 <P> 721 <DD><DL> 722 <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><E></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><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 723 </DD> 724 <DD><DL> 725 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to check for 726 <DT><B>Returns:</B><DD><code>true</code> if this multiset contains at least one occurrence of 727 the element</DL> 728 </DD> 729 </DL> 730 <HR> 731 732 <A NAME="add(java.lang.Object)"><!-- --></A><A NAME="add(E)"><!-- --></A><H3> 733 add</H3> 734 <PRE> 735 public boolean <B>add</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> 736 E element)</PRE> 737 <DL> 738 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#add(E)">Multiset</A></CODE></B></DD> 739 <DD>Adds a single occurrence of the specified element to this multiset. 740 741 <p>This method refines <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#add(E)" title="class or interface in java.util"><CODE>Collection.add(E)</CODE></A>, which only <i>ensures</i> 742 the presence of the element, to further specify that a successful call must 743 always increment the count of the element, and the overall size of the 744 collection, by one. 745 <P> 746 <DD><DL> 747 <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><E></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#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?is-external=true" title="class or interface in java.util">Collection</A><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 748 </DD> 749 <DD><DL> 750 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add one occurrence of; may be null only if 751 explicitly allowed by the implementation 752 <DT><B>Returns:</B><DD><code>true</code> always, since this call is required to modify the 753 multiset, unlike other <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util"><CODE>Collection</CODE></A> types</DL> 754 </DD> 755 </DL> 756 <HR> 757 758 <A NAME="remove(java.lang.Object)"><!-- --></A><H3> 759 remove</H3> 760 <PRE> 761 public boolean <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> element)</PRE> 762 <DL> 763 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#remove(java.lang.Object)">Multiset</A></CODE></B></DD> 764 <DD>Removes a <i>single</i> occurrence of the specified element from this 765 multiset, if present. 766 767 <p>This method refines <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util"><CODE>Collection.remove(java.lang.Object)</CODE></A> to further specify that it 768 <b>may not</b> throw an exception in response to <code>element</code> being null 769 or of the wrong type. 770 <P> 771 <DD><DL> 772 <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><E></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#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?is-external=true" title="class or interface in java.util">Collection</A><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 773 </DD> 774 <DD><DL> 775 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to remove one occurrence of 776 <DT><B>Returns:</B><DD><code>true</code> if an occurrence was found and removed</DL> 777 </DD> 778 </DL> 779 <HR> 780 781 <A NAME="setCount(java.lang.Object,int,int)"><!-- --></A><A NAME="setCount(E, int, int)"><!-- --></A><H3> 782 setCount</H3> 783 <PRE> 784 public boolean <B>setCount</B>(E element, 785 int oldCount, 786 int newCount)</PRE> 787 <DL> 788 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#setCount(E, int, int)">Multiset</A></CODE></B></DD> 789 <DD>Conditionally sets the count of an element to a new value, as described in 790 <A HREF="../../../../com/google/common/collect/Multiset.html#setCount(E, int)"><CODE>Multiset.setCount(Object, int)</CODE></A>, provided that the element has the expected 791 current count. If the current count is not <code>oldCount</code>, no change is 792 made. 793 <P> 794 <DD><DL> 795 <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><E></CODE></DL> 796 </DD> 797 <DD><DL> 798 <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to conditionally set the count of; may be null 799 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 800 <DT><B>Returns:</B><DD><code>true</code> if the condition for modification was met. This 801 implies that the multiset was indeed modified, unless 802 <code>oldCount == newCount</code>.</DL> 803 </DD> 804 </DL> 805 <HR> 806 807 <A NAME="containsAll(java.util.Collection)"><!-- --></A><H3> 808 containsAll</H3> 809 <PRE> 810 public boolean <B>containsAll</B>(<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><?> elements)</PRE> 811 <DL> 812 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#containsAll(java.util.Collection)">Multiset</A></CODE></B></DD> 813 <DD>Returns <code>true</code> if this multiset contains at least one occurrence of 814 each element in the specified collection. 815 816 <p>This method refines <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util"><CODE>Collection.containsAll(java.util.Collection<?>)</CODE></A> to further specify 817 that it <b>may not</b> throw an exception in response to any of <code>elements</code> being null or of the wrong type. 818 819 <p><b>Note:</b> this method does not take into account the occurrence 820 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 821 and this multiset contains only one. This is no different than any other 822 collection type like <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util"><CODE>List</CODE></A>, but it may be unexpected to the user of 823 a multiset. 824 <P> 825 <DD><DL> 826 <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><E></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#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?is-external=true" title="class or interface in java.util">Collection</A><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 827 </DD> 828 <DD><DL> 829 <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the collection of elements to be checked for containment in 830 this multiset 831 <DT><B>Returns:</B><DD><code>true</code> if this multiset contains at least one occurrence of 832 each element contained in <code>elements</code></DL> 833 </DD> 834 </DL> 835 <HR> 836 837 <A NAME="addAll(java.util.Collection)"><!-- --></A><H3> 838 addAll</H3> 839 <PRE> 840 public boolean <B>addAll</B>(<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><? extends E> elementsToAdd)</PRE> 841 <DL> 842 <DD><DL> 843 <DT><B>Specified by:</B><DD><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></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><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 844 </DD> 845 <DD><DL> 846 </DL> 847 </DD> 848 </DL> 849 <HR> 850 851 <A NAME="removeAll(java.util.Collection)"><!-- --></A><H3> 852 removeAll</H3> 853 <PRE> 854 public boolean <B>removeAll</B>(<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><?> elementsToRemove)</PRE> 855 <DL> 856 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#removeAll(java.util.Collection)">Multiset</A></CODE></B></DD> 857 <DD> 858 859 <p>This method refines <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util"><CODE>Collection.removeAll(java.util.Collection<?>)</CODE></A> to further specify that 860 it <b>may not</b> throw an exception in response to any of <code>elements</code> 861 being null or of the wrong type. 862 <P> 863 <DD><DL> 864 <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><E></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#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?is-external=true" title="class or interface in java.util">Collection</A><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 865 </DD> 866 <DD><DL> 867 </DL> 868 </DD> 869 </DL> 870 <HR> 871 872 <A NAME="retainAll(java.util.Collection)"><!-- --></A><H3> 873 retainAll</H3> 874 <PRE> 875 public boolean <B>retainAll</B>(<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><?> elementsToRetain)</PRE> 876 <DL> 877 <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#retainAll(java.util.Collection)">Multiset</A></CODE></B></DD> 878 <DD> 879 880 <p>This method refines <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util"><CODE>Collection.retainAll(java.util.Collection<?>)</CODE></A> to further specify that 881 it <b>may not</b> throw an exception in response to any of <code>elements</code> 882 being null or of the wrong type. 883 <P> 884 <DD><DL> 885 <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><E></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#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?is-external=true" title="class or interface in java.util">Collection</A><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 886 </DD> 887 <DD><DL> 888 </DL> 889 </DD> 890 </DL> 891 <HR> 892 893 <A NAME="clear()"><!-- --></A><H3> 894 clear</H3> 895 <PRE> 896 public void <B>clear</B>()</PRE> 897 <DL> 898 <DD><DL> 899 <DT><B>Specified by:</B><DD><CODE><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></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><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 900 </DD> 901 <DD><DL> 902 </DL> 903 </DD> 904 </DL> 905 <HR> 906 907 <A NAME="equals(java.lang.Object)"><!-- --></A><H3> 908 equals</H3> 909 <PRE> 910 public 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> 911 <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> object)</PRE> 912 <DL> 913 <DD>Compares the specified object with this multiset for equality. Returns 914 <code>true</code> if the given object is also a multiset and contains equal 915 elements with equal counts, regardless of order. 916 917 <p>This implementation returns <code>true</code> if <code>other</code> is a multiset 918 of the same size and if, for each element, the two multisets have the same 919 count. 920 <P> 921 <DD><DL> 922 <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><E></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><E></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> 923 </DD> 924 <DD><DL> 925 </DL> 926 </DD> 927 </DL> 928 <HR> 929 930 <A NAME="hashCode()"><!-- --></A><H3> 931 hashCode</H3> 932 <PRE> 933 public int <B>hashCode</B>()</PRE> 934 <DL> 935 <DD>Returns the hash code for this multiset. This is defined as the sum of 936 937 <pre> (element == null ? 0 : element.hashCode()) ^ count(element)</pre> 938 939 over all distinct elements in the multiset. It follows that a multiset and 940 its entry set always have the same hash code. 941 942 <p>This implementation returns the hash code of <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>. 943 <P> 944 <DD><DL> 945 <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><E></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><E></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> 946 </DD> 947 <DD><DL> 948 </DL> 949 </DD> 950 </DL> 951 <HR> 952 953 <A NAME="toString()"><!-- --></A><H3> 954 toString</H3> 955 <PRE> 956 public <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> 957 <DL> 958 <DD> 959 960 <p>It is recommended, though not mandatory, that this method return the 961 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 962 result such as 963 <pre> 964 [a x 3, c, d x 2, e] 965 </pre> 966 967 <p>This implementation returns the result of invoking <code>toString</code> on 968 <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>. 969 <P> 970 <DD><DL> 971 <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><E></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> 972 </DD> 973 <DD><DL> 974 </DL> 975 </DD> 976 </DL> 977 <!-- ========= END OF CLASS DATA ========= --> 978 <HR> 979 980 981 <!-- ======= START OF BOTTOM NAVBAR ====== --> 982 <A NAME="navbar_bottom"><!-- --></A> 983 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 984 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 985 <TR> 986 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 987 <A NAME="navbar_bottom_firstrow"><!-- --></A> 988 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 989 <TR ALIGN="center" VALIGN="top"> 990 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 991 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 992 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 993 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TreeMultiset.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 994 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 995 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 996 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 997 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 998 </TR> 999 </TABLE> 1000 </TD> 1001 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 1002 </EM> 1003 </TD> 1004 </TR> 1005 1006 <TR> 1007 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 1008 <A HREF="../../../../com/google/common/collect/TreeMultimap.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A> 1009 <A HREF="../../../../com/google/common/collect/UnmodifiableIterator.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD> 1010 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 1011 <A HREF="../../../../index.html?com/google/common/collect/TreeMultiset.html" target="_top"><B>FRAMES</B></A> 1012 <A HREF="TreeMultiset.html" target="_top"><B>NO FRAMES</B></A> 1013 <SCRIPT type="text/javascript"> 1014 <!-- 1015 if(window==top) { 1016 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 1017 } 1018 //--> 1019 </SCRIPT> 1020 <NOSCRIPT> 1021 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 1022 </NOSCRIPT> 1023 1024 1025 </FONT></TD> 1026 </TR> 1027 <TR> 1028 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 1029 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 1030 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 1031 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 1032 </TR> 1033 </TABLE> 1034 <A NAME="skip-navbar_bottom"></A> 1035 <!-- ======== END OF BOTTOM NAVBAR ======= --> 1036 1037 <HR> 1038 1039 </BODY> 1040 </HTML> 1041