Html程序  |  1128行  |  66.79 KB

<!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 Mon Jan 04 20:47:59 PST 2010 -->
<TITLE>
Sets (Guava Libraries 2010.01.04)
</TITLE>

<META NAME="date" CONTENT="2010-01-04">

<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 (Guava Libraries 2010.01.04)";
    }
}
</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Sets.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/SetMultimap.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<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>  &nbsp;
&nbsp;<A HREF="Sets.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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>Since:</B></DT>
  <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD>
<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&nbsp;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>&lt;<A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="type parameter in Sets.SetView">E</A>&gt;</B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
&nbsp;
<!-- ========== 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>&lt;B&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;B&gt;&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#cartesianProduct(java.util.List)">cartesianProduct</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;? extends B&gt;&gt;&nbsp;sets)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns every possible list that can be formed by choosing one element
 from each of the given sets in order; the "n-ary
 <a href="http://en.wikipedia.org/wiki/Cartesian_product">Cartesian
 product</a>" of the 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>&lt;B&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;B&gt;&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/Sets.html#cartesianProduct(java.util.Set...)">cartesianProduct</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>&lt;? extends B&gt;...&nbsp;sets)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns every possible list that can be formed by choosing one element
 from each of the given sets in order; the "n-ary
 <a href="http://en.wikipedia.org/wiki/Cartesian_product">Cartesian
 product</a>" of the 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>&lt;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>&lt;E&gt;&gt; 
<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>&lt;E&gt;</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>&lt;E&gt;&nbsp;collection)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;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>&lt;E&gt;&gt; 
<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>&lt;E&gt;</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>&lt;E&gt;&nbsp;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>&lt;E&gt;&nbsp;type)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A>&lt;E&gt;</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>&lt;E&gt;&nbsp;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>&lt;?&gt;&nbsp;set2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;E&gt;</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>&lt;E&gt;&nbsp;unfiltered,
       <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super E&gt;&nbsp;predicate)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;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>&lt;E&gt;&gt; 
<BR>
<A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A>&lt;E&gt;</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&nbsp;anElement,
                 E...&nbsp;otherElements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;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>&lt;E&gt;&gt; 
<BR>
<A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A>&lt;E&gt;</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>&lt;E&gt;&nbsp;elements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A>&lt;E&gt;</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>&lt;E&gt;&nbsp;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>&lt;?&gt;&nbsp;set2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;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>&lt;E&gt;&gt; 
<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>&lt;E&gt;</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>&lt;E&gt;&nbsp;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>&lt;E&gt;&nbsp;elementType)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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...&nbsp;elements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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>&lt;? extends E&gt;&nbsp;elements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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>&lt;? extends E&gt;&nbsp;elements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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&nbsp;expectedSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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>&lt;? extends E&gt;&nbsp;elements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;E&gt;</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>&lt;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>&gt;&nbsp;map)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;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>&gt; 
<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>&lt;E&gt;</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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <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>&lt;E&gt;</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>&lt;? super E&gt;&nbsp;comparator)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;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>&gt; 
<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>&lt;E&gt;</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>&lt;? extends E&gt;&nbsp;elements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&lt;E&gt; <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A>&lt;E&gt;</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>&lt;? extends E&gt;&nbsp;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>&lt;? extends E&gt;&nbsp;set2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an unmodifiable <b>view</b> of the union of two sets.</TD>
</TR>
</TABLE>
&nbsp;<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>
&nbsp;
<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 &lt;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>&lt;E&gt;&gt; <A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A>&lt;E&gt; <B>immutableEnumSet</B>(E&nbsp;anElement,
                                                                   E...&nbsp;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 &lt;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>&lt;E&gt;&gt; <A HREF="../../../../com/google/common/collect/ImmutableSet.html" title="class in com.google.common.collect">ImmutableSet</A>&lt;E&gt; <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>&lt;E&gt;&nbsp;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 &lt;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>&lt;E&gt;&gt; <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>&lt;E&gt; <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>&lt;E&gt;&nbsp;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>&lt;E&gt;&nbsp;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 &lt;E&gt; <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>&lt;E&gt; <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 &lt;E&gt; <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>&lt;E&gt; <B>newHashSet</B>(E...&nbsp;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 &lt;E&gt; <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>&lt;E&gt; <B>newHashSetWithExpectedSize</B>(int&nbsp;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 &lt;E&gt; <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>&lt;E&gt; <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>&lt;? extends E&gt;&nbsp;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 &lt;E&gt; <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>&lt;E&gt; <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>&lt;? extends E&gt;&nbsp;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 &lt;E&gt; <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>&lt;E&gt; <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 &lt;E&gt; <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>&lt;E&gt; <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>&lt;? extends E&gt;&nbsp;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 &lt;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>&gt; <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>&lt;E&gt; <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 &lt;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>&gt; <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>&lt;E&gt; <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>&lt;? extends E&gt;&nbsp;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 &lt;E&gt; <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>&lt;E&gt; <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>&lt;? super E&gt;&nbsp;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 &lt;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>&lt;E&gt;&gt; <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>&lt;E&gt; <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>&lt;E&gt;&nbsp;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 &lt;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>&lt;E&gt;&gt; <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>&lt;E&gt; <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>&lt;E&gt;&nbsp;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>&lt;E&gt;&nbsp;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 &lt;E&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;E&gt; <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>&lt;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>&gt;&nbsp;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&lt;Object&gt; identityHashSet = Sets.newSetFromMap(
      new IdentityHashMap&lt;Object, Boolean&gt;());</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 &lt;E&gt; <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A>&lt;E&gt; <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>&lt;? extends E&gt;&nbsp;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>&lt;? extends E&gt;&nbsp;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 &lt;E&gt; <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A>&lt;E&gt; <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>&lt;E&gt;&nbsp;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>&lt;?&gt;&nbsp;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&lt;Object&gt; aFewBadObjects = ...
  Set&lt;String&gt; manyBadStrings = ...

  // impossible for a non-String to be in the intersection
  SuppressWarnings("unchecked")
  Set&lt;String&gt; 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 &lt;E&gt; <A HREF="../../../../com/google/common/collect/Sets.SetView.html" title="class in com.google.common.collect">Sets.SetView</A>&lt;E&gt; <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>&lt;E&gt;&nbsp;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>&lt;?&gt;&nbsp;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 &lt;E&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;E&gt; <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>&lt;E&gt;&nbsp;unfiltered,
                                <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super E&gt;&nbsp;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>
<HR>

<A NAME="cartesianProduct(java.util.List)"><!-- --></A><H3>
cartesianProduct</H3>
<PRE>
public static &lt;B&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;B&gt;&gt; <B>cartesianProduct</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;? extends B&gt;&gt;&nbsp;sets)</PRE>
<DL>
<DD>Returns every possible list that can be formed by choosing one element
 from each of the given sets in order; the "n-ary
 <a href="http://en.wikipedia.org/wiki/Cartesian_product">Cartesian
 product</a>" of the sets. For example: <pre class="code">   <code>cartesianProduct(ImmutableList.of(
       ImmutableSet.of(1, 2),
       ImmutableSet.of("A", "B", "C")))</code></pre>

 returns a set containing six lists:

 <ul>
 <li><code>ImmutableList.of(1, "A")</code>
 <li><code>ImmutableList.of(1, "B")</code>
 <li><code>ImmutableList.of(1, "C")</code>
 <li><code>ImmutableList.of(2, "A")</code>
 <li><code>ImmutableList.of(2, "B")</code>
 <li><code>ImmutableList.of(2, "C")</code>
 </ul>

 The order in which these lists are returned is not guaranteed, however the
 position of an element inside a tuple always corresponds to the position of
 the set from which it came in the input list. Note that if any input set is
 empty, the Cartesian product will also be empty. If no sets at all are
 provided (an empty list), the resulting Cartesian product has one element,
 an empty list (counter-intuitive, but mathematically consistent).
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>B</CODE> - any common base class shared by all axes (often just <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><CODE>Object</CODE></A>)<DT><B>Parameters:</B><DD><CODE>sets</CODE> - the sets to choose elements from, in the order that
     the elements chosen from those sets should appear in the resulting
     lists
