| <!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:17 PST 2009 --> |
| <TITLE> |
| Sets (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="Sets (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/Sets.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/SetMultimap.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A> |
| <A HREF="../../../../com/google/common/collect/Sets.SetView.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/Sets.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="Sets.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: <A HREF="#nested_class_summary">NESTED</A> | 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 Sets</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 "><B>com.google.common.collect.Sets</B> |
| </PRE> |
| <HR> |
| <DL> |
| <DT><PRE>public final class <B>Sets</B><DT>extends <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></DL> |
| </PRE> |
| |
| <P> |
| Static utility methods pertaining to <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> instances. Also see this |
| class's counterparts <A HREF="../../../../com/google/common/collect/Lists.html" title="class in com.google.common.collect"><CODE>Lists</CODE></A> and <A HREF="../../../../com/google/common/collect/Maps.html" title="class in com.google.common.collect"><CODE>Maps</CODE></A>. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Author:</B></DT> |
| <DD>Kevin Bourrillion, Jared Levy</DD> |
| </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> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static class</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><<A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="type parameter in Sets.SetView">E</A>></B></CODE> |
| |
| <BR> |
| An unmodifiable view of a set which may be backed by other sets; this view |
| will change as the backing sets do.</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>static |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> |
| <BR> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util">EnumSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#complementOf(java.util.Collection)">complementOf</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><E> collection)</CODE> |
| |
| <BR> |
| Creates an <code>EnumSet</code> consisting of all enum values that are not in |
| the specified collection.</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 extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> |
| <BR> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util">EnumSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#complementOf(java.util.Collection, java.lang.Class)">complementOf</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><E> collection, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><E> type)</CODE> |
| |
| <BR> |
| Creates an <code>EnumSet</code> consisting of all enum values that are not in |
| the specified collection.</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/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#difference(java.util.Set, java.util.Set)">difference</A></B>(<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> set1, |
| <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><?> set2)</CODE> |
| |
| <BR> |
| Returns an unmodifiable <b>view</b> of the difference of two sets.</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="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> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#filter(java.util.Set, com.google.common.base.Predicate)">filter</A></B>(<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> unfiltered, |
| <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A><? super E> predicate)</CODE> |
| |
| <BR> |
| Returns the elements of <code>unfiltered</code> that satisfy a predicate.</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 extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> |
| <BR> |
| <A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#immutableEnumSet(E, E...)">immutableEnumSet</A></B>(E anElement, |
| E... otherElements)</CODE> |
| |
| <BR> |
| Returns an immutable set instance containing the given enum elements.</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 extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> |
| <BR> |
| <A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#immutableEnumSet(java.lang.Iterable)">immutableEnumSet</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><E> elements)</CODE> |
| |
| <BR> |
| Returns an immutable set instance containing the given enum elements.</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/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#intersection(java.util.Set, java.util.Set)">intersection</A></B>(<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> set1, |
| <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><?> set2)</CODE> |
| |
| <BR> |
| Returns an unmodifiable <b>view</b> of the intersection of two sets.</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 extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> |
| <BR> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util">EnumSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newEnumSet(java.lang.Iterable, java.lang.Class)">newEnumSet</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><E> iterable, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><E> elementType)</CODE> |
| |
| <BR> |
| Returns a new <code>EnumSet</code> instance containing the given elements.</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="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newHashSet()">newHashSet</A></B>()</CODE> |
| |
| <BR> |
| Creates a <i>mutable</i>, empty <code>HashSet</code> instance.</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="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newHashSet(E...)">newHashSet</A></B>(E... elements)</CODE> |
| |
| <BR> |
| Creates a <i>mutable</i> <code>HashSet</code> instance containing the given |
| elements in unspecified order.</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="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newHashSet(java.lang.Iterable)">newHashSet</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 <i>mutable</i> <code>HashSet</code> instance containing the given |
| elements in unspecified order.</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="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newHashSet(java.util.Iterator)">newHashSet</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><? extends E> elements)</CODE> |
| |
| <BR> |
| Creates a <i>mutable</i> <code>HashSet</code> instance containing the given |
| elements in unspecified order.</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="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newHashSetWithExpectedSize(int)">newHashSetWithExpectedSize</A></B>(int expectedSize)</CODE> |
| |
| <BR> |
| Creates an empty <code>HashSet</code> instance with enough capacity to hold the |
| specified number of elements without rehashing.</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="http://java.sun.com/javase/6/docs/api/java/util/LinkedHashSet.html?is-external=true" title="class or interface in java.util">LinkedHashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newLinkedHashSet()">newLinkedHashSet</A></B>()</CODE> |
| |
| <BR> |
| Creates a <i>mutable</i>, empty <code>LinkedHashSet</code> instance.</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="http://java.sun.com/javase/6/docs/api/java/util/LinkedHashSet.html?is-external=true" title="class or interface in java.util">LinkedHashSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newLinkedHashSet(java.lang.Iterable)">newLinkedHashSet</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 <i>mutable</i> <code>LinkedHashSet</code> instance containing the |
| given elements in order.</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="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> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newSetFromMap(java.util.Map)">newSetFromMap</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><E,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A>> map)</CODE> |
| |
| <BR> |
| Returns a set backed by the specified map.</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 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>> |
| <BR> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util">TreeSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newTreeSet()">newTreeSet</A></B>()</CODE> |
| |
| <BR> |
| Creates a <i>mutable</i>, empty <code>TreeSet</code> instance sorted by the |
| natural sort ordering of its elements.</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="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util">TreeSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newTreeSet(java.util.Comparator)">newTreeSet</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> |
| |
| <BR> |
| Creates a <i>mutable</i>, empty <code>TreeSet</code> instance with the given |
| comparator.</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 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>> |
| <BR> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util">TreeSet</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#newTreeSet(java.lang.Iterable)">newTreeSet</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 <i>mutable</i> <code>TreeSet</code> instance containing the given |
| elements sorted by their natural ordering.</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/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><E></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#union(java.util.Set, java.util.Set)">union</A></B>(<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><? extends E> set1, |
| <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><? extends E> set2)</CODE> |
| |
| <BR> |
| Returns an unmodifiable <b>view</b> of the union of two sets.</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#equals(java.lang.Object)" title="class or interface in java.lang">equals</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#hashCode()" title="class or interface in java.lang">hashCode</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#toString()" title="class or interface in java.lang">toString</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="immutableEnumSet(java.lang.Enum,java.lang.Enum[])"><!-- --></A><A NAME="immutableEnumSet(E, E...)"><!-- --></A><H3> |
| immutableEnumSet</H3> |
| <PRE> |
| public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> <A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A><E> <B>immutableEnumSet</B>(E anElement, |
| E... otherElements)</PRE> |
| <DL> |
| <DD>Returns an immutable set instance containing the given enum elements. |
| Internally, the returned set will be backed by an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util"><CODE>EnumSet</CODE></A>. |
| |
| <p>The iteration order of the returned set follows the enum's iteration |
| order, not the order in which the elements are provided to the method. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>anElement</CODE> - one of the elements the set should contain<DD><CODE>otherElements</CODE> - the rest of the elements the set should contain |
| <DT><B>Returns:</B><DD>an immutable set containing those elements, minus duplicates</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="immutableEnumSet(java.lang.Iterable)"><!-- --></A><H3> |
| immutableEnumSet</H3> |
| <PRE> |
| public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> <A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A><E> <B>immutableEnumSet</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><E> elements)</PRE> |
| <DL> |
| <DD>Returns an immutable set instance containing the given enum elements. |
| Internally, the returned set will be backed by an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util"><CODE>EnumSet</CODE></A>. |
| |
| <p>The iteration order of the returned set follows the enum's iteration |
| order, not the order in which the elements appear in the given collection. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements, all of the same <code>enum</code> type, that the |
| set should contain |
| <DT><B>Returns:</B><DD>an immutable set containing those elements, minus duplicates</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newEnumSet(java.lang.Iterable, java.lang.Class)"><!-- --></A><H3> |
| newEnumSet</H3> |
| <PRE> |
| public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util">EnumSet</A><E> <B>newEnumSet</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><E> iterable, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><E> elementType)</PRE> |
| <DL> |
| <DD>Returns a new <code>EnumSet</code> instance containing the given elements. |
| Unlike <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true#copyOf(java.util.Collection)" title="class or interface in java.util"><CODE>EnumSet.copyOf(Collection)</CODE></A>, this method does not produce an |
| exception on an empty collection, and it may be called on any iterable, not |
| just a <code>Collection</code>. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newHashSet()"><!-- --></A><H3> |
| newHashSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E> <B>newHashSet</B>()</PRE> |
| <DL> |
| <DD>Creates a <i>mutable</i>, empty <code>HashSet</code> instance. |
| |
| <p><b>Note:</b> if mutability is not required, use <A HREF="../../../../com/google/common/collect/ImmutableSet.html#of()"><CODE>ImmutableSet.of()</CODE></A> instead. |
| |
| <p><b>Note:</b> if <code>E</code> is an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><CODE>Enum</CODE></A> type, use <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true#noneOf(java.lang.Class)" title="class or interface in java.util"><CODE>EnumSet.noneOf(java.lang.Class<E>)</CODE></A> instead. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a new, empty <code>HashSet</code></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newHashSet(java.lang.Object[])"><!-- --></A><A NAME="newHashSet(E...)"><!-- --></A><H3> |
| newHashSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E> <B>newHashSet</B>(E... elements)</PRE> |
| <DL> |
| <DD>Creates a <i>mutable</i> <code>HashSet</code> instance containing the given |
| elements in unspecified order. |
| |
| <p><b>Note:</b> if mutability is not required and the elements are |
| non-null, use <A HREF="../../../../com/google/common/collect/ImmutableSet.html#of(E...)"><CODE>ImmutableSet.of(Object[])</CODE></A> instead. |
| |
| <p><b>Note:</b> if <code>E</code> is an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><CODE>Enum</CODE></A> type, use <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true#of(E, E...)" title="class or interface in java.util"><CODE>EnumSet.of(Enum, Enum[])</CODE></A> instead. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements that the set should contain |
| <DT><B>Returns:</B><DD>a new <code>HashSet</code> containing those elements (minus duplicates)</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newHashSetWithExpectedSize(int)"><!-- --></A><H3> |
| newHashSetWithExpectedSize</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E> <B>newHashSetWithExpectedSize</B>(int expectedSize)</PRE> |
| <DL> |
| <DD>Creates an empty <code>HashSet</code> instance with enough capacity to hold the |
| specified number of elements without rehashing. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>expectedSize</CODE> - the expected size |
| <DT><B>Returns:</B><DD>a new, empty <code>HashSet</code> with enough capacity to hold <code>expectedSize</code> elements without rehashing |
| <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>expectedSize</code> is negative</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newHashSet(java.lang.Iterable)"><!-- --></A><H3> |
| newHashSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E> <B>newHashSet</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 <i>mutable</i> <code>HashSet</code> instance containing the given |
| elements in unspecified order. |
| |
| <p><b>Note:</b> if mutability is not required and the elements are |
| non-null, use <A HREF="../../../../com/google/common/collect/ImmutableSet.html#copyOf(java.lang.Iterable)"><CODE>ImmutableSet.copyOf(Iterable)</CODE></A> instead. |
| |
| <p><b>Note:</b> if <code>E</code> is an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><CODE>Enum</CODE></A> type, use |
| <A HREF="../../../../com/google/common/collect/Sets.html#newEnumSet(java.lang.Iterable, java.lang.Class)"><CODE>newEnumSet(Iterable, Class)</CODE></A> instead. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements that the set should contain |
| <DT><B>Returns:</B><DD>a new <code>HashSet</code> containing those elements (minus duplicates)</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newHashSet(java.util.Iterator)"><!-- --></A><H3> |
| newHashSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util">HashSet</A><E> <B>newHashSet</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><? extends E> elements)</PRE> |
| <DL> |
| <DD>Creates a <i>mutable</i> <code>HashSet</code> instance containing the given |
| elements in unspecified order. |
| |
| <p><b>Note:</b> if mutability is not required and the elements are |
| non-null, use <A HREF="../../../../com/google/common/collect/ImmutableSet.html#copyOf(java.lang.Iterable)"><CODE>ImmutableSet.copyOf(Iterable)</CODE></A> instead. |
| |
| <p><b>Note:</b> if <code>E</code> is an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><CODE>Enum</CODE></A> type, you should create an |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util"><CODE>EnumSet</CODE></A> instead. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements that the set should contain |
| <DT><B>Returns:</B><DD>a new <code>HashSet</code> containing those elements (minus duplicates)</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newLinkedHashSet()"><!-- --></A><H3> |
| newLinkedHashSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/LinkedHashSet.html?is-external=true" title="class or interface in java.util">LinkedHashSet</A><E> <B>newLinkedHashSet</B>()</PRE> |
| <DL> |
| <DD>Creates a <i>mutable</i>, empty <code>LinkedHashSet</code> instance. |
| |
| <p><b>Note:</b> if mutability is not required, use <A HREF="../../../../com/google/common/collect/ImmutableSet.html#of()"><CODE>ImmutableSet.of()</CODE></A> instead. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a new, empty <code>LinkedHashSet</code></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newLinkedHashSet(java.lang.Iterable)"><!-- --></A><H3> |
| newLinkedHashSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/LinkedHashSet.html?is-external=true" title="class or interface in java.util">LinkedHashSet</A><E> <B>newLinkedHashSet</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 <i>mutable</i> <code>LinkedHashSet</code> instance containing the |
| given elements in order. |
| |
| <p><b>Note:</b> if mutability is not required and the elements are |
| non-null, use <A HREF="../../../../com/google/common/collect/ImmutableSet.html#copyOf(java.lang.Iterable)"><CODE>ImmutableSet.copyOf(Iterable)</CODE></A> instead. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements that the set should contain, in order |
| <DT><B>Returns:</B><DD>a new <code>LinkedHashSet</code> containing those elements (minus |
| duplicates)</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newTreeSet()"><!-- --></A><H3> |
| newTreeSet</H3> |
| <PRE> |
| 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="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util">TreeSet</A><E> <B>newTreeSet</B>()</PRE> |
| <DL> |
| <DD>Creates a <i>mutable</i>, empty <code>TreeSet</code> instance sorted by the |
| natural sort ordering of its elements. |
| |
| <p><b>Note:</b> if mutability is not required, use <A HREF="../../../../com/google/common/collect/ImmutableSortedSet.html#of()"><CODE>ImmutableSortedSet.of()</CODE></A> instead. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a new, empty <code>TreeSet</code></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newTreeSet(java.lang.Iterable)"><!-- --></A><H3> |
| newTreeSet</H3> |
| <PRE> |
| 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="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util">TreeSet</A><E> <B>newTreeSet</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 <i>mutable</i> <code>TreeSet</code> instance containing the given |
| elements sorted by their natural ordering. |
| |
| <p><b>Note:</b> if mutability is not required, use <A HREF="../../../../com/google/common/collect/ImmutableSortedSet.html#copyOf(java.lang.Iterable)"><CODE>ImmutableSortedSet.copyOf(Iterable)</CODE></A> instead. |
| |
| <p><b>Note:</b> If <code>elements</code> is a <code>SortedSet</code> with an explicit |
| comparator, this method has different behavior than |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true#TreeSet(java.util.SortedSet)" title="class or interface in java.util"><CODE>TreeSet.TreeSet(SortedSet)</CODE></A>, which returns a <code>TreeSet</code> with |
| that comparator. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>elements</CODE> - the elements that the set should contain |
| <DT><B>Returns:</B><DD>a new <code>TreeSet</code> containing those elements (minus duplicates)</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newTreeSet(java.util.Comparator)"><!-- --></A><H3> |
| newTreeSet</H3> |
| <PRE> |
| public static <E> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util">TreeSet</A><E> <B>newTreeSet</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> |
| <DL> |
| <DD>Creates a <i>mutable</i>, empty <code>TreeSet</code> instance with the given |
| comparator. |
| |
| <p><b>Note:</b> if mutability is not required, use <code>ImmutableSortedSet.orderedBy(comparator).build()</code> instead. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>comparator</CODE> - the comparator to use to sort the set |
| <DT><B>Returns:</B><DD>a new, empty <code>TreeSet</code> |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>comparator</code> is null</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="complementOf(java.util.Collection)"><!-- --></A><H3> |
| complementOf</H3> |
| <PRE> |
| public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util">EnumSet</A><E> <B>complementOf</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><E> collection)</PRE> |
| <DL> |
| <DD>Creates an <code>EnumSet</code> consisting of all enum values that are not in |
| the specified collection. If the collection is an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util"><CODE>EnumSet</CODE></A>, this |
| method has the same behavior as <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true#complementOf(java.util.EnumSet)" title="class or interface in java.util"><CODE>EnumSet.complementOf(java.util.EnumSet<E>)</CODE></A>. Otherwise, |
| the specified collection must contain at least one element, in order to |
| determine the element type. If the collection could be empty, use |
| <A HREF="../../../../com/google/common/collect/Sets.html#complementOf(java.util.Collection, java.lang.Class)"><CODE>complementOf(Collection, Class)</CODE></A> instead of this method. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>collection</CODE> - the collection whose complement should be stored in the |
| enum set |
| <DT><B>Returns:</B><DD>a new, modifiable <code>EnumSet</code> containing all values of the enum |
| that aren't present in the given collection |
| <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>collection</code> is not an |
| <code>EnumSet</code> instance and contains no elements</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="complementOf(java.util.Collection, java.lang.Class)"><!-- --></A><H3> |
| complementOf</H3> |
| <PRE> |
| public static <E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</A><E>> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true" title="class or interface in java.util">EnumSet</A><E> <B>complementOf</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><E> collection, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><E> type)</PRE> |
| <DL> |
| <DD>Creates an <code>EnumSet</code> consisting of all enum values that are not in |
| the specified collection. This is equivalent to |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/EnumSet.html?is-external=true#complementOf(java.util.EnumSet)" title="class or interface in java.util"><CODE>EnumSet.complementOf(java.util.EnumSet<E>)</CODE></A>, but can act on any input collection, as long |
| as the elements are of enum type. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>collection</CODE> - the collection whose complement should be stored in the |
| <code>EnumSet</code><DD><CODE>type</CODE> - the type of the elements in the set |
| <DT><B>Returns:</B><DD>a new, modifiable <code>EnumSet</code> initially containing all the |
| values of the enum not present in the given collection</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newSetFromMap(java.util.Map)"><!-- --></A><H3> |
| newSetFromMap</H3> |
| <PRE> |
| public static <E> <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>newSetFromMap</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><E,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A>> map)</PRE> |
| <DL> |
| <DD>Returns a set backed by the specified map. The resulting set displays |
| the same ordering, concurrency, and performance characteristics as the |
| backing map. In essence, this factory method provides a <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> |
| implementation corresponding to any <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><CODE>Map</CODE></A> implementation. There is no |
| need to use this method on a <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><CODE>Map</CODE></A> implementation that already has a |
| corresponding <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> implementation (such as <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashMap.html?is-external=true" title="class or interface in java.util"><CODE>HashMap</CODE></A> or |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html?is-external=true" title="class or interface in java.util"><CODE>TreeMap</CODE></A>). |
| |
| <p>Each method invocation on the set returned by this method results in |
| exactly one method invocation on the backing map or its <tt>keySet</tt> |
| view, with one exception. The <tt>addAll</tt> method is implemented as a |
| sequence of <tt>put</tt> invocations on the backing map. |
| |
| <p>The specified map must be empty at the time this method is invoked, |
| and should not be accessed directly after this method returns. These |
| conditions are ensured if the map is created empty, passed directly |
| to this method, and no reference to the map is retained, as illustrated |
| in the following code fragment: <pre> <code>Set<Object> identityHashSet = Sets.newSetFromMap( |
| new IdentityHashMap<Object, Boolean>());</code></pre> |
| |
| This method has the same behavior as the JDK 6 method |
| <code>Collections.newSetFromMap()</code>. The returned set is serializable if |
| the backing map is. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>map</CODE> - the backing map |
| <DT><B>Returns:</B><DD>the set backed by the map |
| <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 <tt>map</tt> is not empty</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="union(java.util.Set, java.util.Set)"><!-- --></A><H3> |
| union</H3> |
| <PRE> |
| public static <E> <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><E> <B>union</B>(<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><? extends E> set1, |
| <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><? extends E> set2)</PRE> |
| <DL> |
| <DD>Returns an unmodifiable <b>view</b> of the union of two sets. The returned |
| set contains all elements that are contained in either backing set. |
| Iterating over the returned set iterates first over all the elements of |
| <code>set1</code>, then over each element of <code>set2</code>, in order, that is not |
| contained in <code>set1</code>. |
| |
| <p>Results are undefined if <code>set1</code> and <code>set2</code> are sets based on |
| different equivalence relations (as <A HREF="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util"><CODE>HashSet</CODE></A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util"><CODE>TreeSet</CODE></A>, and |
| the <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util"><CODE>Map.keySet()</CODE></A> of an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/IdentityHashMap.html?is-external=true" title="class or interface in java.util"><CODE>IdentityHashMap</CODE></A> all are). |
| |
| <p><b>Note:</b> The returned view performs better when <code>set1</code> is the |
| smaller of the two sets. If you have reason to believe one of your sets |
| will generally be smaller than the other, pass it first. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="intersection(java.util.Set, java.util.Set)"><!-- --></A><H3> |
| intersection</H3> |
| <PRE> |
| public static <E> <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><E> <B>intersection</B>(<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> set1, |
| <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><?> set2)</PRE> |
| <DL> |
| <DD>Returns an unmodifiable <b>view</b> of the intersection of two sets. The |
| returned set contains all elements that are contained by both backing sets. |
| The iteration order of the returned set matches that of <code>set1</code>. |
| |
| <p>Results are undefined if <code>set1</code> and <code>set2</code> are sets based |
| on different equivalence relations (as <code>HashSet</code>, <code>TreeSet</code>, |
| and the keySet of an <code>IdentityHashMap</code> all are). |
| |
| <p><b>Note:</b> The returned view performs slightly better when <code>set1</code> is the smaller of the two sets. If you have reason to believe one of |
| your sets will generally be smaller than the other, pass it first. |
| Unfortunately, since this method sets the generic type of the returned set |
| based on the type of the first set passed, this could in rare cases force |
| you to make a cast, for example: <pre> <code>Set<Object> aFewBadObjects = ... |
| Set<String> manyBadStrings = ... |
| |
| // impossible for a non-String to be in the intersection |
| SuppressWarnings("unchecked") |
| Set<String> badStrings = (Set) Sets.intersection( |
| aFewBadObjects, manyBadStrings);</code></pre> |
| |
| This is unfortunate, but should come up only very rarely. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="difference(java.util.Set, java.util.Set)"><!-- --></A><H3> |
| difference</H3> |
| <PRE> |
| public static <E> <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A><E> <B>difference</B>(<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> set1, |
| <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><?> set2)</PRE> |
| <DL> |
| <DD>Returns an unmodifiable <b>view</b> of the difference of two sets. The |
| returned set contains all elements that are contained by <code>set1</code> and |
| not contained by <code>set2</code>. <code>set2</code> may also contain elements not |
| present in <code>set1</code>; these are simply ignored. The iteration order of |
| the returned set matches that of <code>set1</code>. |
| |
| <p>Results are undefined if <code>set1</code> and <code>set2</code> are sets based |
| on different equivalence relations (as <code>HashSet</code>, <code>TreeSet</code>, |
| and the keySet of an <code>IdentityHashMap</code> all are). |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="filter(java.util.Set, com.google.common.base.Predicate)"><!-- --></A><H3> |
| filter</H3> |
| <PRE> |
| public static <E> <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>filter</B>(<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> unfiltered, |
| <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A><? super E> predicate)</PRE> |
| <DL> |
| <DD>Returns the elements of <code>unfiltered</code> that satisfy a predicate. The |
| returned set is a live view of <code>unfiltered</code>; changes to one affect |
| the other. |
| |
| <p>The resulting set's iterator does not support <code>remove()</code>, but all |
| other set methods are supported. The set's <code>add()</code> and |
| <code>addAll()</code> methods throw an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><CODE>IllegalArgumentException</CODE></A> if an |
| element that doesn't satisfy the predicate is provided. When methods such |
| as <code>removeAll()</code> and <code>clear()</code> are called on the filtered set, |
| only elements that satisfy the filter will be removed from the underlying |
| collection. |
| |
| <p>The returned set isn't threadsafe or serializable, even if |
| <code>unfiltered</code> is. |
| |
| <p>Many of the filtered set's methods, such as <code>size()</code>, iterate |
| across every element in the underlying set and determine which elements |
| satisfy the filter. When a live view is <i>not</i> needed, it may be faster |
| to copy <code>Iterables.filter(unfiltered, predicate)</code> and use the copy. |
| <P> |
| <DD><DL> |
| </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/Sets.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/SetMultimap.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A> |
| <A HREF="../../../../com/google/common/collect/Sets.SetView.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/Sets.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="Sets.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: <A HREF="#nested_class_summary">NESTED</A> | 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> |