| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0-google-internal) on Wed Dec 09 09:28:15 PST 2009 --> |
| <TITLE> |
| ConcurrentHashMultiset (Google Collections Library 1.0-rc5) |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2009-12-09"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="ConcurrentHashMultiset (Google Collections Library 1.0-rc5)"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ConcurrentHashMultiset.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../com/google/common/collect/ComputationException.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A> |
| <A HREF="../../../../com/google/common/collect/EnumBiMap.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?com/google/common/collect/ConcurrentHashMultiset.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="ConcurrentHashMultiset.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| com.google.common.collect</FONT> |
| <BR> |
| Class ConcurrentHashMultiset<E></H2> |
| <PRE> |
| <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> |
| <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> |
| <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.ConcurrentHashMultiset<E></B> |
| </PRE> |
| <DL> |
| <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> |
| </DL> |
| <HR> |
| <DL> |
| <DT><PRE>public final class <B>ConcurrentHashMultiset<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><DT>implements <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></DL> |
| </PRE> |
| |
| <P> |
| A multiset that supports concurrent modifications and that provides atomic |
| versions of most <code>Multiset</code> operations (exceptions where noted). Null |
| elements are not supported. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Author:</B></DT> |
| <DD>Cliff L. Biffle</DD> |
| <DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#com.google.common.collect.ConcurrentHashMultiset">Serialized Form</A></DL> |
| <HR> |
| |
| <P> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| |
| <A NAME="nested_class_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Nested Class Summary</B></FONT></TH> |
| </TR> |
| </TABLE> |
| <A NAME="nested_classes_inherited_from_class_com.google.common.collect.Multiset"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <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> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <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> |
| </TR> |
| </TABLE> |
| |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#add(E)">add</A></B>(E element)</CODE> |
| |
| <BR> |
| Ensures that this collection contains the specified element (optional |
| operation).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#add(E, int)">add</A></B>(<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A> element, |
| int occurrences)</CODE> |
| |
| <BR> |
| Adds a number of occurrences of the specified element to this multiset.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Adds all of the elements in the specified collection to this collection |
| (optional operation).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#clear()">clear</A></B>()</CODE> |
| |
| <BR> |
| Removes all of the elements from this collection (optional operation).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Returns <tt>true</tt> if this collection contains the specified element.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Returns <tt>true</tt> if this collection contains all of the elements |
| in the specified collection.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Returns the number of occurrences of <code>element</code> in this multiset.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><E> <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="class in com.google.common.collect">ConcurrentHashMultiset</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#create()">create</A></B>()</CODE> |
| |
| <BR> |
| Creates a new, empty <code>ConcurrentHashMultiset</code> using the default |
| initial capacity, load factor, and concurrency settings.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><E> <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="class in com.google.common.collect">ConcurrentHashMultiset</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Creates a new <code>ConcurrentHashMultiset</code> containing the specified |
| elements, using the default initial capacity, load factor, and concurrency |
| settings.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <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><E></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#elementSet()">elementSet</A></B>()</CODE> |
| |
| <BR> |
| Returns the set of distinct elements contained in this multiset.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>>></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#entrySet()">entrySet</A></B>()</CODE> |
| |
| <BR> |
| Returns a view of the contents of this multiset, grouped into <code>Multiset.Entry</code> instances, each providing an element of the multiset and |
| the count of that element.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Indicates whether some other object is "equal to" this one.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#hashCode()">hashCode</A></B>()</CODE> |
| |
| <BR> |
| Returns a hash code value for the object.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#isEmpty()">isEmpty</A></B>()</CODE> |
| |
| <BR> |
| Returns <tt>true</tt> if this collection contains no elements.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <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> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#iterator()">iterator</A></B>()</CODE> |
| |
| <BR> |
| Returns an iterator over the elements contained in this collection.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Removes a single instance of the specified element from this |
| collection, if it is present (optional operation).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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, |
| int occurrences)</CODE> |
| |
| <BR> |
| Removes a number of occurrences of the specified element from this |
| multiset.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Removes all of this collection's elements that are also contained in the |
| specified collection (optional operation).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#removeExactly(java.lang.Object, int)">removeExactly</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, |
| int occurrences)</CODE> |
| |
| <BR> |
| Removes exactly the specified number of occurrences of <code>element</code>, or |
| makes no change if this is not possible.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.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> |
| |
| <BR> |
| Retains only the elements in this collection that are contained in the |
| specified collection (optional operation).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#setCount(E, int)">setCount</A></B>(<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A> element, |
| int count)</CODE> |
| |
| <BR> |
| Adds or removes occurrences of <code>element</code> such that the <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#count(java.lang.Object)"><CODE>count(java.lang.Object)</CODE></A> |
| of the element becomes <code>count</code>.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#setCount(E, int, int)">setCount</A></B>(<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A> element, |
| int oldCount, |
| int newCount)</CODE> |
| |
| <BR> |
| Sets the number of occurrences of <code>element</code> to <code>newCount</code>, but |
| only if the count is currently <code>oldCount</code>.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#size()">size</A></B>()</CODE> |
| |
| <BR> |
| Returns the number of elements in this collection.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <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></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#toArray()">toArray</A></B>()</CODE> |
| |
| <BR> |
| Returns an array containing all of the elements in this collection.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><T> T[]</CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#toArray(T[])">toArray</A></B>(T[] array)</CODE> |
| |
| <BR> |
| Returns an array containing all of the elements in this collection; |
| the runtime type of the returned array is that of the specified array.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <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> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#toString()">toString</A></B>()</CODE> |
| |
| <BR> |
| Returns a string representation of this collection.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <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> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <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> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="create()"><!-- --></A><H3> |
| create</H3> |
| <PRE> |
| public static <E> <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="class in com.google.common.collect">ConcurrentHashMultiset</A><E> <B>create</B>()</PRE> |
| <DL> |
| <DD>Creates a new, empty <code>ConcurrentHashMultiset</code> using the default |
| initial capacity, load factor, and concurrency settings. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="create(java.lang.Iterable)"><!-- --></A><H3> |
| create</H3> |
| <PRE> |
| public static <E> <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="class in com.google.common.collect">ConcurrentHashMultiset</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> |
| <DL> |
| <DD>Creates a new <code>ConcurrentHashMultiset</code> containing the specified |
| elements, using the default initial capacity, load factor, and concurrency |
| settings. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements that the multiset should contain</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="count(java.lang.Object)"><!-- --></A><H3> |
| count</H3> |
| <PRE> |
| 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> |
| <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> |
| <DL> |
| <DD>Returns the number of occurrences of <code>element</code> in this multiset. |
| <P> |
| <DD><DL> |
| <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/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to look for |
| <DT><B>Returns:</B><DD>the nonnegative number of occurrences of the element</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="size()"><!-- --></A><H3> |
| size</H3> |
| <PRE> |
| public int <B>size</B>()</PRE> |
| <DL> |
| <DD>Returns the number of elements in this collection. If this collection |
| contains more than <tt>Integer.MAX_VALUE</tt> elements, returns |
| <tt>Integer.MAX_VALUE</tt>. |
| |
| <p>If the data in the multiset is modified by any other threads during this |
| method, it is undefined which (if any) of these modifications will be |
| reflected in the result. |
| <P> |
| <DD><DL> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>the number of elements in this collection</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="toArray()"><!-- --></A><H3> |
| toArray</H3> |
| <PRE> |
| public <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>toArray</B>()</PRE> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Returns an array containing all of the elements in this collection. |
| If this collection makes any guarantees as to what order its elements |
| are returned by its iterator, this method must return the elements in |
| the same order. |
| |
| <p>The returned array will be "safe" in that no references to it are |
| maintained by this collection. (In other words, this method must |
| allocate a new array even if this collection is backed by an array). |
| The caller is thus free to modify the returned array. |
| |
| <p>This method acts as bridge between array-based and collection-based |
| APIs. |
| |
| <p>This implementation returns an array containing all the elements |
| returned by this collection's iterator, in the same order, stored in |
| consecutive elements of the array, starting with index <code>0</code>. |
| The length of the returned array is equal to the number of elements |
| returned by the iterator, even if the size of this collection changes |
| during iteration, as might happen if the collection permits |
| concurrent modification during iteration. The <code>size</code> method is |
| called only as an optimization hint; the correct result is returned |
| even if the iterator returns a different number of elements. |
| |
| <p>This method is equivalent to: |
| |
| <pre> <code>List<E> list = new ArrayList<E>(size()); |
| for (E e : this) |
| list.add(e); |
| return list.toArray(); |
| </code></pre> |
| <P> |
| <DD><DL> |
| <DT><B>Specified by:</B><DD><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></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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE><DT><B>Overrides:</B><DD><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></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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>an array containing all of the elements in this collection</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="toArray(java.lang.Object[])"><!-- --></A><A NAME="toArray(T[])"><!-- --></A><H3> |
| toArray</H3> |
| <PRE> |
| public <T> T[] <B>toArray</B>(T[] array)</PRE> |
| <DL> |
| <DD><B>Description copied from class: <CODE><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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Returns an array containing all of the elements in this collection; |
| the runtime type of the returned array is that of the specified array. |
| If the collection fits in the specified array, it is returned therein. |
| Otherwise, a new array is allocated with the runtime type of the |
| specified array and the size of this collection. |
| |
| <p>If this collection fits in the specified array with room to spare |
| (i.e., the array has more elements than this collection), the element |
| in the array immediately following the end of the collection is set to |
| <tt>null</tt>. (This is useful in determining the length of this |
| collection <i>only</i> if the caller knows that this collection does |
| not contain any <tt>null</tt> elements.) |
| |
| <p>If this collection makes any guarantees as to what order its elements |
| are returned by its iterator, this method must return the elements in |
| the same order. |
| |
| <p>Like the <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"><CODE>Collection.toArray()</CODE></A> method, this method acts as bridge between |
| array-based and collection-based APIs. Further, this method allows |
| precise control over the runtime type of the output array, and may, |
| under certain circumstances, be used to save allocation costs. |
| |
| <p>Suppose <tt>x</tt> is a collection known to contain only strings. |
| The following code can be used to dump the collection into a newly |
| allocated array of <tt>String</tt>: |
| |
| <pre> |
| String[] y = x.toArray(new String[0]);</pre> |
| |
| Note that <tt>toArray(new Object[0])</tt> is identical in function to |
| <tt>toArray()</tt>. |
| |
| <p>This implementation returns an array containing all the elements |
| returned by this collection's iterator in the same order, stored in |
| consecutive elements of the array, starting with index <code>0</code>. |
| If the number of elements returned by the iterator is too large to |
| fit into the specified array, then the elements are returned in a |
| newly allocated array with length equal to the number of elements |
| returned by the iterator, even if the size of this collection |
| changes during iteration, as might happen if the collection permits |
| concurrent modification during iteration. The <code>size</code> method is |
| called only as an optimization hint; the correct result is returned |
| even if the iterator returns a different number of elements. |
| |
| <p>This method is equivalent to: |
| |
| <pre> <code>List<E> list = new ArrayList<E>(size()); |
| for (E e : this) |
| list.add(e); |
| return list.toArray(a); |
| </code></pre> |
| <P> |
| <DD><DL> |
| <DT><B>Specified by:</B><DD><CODE><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> 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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE><DT><B>Overrides:</B><DD><CODE><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> 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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>array</CODE> - the array into which the elements of this collection are to be |
| stored, if it is big enough; otherwise, a new array of the same |
| runtime type is allocated for this purpose. |
| <DT><B>Returns:</B><DD>an array containing all of the elements in this collection</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="add(java.lang.Object,int)"><!-- --></A><A NAME="add(E, int)"><!-- --></A><H3> |
| add</H3> |
| <PRE> |
| public int <B>add</B>(<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A> element, |
| int occurrences)</PRE> |
| <DL> |
| <DD>Adds a number of occurrences of the specified element to this multiset. |
| <P> |
| <DD><DL> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add<DD><CODE>occurrences</CODE> - the number of occurrences to add |
| <DT><B>Returns:</B><DD>the previous count of the element before the operation; possibly |
| zero |
| <DT><B>Throws:</B> |
| <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 <code>occurrences</code> is negative, or if |
| the resulting amount would exceed <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></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="remove(java.lang.Object, int)"><!-- --></A><H3> |
| remove</H3> |
| <PRE> |
| 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> |
| <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, |
| int occurrences)</PRE> |
| <DL> |
| <DD>Removes a number of occurrences of the specified element from this |
| multiset. If the multiset contains fewer than this number of occurrences to |
| begin with, all occurrences will be removed. |
| <P> |
| <DD><DL> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element whose occurrences should be removed<DD><CODE>occurrences</CODE> - the number of occurrences of the element to remove |
| <DT><B>Returns:</B><DD>the count of the element before the operation; possibly zero |
| <DT><B>Throws:</B> |
| <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 <code>occurrences</code> is negative</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeExactly(java.lang.Object, int)"><!-- --></A><H3> |
| removeExactly</H3> |
| <PRE> |
| public boolean <B>removeExactly</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> |
| <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, |
| int occurrences)</PRE> |
| <DL> |
| <DD>Removes exactly the specified number of occurrences of <code>element</code>, or |
| makes no change if this is not possible. |
| |
| <p>This method, in contrast to <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#remove(java.lang.Object, int)"><CODE>remove(Object, int)</CODE></A>, has no effect |
| when the element count is smaller than <code>occurrences</code>. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to remove<DD><CODE>occurrences</CODE> - the number of occurrences of <code>element</code> to remove |
| <DT><B>Returns:</B><DD><code>true</code> if the removal was possible (including if <code>occurrences</code> is zero)</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setCount(java.lang.Object,int)"><!-- --></A><A NAME="setCount(E, int)"><!-- --></A><H3> |
| setCount</H3> |
| <PRE> |
| public int <B>setCount</B>(<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A> element, |
| int count)</PRE> |
| <DL> |
| <DD>Adds or removes occurrences of <code>element</code> such that the <A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html#count(java.lang.Object)"><CODE>count(java.lang.Object)</CODE></A> |
| of the element becomes <code>count</code>. |
| <P> |
| <DD><DL> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add or remove occurrences of; may be null |
| only if explicitly allowed by the implementation<DD><CODE>count</CODE> - the desired count of the element in this multiset |
| <DT><B>Returns:</B><DD>the count of <code>element</code> in the multiset before this call |
| <DT><B>Throws:</B> |
| <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 <code>count</code> is negative</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setCount(java.lang.Object,int,int)"><!-- --></A><A NAME="setCount(E, int, int)"><!-- --></A><H3> |
| setCount</H3> |
| <PRE> |
| public boolean <B>setCount</B>(<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A> element, |
| int oldCount, |
| int newCount)</PRE> |
| <DL> |
| <DD>Sets the number of occurrences of <code>element</code> to <code>newCount</code>, but |
| only if the count is currently <code>oldCount</code>. If <code>element</code> does |
| not appear in the multiset exactly <code>oldCount</code> times, no changes will |
| be made. |
| <P> |
| <DD><DL> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to conditionally set the count of; may be null |
| 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 |
| <DT><B>Returns:</B><DD><code>true</code> if the change was successful. This usually indicates |
| that the multiset has been modified, but not always: in the case that |
| <code>oldCount == newCount</code>, the method will return <code>true</code> if |
| the condition was met. |
| <DT><B>Throws:</B> |
| <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 <code>oldCount</code> or <code>newCount</code> is |
| negative</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="entrySet()"><!-- --></A><H3> |
| entrySet</H3> |
| <PRE> |
| 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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>>> <B>entrySet</B>()</PRE> |
| <DL> |
| <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()">Multiset</A></CODE></B></DD> |
| <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 |
| the count of that element. This set contains exactly one entry for each |
| distinct element in the multiset (thus it always has the same size as the |
| <A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()"><CODE>Multiset.elementSet()</CODE></A>). The order of the elements in the element set is |
| unspecified. |
| |
| <p>The entry set is backed by the same data as the multiset, so any change |
| to either is immediately reflected in the other. However, multiset changes |
| may or may not be reflected in any <code>Entry</code> instances already |
| retrieved from the entry set (this is implementation-dependent). |
| Furthermore, implementations are not required to support modifications to |
| the entry set at all, and the <code>Entry</code> instances themselves don't |
| even have methods for modification. See the specific implementation class |
| for more details on how its entry set handles modifications. |
| <P> |
| <DD><DL> |
| <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><<A HREF="../../../../com/google/common/collect/ConcurrentHashMultiset.html" title="type parameter in ConcurrentHashMultiset">E</A>></CODE></DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a set of entries representing the data of this multiset</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="isEmpty()"><!-- --></A><H3> |
| isEmpty</H3> |
| <PRE> |
| public boolean <B>isEmpty</B>()</PRE> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Returns <tt>true</tt> if this collection contains no elements. |
| |
| <p>This implementation returns <tt>size() == 0</tt>. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection contains no elements</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="contains(java.lang.Object)"><!-- --></A><H3> |
| contains</H3> |
| <PRE> |
| 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> |
| <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> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Returns <tt>true</tt> if this collection contains the specified element. |
| More formally, returns <tt>true</tt> if and only if this collection |
| contains at least one element <tt>e</tt> such that |
| <tt>(o==null ? e==null : o.equals(e))</tt>. |
| |
| <p>This implementation iterates over the elements in the collection, |
| checking each element in turn for equality with the specified element. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - element whose presence in this collection is to be tested |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection contains the specified |
| element</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="iterator()"><!-- --></A><H3> |
| iterator</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD><B>Description copied from class: <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#iterator()" title="class or interface in java.util">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Returns an iterator over the elements contained in this collection. |
| <P> |
| <DD><DL> |
| <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><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#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?is-external=true" title="class or interface in java.util">AbstractCollection</A><E></CODE></DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>an iterator over the elements contained in this collection</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="add(java.lang.Object)"><!-- --></A><A NAME="add(E)"><!-- --></A><H3> |
| add</H3> |
| <PRE> |
| 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> |
| E element)</PRE> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Ensures that this collection contains the specified element (optional |
| operation). Returns <tt>true</tt> if this collection changed as a |
| result of the call. (Returns <tt>false</tt> if this collection does |
| not permit duplicates and already contains the specified element.)<p> |
| |
| Collections that support this operation may place limitations on what |
| elements may be added to this collection. In particular, some |
| collections will refuse to add <tt>null</tt> elements, and others will |
| impose restrictions on the type of elements that may be added. |
| Collection classes should clearly specify in their documentation any |
| restrictions on what elements may be added.<p> |
| |
| If a collection refuses to add a particular element for any reason |
| other than that it already contains the element, it <i>must</i> throw |
| an exception (rather than returning <tt>false</tt>). This preserves |
| the invariant that a collection always contains the specified element |
| after this call returns. |
| |
| <p>This implementation always throws an |
| <tt>UnsupportedOperationException</tt>. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - element whose presence in this collection is to be ensured |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the |
| call</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="remove(java.lang.Object)"><!-- --></A><H3> |
| remove</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Removes a single instance of the specified element from this |
| collection, if it is present (optional operation). More formally, |
| removes an element <tt>e</tt> such that |
| <tt>(o==null ? e==null : o.equals(e))</tt>, if |
| this collection contains one or more such elements. Returns |
| <tt>true</tt> if this collection contained the specified element (or |
| equivalently, if this collection changed as a result of the call). |
| |
| <p>This implementation iterates over the collection looking for the |
| specified element. If it finds the element, it removes the element |
| from the collection using the iterator's remove method. |
| |
| <p>Note that this implementation throws an |
| <tt>UnsupportedOperationException</tt> if the iterator returned by this |
| collection's iterator method does not implement the <tt>remove</tt> |
| method and this collection contains the specified object. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>element</CODE> - element to be removed from this collection, if present |
| <DT><B>Returns:</B><DD><tt>true</tt> if an element was removed as a result of this call</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="containsAll(java.util.Collection)"><!-- --></A><H3> |
| containsAll</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Returns <tt>true</tt> if this collection contains all of the elements |
| in the specified collection. |
| |
| <p>This implementation iterates over the specified collection, |
| checking each element returned by the iterator in turn to see |
| if it's contained in this collection. If all elements are so |
| contained <tt>true</tt> is returned, otherwise <tt>false</tt>. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - collection to be checked for containment in this collection |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection contains all of the elements |
| in the specified collection<DT><B>See Also:</B><DD><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"><CODE>AbstractCollection.contains(Object)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="addAll(java.util.Collection)"><!-- --></A><H3> |
| addAll</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Adds all of the elements in the specified collection to this collection |
| (optional operation). The behavior of this operation is undefined if |
| the specified collection is modified while the operation is in progress. |
| (This implies that the behavior of this call is undefined if the |
| specified collection is this collection, and this collection is |
| nonempty.) |
| |
| <p>This implementation iterates over the specified collection, and adds |
| each object returned by the iterator to this collection, in turn. |
| |
| <p>Note that this implementation will throw an |
| <tt>UnsupportedOperationException</tt> unless <tt>add</tt> is |
| overridden (assuming the specified collection is non-empty). |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elementsToAdd</CODE> - collection containing elements to be added to this collection |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the call<DT><B>See Also:</B><DD><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"><CODE>AbstractCollection.add(Object)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeAll(java.util.Collection)"><!-- --></A><H3> |
| removeAll</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Removes all of this collection's elements that are also contained in the |
| specified collection (optional operation). After this call returns, |
| this collection will contain no elements in common with the specified |
| collection. |
| |
| <p>This implementation iterates over this collection, checking each |
| element returned by the iterator in turn to see if it's contained |
| in the specified collection. If it's so contained, it's removed from |
| this collection with the iterator's <tt>remove</tt> method. |
| |
| <p>Note that this implementation will throw an |
| <tt>UnsupportedOperationException</tt> if the iterator returned by the |
| <tt>iterator</tt> method does not implement the <tt>remove</tt> method |
| and this collection contains one or more elements in common with the |
| specified collection. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elementsToRemove</CODE> - collection containing elements to be removed from this collection |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the |
| call<DT><B>See Also:</B><DD><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"><CODE>AbstractCollection.remove(Object)</CODE></A>, |
| <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"><CODE>AbstractCollection.contains(Object)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="retainAll(java.util.Collection)"><!-- --></A><H3> |
| retainAll</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Retains only the elements in this collection that are contained in the |
| specified collection (optional operation). In other words, removes from |
| this collection all of its elements that are not contained in the |
| specified collection. |
| |
| <p>This implementation iterates over this collection, checking each |
| element returned by the iterator in turn to see if it's contained |
| in the specified collection. If it's not so contained, it's removed |
| from this collection with the iterator's <tt>remove</tt> method. |
| |
| <p>Note that this implementation will throw an |
| <tt>UnsupportedOperationException</tt> if the iterator returned by the |
| <tt>iterator</tt> method does not implement the <tt>remove</tt> method |
| and this collection contains one or more elements not present in the |
| specified collection. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elementsToRetain</CODE> - collection containing elements to be retained in this collection |
| <DT><B>Returns:</B><DD><tt>true</tt> if this collection changed as a result of the call<DT><B>See Also:</B><DD><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"><CODE>AbstractCollection.remove(Object)</CODE></A>, |
| <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"><CODE>AbstractCollection.contains(Object)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="clear()"><!-- --></A><H3> |
| clear</H3> |
| <PRE> |
| public void <B>clear</B>()</PRE> |
| <DL> |
| <DD><B>Description copied from class: <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">java.util.AbstractCollection</A></CODE></B></DD> |
| <DD>Removes all of the elements from this collection (optional operation). |
| The collection will be empty after this method returns. |
| |
| <p>This implementation iterates over this collection, removing each |
| element using the <tt>Iterator.remove</tt> operation. Most |
| implementations will probably choose to override this method for |
| efficiency. |
| |
| <p>Note that this implementation will throw an |
| <tt>UnsupportedOperationException</tt> if the iterator returned by this |
| collection's <tt>iterator</tt> method does not implement the |
| <tt>remove</tt> method and this collection is non-empty. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="elementSet()"><!-- --></A><H3> |
| elementSet</H3> |
| <PRE> |
| 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><E> <B>elementSet</B>()</PRE> |
| <DL> |
| <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/google/common/collect/Multiset.html#elementSet()">Multiset</A></CODE></B></DD> |
| <DD>Returns the set of distinct elements contained in this multiset. The |
| element set is backed by the same data as the multiset, so any change to |
| either is immediately reflected in the other. The order of the elements in |
| the element set is unspecified. |
| |
| <p>If the element set supports any removal operations, these necessarily |
| cause <b>all</b> occurrences of the removed element(s) to be removed from |
| the multiset. Implementations are not expected to support the add |
| operations, although this is possible. |
| |
| <p>A common use for the element set is to find the number of distinct |
| elements in the multiset: <code>elementSet().size()</code>. |
| <P> |
| <DD><DL> |
| <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><E></CODE></DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a view of the set of distinct elements in this multiset</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="equals(java.lang.Object)"><!-- --></A><H3> |
| equals</H3> |
| <PRE> |
| 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> |
| <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> |
| <DL> |
| <DD>Indicates whether some other object is "equal to" this one. |
| <p> |
| The <code>equals</code> method implements an equivalence relation |
| on non-null object references: |
| <ul> |
| <li>It is <i>reflexive</i>: for any non-null reference value |
| <code>x</code>, <code>x.equals(x)</code> should return |
| <code>true</code>. |
| <li>It is <i>symmetric</i>: for any non-null reference values |
| <code>x</code> and <code>y</code>, <code>x.equals(y)</code> |
| should return <code>true</code> if and only if |
| <code>y.equals(x)</code> returns <code>true</code>. |
| <li>It is <i>transitive</i>: for any non-null reference values |
| <code>x</code>, <code>y</code>, and <code>z</code>, if |
| <code>x.equals(y)</code> returns <code>true</code> and |
| <code>y.equals(z)</code> returns <code>true</code>, then |
| <code>x.equals(z)</code> should return <code>true</code>. |
| <li>It is <i>consistent</i>: for any non-null reference values |
| <code>x</code> and <code>y</code>, multiple invocations of |
| <tt>x.equals(y)</tt> consistently return <code>true</code> |
| or consistently return <code>false</code>, provided no |
| information used in <code>equals</code> comparisons on the |
| objects is modified. |
| <li>For any non-null reference value <code>x</code>, |
| <code>x.equals(null)</code> should return <code>false</code>. |
| </ul> |
| <p> |
| The <tt>equals</tt> method for class <code>Object</code> implements |
| the most discriminating possible equivalence relation on objects; |
| that is, for any non-null reference values <code>x</code> and |
| <code>y</code>, this method returns <code>true</code> if and only |
| if <code>x</code> and <code>y</code> refer to the same object |
| (<code>x == y</code> has the value <code>true</code>). |
| <p> |
| Note that it is generally necessary to override the <tt>hashCode</tt> |
| method whenever this method is overridden, so as to maintain the |
| general contract for the <tt>hashCode</tt> method, which states |
| that equal objects must have equal hash codes. |
| |
| <p>This implementation returns <code>true</code> if <code>other</code> is a multiset |
| of the same size and if, for each element, the two multisets have the same |
| count. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>object</CODE> - the reference object with which to compare. |
| <DT><B>Returns:</B><DD><code>true</code> if this object is the same as the obj |
| 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?is-external=true#hashCode()" title="class or interface in java.lang"><CODE>Object.hashCode()</CODE></A>, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html?is-external=true" title="class or interface in java.util"><CODE>Hashtable</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="hashCode()"><!-- --></A><H3> |
| hashCode</H3> |
| <PRE> |
| public int <B>hashCode</B>()</PRE> |
| <DL> |
| <DD>Returns a hash code value for the object. This method is |
| supported for the benefit of hashtables such as those provided by |
| <code>java.util.Hashtable</code>. |
| <p> |
| The general contract of <code>hashCode</code> is: |
| <ul> |
| <li>Whenever it is invoked on the same object more than once during |
| an execution of a Java application, the <tt>hashCode</tt> method |
| must consistently return the same integer, provided no information |
| used in <tt>equals</tt> comparisons on the object is modified. |
| This integer need not remain consistent from one execution of an |
| application to another execution of the same application. |
| <li>If two objects are equal according to the <tt>equals(Object)</tt> |
| method, then calling the <code>hashCode</code> method on each of |
| the two objects must produce the same integer result. |
| <li>It is <em>not</em> required that if two objects are unequal |
| according to the <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> |
| method, then calling the <tt>hashCode</tt> method on each of the |
| two objects must produce distinct integer results. However, the |
| programmer should be aware that producing distinct integer results |
| for unequal objects may improve the performance of hashtables. |
| </ul> |
| <p> |
| As much as is reasonably practical, the hashCode method defined by |
| class <tt>Object</tt> does return distinct integers for distinct |
| objects. (This is typically implemented by converting the internal |
| address of the object into an integer, but this implementation |
| technique is not required by the |
| Java<font size="-2"><sup>TM</sup></font> programming language.) |
| |
| <p>This implementation returns the hash code of <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| |
| <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?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html?is-external=true" title="class or interface in java.util"><CODE>Hashtable</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="toString()"><!-- --></A><H3> |
| toString</H3> |
| <PRE> |
| 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> |
| <DL> |
| <DD>Returns a string representation of this collection. The string |
| representation consists of a list of the collection's elements in the |
| order they are returned by its iterator, enclosed in square brackets |
| (<tt>"[]"</tt>). Adjacent elements are separated by the characters |
| <tt>", "</tt> (comma and space). Elements are converted to strings as |
| by <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true#valueOf(java.lang.Object)" title="class or interface in java.lang"><CODE>String.valueOf(Object)</CODE></A>. |
| |
| <p>This implementation returns the result of invoking <code>toString</code> on |
| <A HREF="../../../../com/google/common/collect/Multiset.html#entrySet()"><CODE>Multiset.entrySet()</CODE></A>. |
| <P> |
| <DD><DL> |
| <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> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a string representation of this collection</DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ConcurrentHashMultiset.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../com/google/common/collect/ComputationException.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A> |
| <A HREF="../../../../com/google/common/collect/EnumBiMap.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?com/google/common/collect/ConcurrentHashMultiset.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="ConcurrentHashMultiset.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| |
| </BODY> |
| </HTML> |