<DT><B>Returns:</B><DD>the Cartesian product, as an immutable set containing immutable
     lists
<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>sets</code>, any one of the <code>sets</code>,
     or any element of a provided set is null<DT><B>Since:</B></DT>
  <DD>2010.01.04 <b>tentative</b></DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="cartesianProduct(java.util.Set...)"><!-- --></A><H3>
cartesianProduct</H3>
<PRE>
public static &lt;B&gt; <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;B&gt;&gt; <B>cartesianProduct</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>&lt;? extends B&gt;...&nbsp;sets)</PRE>
<DL>
<DD>Returns every possible list that can be formed by choosing one element
 from each of the given sets in order; the "n-ary
 <a href="http://en.wikipedia.org/wiki/Cartesian_product">Cartesian
 product</a>" of the sets. For example: <pre class="code">   <code>cartesianProduct(
       ImmutableSet.of(1, 2),
       ImmutableSet.of("A", "B", "C"))</code></pre>

 returns a set containing six lists:
   w
 <ul>
 <li><code>ImmutableList.of(1, "A")</code>
 <li><code>ImmutableList.of(1, "B")</code>
 <li><code>ImmutableList.of(1, "C")</code>
 <li><code>ImmutableList.of(2, "A")</code>
 <li><code>ImmutableList.of(2, "B")</code>
 <li><code>ImmutableList.of(2, "C")</code>
 </ul>

 The order in which these lists are returned is not guaranteed, however the
 position of an element inside a tuple always corresponds to the position of
 the set from which it came in the input list. Note that if any input set is
 empty, the Cartesian product will also be empty. If no sets at all are
 provided, the resulting Cartesian product has one element, an empty list
 (counter-intuitive, but mathematically consistent).
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>B</CODE> - any common base class shared by all axes (often just <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><CODE>Object</CODE></A>)<DT><B>Parameters:</B><DD><CODE>sets</CODE> - the sets to choose elements from, in the order that
     the elements chosen from those sets should appear in the resulting
     lists
<DT><B>Returns:</B><DD>the Cartesian product, as an immutable set containing immutable
     lists
<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>sets</code>, any one of the <code>sets</code>,
     or any element of a provided set is null<DT><B>Since:</B></DT>
  <DD>2010.01.04 <b>tentative</b></DD>
</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Sets.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/SetMultimap.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<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>  &nbsp;
&nbsp;<A HREF="Sets.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>