Home | History | Annotate | Download | only in collect
      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2 <!--NewPage-->
      3 <HTML>
      4 <HEAD>
      5 <!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:47:59 PST 2010 -->
      6 <TITLE>
      7 Iterables (Guava Libraries 2010.01.04)
      8 </TITLE>
      9 
     10 <META NAME="date" CONTENT="2010-01-04">
     11 
     12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
     13 
     14 <SCRIPT type="text/javascript">
     15 function windowTitle()
     16 {
     17     if (location.href.indexOf('is-external=true') == -1) {
     18         parent.document.title="Iterables (Guava Libraries 2010.01.04)";
     19     }
     20 }
     21 </SCRIPT>
     22 <NOSCRIPT>
     23 </NOSCRIPT>
     24 
     25 </HEAD>
     26 
     27 <BODY BGCOLOR="white" onload="windowTitle();">
     28 <HR>
     29 
     30 
     31 <!-- ========= START OF TOP NAVBAR ======= -->
     32 <A NAME="navbar_top"><!-- --></A>
     33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
     34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
     35 <TR>
     36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
     37 <A NAME="navbar_top_firstrow"><!-- --></A>
     38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
     39   <TR ALIGN="center" VALIGN="top">
     40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
     41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
     42   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
     43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Iterables.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
     44   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
     45   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
     46   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
     47   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
     48   </TR>
     49 </TABLE>
     50 </TD>
     51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
     52 </EM>
     53 </TD>
     54 </TR>
     55 
     56 <TR>
     57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
     58 &nbsp;<A HREF="../../../../com/google/common/collect/ImmutableSortedSet.Builder.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
     59 &nbsp;<A HREF="../../../../com/google/common/collect/Iterators.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
     60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
     61   <A HREF="../../../../index.html?com/google/common/collect/Iterables.html" target="_top"><B>FRAMES</B></A>  &nbsp;
     62 &nbsp;<A HREF="Iterables.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
     63 &nbsp;<SCRIPT type="text/javascript">
     64   <!--
     65   if(window==top) {
     66     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
     67   }
     68   //-->
     69 </SCRIPT>
     70 <NOSCRIPT>
     71   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
     72 </NOSCRIPT>
     73 
     74 
     75 </FONT></TD>
     76 </TR>
     77 <TR>
     78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     79   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
     80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
     82 </TR>
     83 </TABLE>
     84 <A NAME="skip-navbar_top"></A>
     85 <!-- ========= END OF TOP NAVBAR ========= -->
     86 
     87 <HR>
     88 <!-- ======== START OF CLASS DATA ======== -->
     89 <H2>
     90 <FONT SIZE="-1">
     91 com.google.common.collect</FONT>
     92 <BR>
     93 Class Iterables</H2>
     94 <PRE>
     95 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
     96   <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.Iterables</B>
     97 </PRE>
     98 <HR>
     99 <DL>
    100 <DT><PRE>public final class <B>Iterables</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>
    101 </PRE>
    102 
    103 <P>
    104 This class contains static utility methods that operate on or return objects
    105  of type <code>Iterable</code>. Except as noted, each method has a corresponding
    106  <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util"><CODE>Iterator</CODE></A>-based method in the <A HREF="../../../../com/google/common/collect/Iterators.html" title="class in com.google.common.collect"><CODE>Iterators</CODE></A> class.
    107 <P>
    108 
    109 <P>
    110 <DL>
    111 <DT><B>Since:</B></DT>
    112   <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD>
    113 <DT><B>Author:</B></DT>
    114   <DD>Kevin Bourrillion, Jared Levy</DD>
    115 </DL>
    116 <HR>
    117 
    118 <P>
    119 
    120 <!-- ========== METHOD SUMMARY =========== -->
    121 
    122 <A NAME="method_summary"><!-- --></A>
    123 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    124 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    125 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    126 <B>Method Summary</B></FONT></TH>
    127 </TR>
    128 <TR BGCOLOR="white" CLASS="TableRowColor">
    129 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    130 <CODE>static
    131 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    132 <TR ALIGN="right" VALIGN="">
    133 <TD NOWRAP><FONT SIZE="-1">
    134 <CODE>&lt;T&gt; boolean</CODE></FONT></TD>
    135 </TR>
    136 </TABLE>
    137 </CODE></FONT></TD>
    138 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#addAll(java.util.Collection, java.lang.Iterable)">addAll</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;T&gt;&nbsp;addTo,
    139        <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 T&gt;&nbsp;elementsToAdd)</CODE>
    140 
    141 <BR>
    142 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds all elements in <code>iterable</code> to <code>collection</code>.</TD>
    143 </TR>
    144 <TR BGCOLOR="white" CLASS="TableRowColor">
    145 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    146 <CODE>static
    147 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    148 <TR ALIGN="right" VALIGN="">
    149 <TD NOWRAP><FONT SIZE="-1">
    150 <CODE>&lt;T&gt; boolean</CODE></FONT></TD>
    151 </TR>
    152 </TABLE>
    153 </CODE></FONT></TD>
    154 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#all(java.lang.Iterable, com.google.common.base.Predicate)">all</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;T&gt;&nbsp;iterable,
    155     <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</CODE>
    156 
    157 <BR>
    158 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if every element in <code>iterable</code> satisfies the
    159  predicate.</TD>
    160 </TR>
    161 <TR BGCOLOR="white" CLASS="TableRowColor">
    162 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    163 <CODE>static
    164 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    165 <TR ALIGN="right" VALIGN="">
    166 <TD NOWRAP><FONT SIZE="-1">
    167 <CODE>&lt;T&gt; boolean</CODE></FONT></TD>
    168 </TR>
    169 </TABLE>
    170 </CODE></FONT></TD>
    171 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#any(java.lang.Iterable, com.google.common.base.Predicate)">any</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;T&gt;&nbsp;iterable,
    172     <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</CODE>
    173 
    174 <BR>
    175 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if one or more elements in <code>iterable</code> satisfy
    176  the predicate.</TD>
    177 </TR>
    178 <TR BGCOLOR="white" CLASS="TableRowColor">
    179 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    180 <CODE>static
    181 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    182 <TR ALIGN="right" VALIGN="">
    183 <TD NOWRAP><FONT SIZE="-1">
    184 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    185 </TR>
    186 </TABLE>
    187 </CODE></FONT></TD>
    188 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#concat(java.lang.Iterable)">concat</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 <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 T&gt;&gt;&nbsp;inputs)</CODE>
    189 
    190 <BR>
    191 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combines multiple iterables into a single iterable.</TD>
    192 </TR>
    193 <TR BGCOLOR="white" CLASS="TableRowColor">
    194 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    195 <CODE>static
    196 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    197 <TR ALIGN="right" VALIGN="">
    198 <TD NOWRAP><FONT SIZE="-1">
    199 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    200 </TR>
    201 </TABLE>
    202 </CODE></FONT></TD>
    203 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#concat(java.lang.Iterable...)">concat</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 T&gt;...&nbsp;inputs)</CODE>
    204 
    205 <BR>
    206 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combines multiple iterables into a single iterable.</TD>
    207 </TR>
    208 <TR BGCOLOR="white" CLASS="TableRowColor">
    209 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    210 <CODE>static
    211 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    212 <TR ALIGN="right" VALIGN="">
    213 <TD NOWRAP><FONT SIZE="-1">
    214 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    215 </TR>
    216 </TABLE>
    217 </CODE></FONT></TD>
    218 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#concat(java.lang.Iterable, java.lang.Iterable)">concat</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 T&gt;&nbsp;a,
    219        <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 T&gt;&nbsp;b)</CODE>
    220 
    221 <BR>
    222 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combines two iterables into a single iterable.</TD>
    223 </TR>
    224 <TR BGCOLOR="white" CLASS="TableRowColor">
    225 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    226 <CODE>static
    227 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    228 <TR ALIGN="right" VALIGN="">
    229 <TD NOWRAP><FONT SIZE="-1">
    230 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    231 </TR>
    232 </TABLE>
    233 </CODE></FONT></TD>
    234 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#concat(java.lang.Iterable, java.lang.Iterable, java.lang.Iterable)">concat</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 T&gt;&nbsp;a,
    235        <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 T&gt;&nbsp;b,
    236        <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 T&gt;&nbsp;c)</CODE>
    237 
    238 <BR>
    239 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combines three iterables into a single iterable.</TD>
    240 </TR>
    241 <TR BGCOLOR="white" CLASS="TableRowColor">
    242 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    243 <CODE>static
    244 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    245 <TR ALIGN="right" VALIGN="">
    246 <TD NOWRAP><FONT SIZE="-1">
    247 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    248 </TR>
    249 </TABLE>
    250 </CODE></FONT></TD>
    251 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#concat(java.lang.Iterable, java.lang.Iterable, java.lang.Iterable, java.lang.Iterable)">concat</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 T&gt;&nbsp;a,
    252        <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 T&gt;&nbsp;b,
    253        <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 T&gt;&nbsp;c,
    254        <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 T&gt;&nbsp;d)</CODE>
    255 
    256 <BR>
    257 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combines four iterables into a single iterable.</TD>
    258 </TR>
    259 <TR BGCOLOR="white" CLASS="TableRowColor">
    260 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    261 <CODE>static
    262 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    263 <TR ALIGN="right" VALIGN="">
    264 <TD NOWRAP><FONT SIZE="-1">
    265 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    266 </TR>
    267 </TABLE>
    268 </CODE></FONT></TD>
    269 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#consumingIterable(java.lang.Iterable)">consumingIterable</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;T&gt;&nbsp;iterable)</CODE>
    270 
    271 <BR>
    272 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a view of the supplied iterable that wraps each generated
    273  <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util"><CODE>Iterator</CODE></A> through <A HREF="../../../../com/google/common/collect/Iterators.html#consumingIterator(java.util.Iterator)"><CODE>Iterators.consumingIterator(Iterator)</CODE></A>.</TD>
    274 </TR>
    275 <TR BGCOLOR="white" CLASS="TableRowColor">
    276 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    277 <CODE>static&nbsp;boolean</CODE></FONT></TD>
    278 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#contains(java.lang.Iterable, java.lang.Object)">contains</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;?&gt;&nbsp;iterable,
    279          <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>&nbsp;element)</CODE>
    280 
    281 <BR>
    282 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if <code>iterable</code> contains <code>element</code>; that is,
    283  any object for while <code>equals(element)</code> is true.</TD>
    284 </TR>
    285 <TR BGCOLOR="white" CLASS="TableRowColor">
    286 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    287 <CODE>static
    288 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    289 <TR ALIGN="right" VALIGN="">
    290 <TD NOWRAP><FONT SIZE="-1">
    291 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    292 </TR>
    293 </TABLE>
    294 </CODE></FONT></TD>
    295 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#cycle(java.lang.Iterable)">cycle</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;T&gt;&nbsp;iterable)</CODE>
    296 
    297 <BR>
    298 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an iterable whose iterators cycle indefinitely over the elements of
    299  <code>iterable</code>.</TD>
    300 </TR>
    301 <TR BGCOLOR="white" CLASS="TableRowColor">
    302 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    303 <CODE>static
    304 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    305 <TR ALIGN="right" VALIGN="">
    306 <TD NOWRAP><FONT SIZE="-1">
    307 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    308 </TR>
    309 </TABLE>
    310 </CODE></FONT></TD>
    311 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#cycle(T...)">cycle</A></B>(T...&nbsp;elements)</CODE>
    312 
    313 <BR>
    314 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an iterable whose iterators cycle indefinitely over the provided
    315  elements.</TD>
    316 </TR>
    317 <TR BGCOLOR="white" CLASS="TableRowColor">
    318 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    319 <CODE>static&nbsp;boolean</CODE></FONT></TD>
    320 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#elementsEqual(java.lang.Iterable, java.lang.Iterable)">elementsEqual</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;?&gt;&nbsp;iterable1,
    321               <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;?&gt;&nbsp;iterable2)</CODE>
    322 
    323 <BR>
    324 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines whether two iterables contain equal elements in the same order.</TD>
    325 </TR>
    326 <TR BGCOLOR="white" CLASS="TableRowColor">
    327 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    328 <CODE>static
    329 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    330 <TR ALIGN="right" VALIGN="">
    331 <TD NOWRAP><FONT SIZE="-1">
    332 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    333 </TR>
    334 </TABLE>
    335 </CODE></FONT></TD>
    336 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#filter(java.lang.Iterable, java.lang.Class)">filter</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;?&gt;&nbsp;unfiltered,
    337        <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;T&gt;&nbsp;type)</CODE>
    338 
    339 <BR>
    340 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all instances of class <code>type</code> in <code>unfiltered</code>.</TD>
    341 </TR>
    342 <TR BGCOLOR="white" CLASS="TableRowColor">
    343 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    344 <CODE>static
    345 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    346 <TR ALIGN="right" VALIGN="">
    347 <TD NOWRAP><FONT SIZE="-1">
    348 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    349 </TR>
    350 </TABLE>
    351 </CODE></FONT></TD>
    352 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#filter(java.lang.Iterable, com.google.common.base.Predicate)">filter</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;T&gt;&nbsp;unfiltered,
    353        <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</CODE>
    354 
    355 <BR>
    356 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the elements of <code>unfiltered</code> that satisfy a predicate.</TD>
    357 </TR>
    358 <TR BGCOLOR="white" CLASS="TableRowColor">
    359 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    360 <CODE>static
    361 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    362 <TR ALIGN="right" VALIGN="">
    363 <TD NOWRAP><FONT SIZE="-1">
    364 <CODE>&lt;T&gt; T</CODE></FONT></TD>
    365 </TR>
    366 </TABLE>
    367 </CODE></FONT></TD>
    368 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#find(java.lang.Iterable, com.google.common.base.Predicate)">find</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;T&gt;&nbsp;iterable,
    369      <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</CODE>
    370 
    371 <BR>
    372 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the first element in <code>iterable</code> that satisfies the given
    373  predicate.</TD>
    374 </TR>
    375 <TR BGCOLOR="white" CLASS="TableRowColor">
    376 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    377 <CODE>static&nbsp;int</CODE></FONT></TD>
    378 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#frequency(java.lang.Iterable, java.lang.Object)">frequency</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;?&gt;&nbsp;iterable,
    379           <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>&nbsp;element)</CODE>
    380 
    381 <BR>
    382 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of elements in the specified iterable that equal the
    383  specified object.</TD>
    384 </TR>
    385 <TR BGCOLOR="white" CLASS="TableRowColor">
    386 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    387 <CODE>static
    388 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    389 <TR ALIGN="right" VALIGN="">
    390 <TD NOWRAP><FONT SIZE="-1">
    391 <CODE>&lt;T&gt; T</CODE></FONT></TD>
    392 </TR>
    393 </TABLE>
    394 </CODE></FONT></TD>
    395 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#get(java.lang.Iterable, int)">get</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;T&gt;&nbsp;iterable,
    396     int&nbsp;position)</CODE>
    397 
    398 <BR>
    399 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the element at the specified position in an iterable.</TD>
    400 </TR>
    401 <TR BGCOLOR="white" CLASS="TableRowColor">
    402 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    403 <CODE>static
    404 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    405 <TR ALIGN="right" VALIGN="">
    406 <TD NOWRAP><FONT SIZE="-1">
    407 <CODE>&lt;T&gt; T</CODE></FONT></TD>
    408 </TR>
    409 </TABLE>
    410 </CODE></FONT></TD>
    411 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#getLast(java.lang.Iterable)">getLast</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;T&gt;&nbsp;iterable)</CODE>
    412 
    413 <BR>
    414 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the last element of <code>iterable</code>.</TD>
    415 </TR>
    416 <TR BGCOLOR="white" CLASS="TableRowColor">
    417 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    418 <CODE>static
    419 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    420 <TR ALIGN="right" VALIGN="">
    421 <TD NOWRAP><FONT SIZE="-1">
    422 <CODE>&lt;T&gt; T</CODE></FONT></TD>
    423 </TR>
    424 </TABLE>
    425 </CODE></FONT></TD>
    426 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#getOnlyElement(java.lang.Iterable)">getOnlyElement</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;T&gt;&nbsp;iterable)</CODE>
    427 
    428 <BR>
    429 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the single element contained in <code>iterable</code>.</TD>
    430 </TR>
    431 <TR BGCOLOR="white" CLASS="TableRowColor">
    432 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    433 <CODE>static
    434 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    435 <TR ALIGN="right" VALIGN="">
    436 <TD NOWRAP><FONT SIZE="-1">
    437 <CODE>&lt;T&gt; T</CODE></FONT></TD>
    438 </TR>
    439 </TABLE>
    440 </CODE></FONT></TD>
    441 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#getOnlyElement(java.lang.Iterable, T)">getOnlyElement</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;T&gt;&nbsp;iterable,
    442                T&nbsp;defaultValue)</CODE>
    443 
    444 <BR>
    445 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the single element contained in <code>iterable</code>, or <code>defaultValue</code> if the iterable is empty.</TD>
    446 </TR>
    447 <TR BGCOLOR="white" CLASS="TableRowColor">
    448 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    449 <CODE>static
    450 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    451 <TR ALIGN="right" VALIGN="">
    452 <TD NOWRAP><FONT SIZE="-1">
    453 <CODE>&lt;T&gt; int</CODE></FONT></TD>
    454 </TR>
    455 </TABLE>
    456 </CODE></FONT></TD>
    457 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#indexOf(java.lang.Iterable, com.google.common.base.Predicate)">indexOf</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;T&gt;&nbsp;iterable,
    458         <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</CODE>
    459 
    460 <BR>
    461 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index in <code>iterable</code> of the first element that satisfies
    462  the provided <code>predicate</code>, or <code>-1</code> if the Iterable has no such
    463  elements.</TD>
    464 </TR>
    465 <TR BGCOLOR="white" CLASS="TableRowColor">
    466 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    467 <CODE>static
    468 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    469 <TR ALIGN="right" VALIGN="">
    470 <TD NOWRAP><FONT SIZE="-1">
    471 <CODE>&lt;T&gt; boolean</CODE></FONT></TD>
    472 </TR>
    473 </TABLE>
    474 </CODE></FONT></TD>
    475 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#isEmpty(java.lang.Iterable)">isEmpty</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;T&gt;&nbsp;iterable)</CODE>
    476 
    477 <BR>
    478 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if the given iterable contains no elements.</TD>
    479 </TR>
    480 <TR BGCOLOR="white" CLASS="TableRowColor">
    481 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    482 <CODE>static
    483 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    484 <TR ALIGN="right" VALIGN="">
    485 <TD NOWRAP><FONT SIZE="-1">
    486 <CODE>&lt;T&gt; <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;<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;T&gt;&gt;</CODE></FONT></TD>
    487 </TR>
    488 </TABLE>
    489 </CODE></FONT></TD>
    490 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#paddedPartition(java.lang.Iterable, int)">paddedPartition</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;T&gt;&nbsp;iterable,
    491                 int&nbsp;size)</CODE>
    492 
    493 <BR>
    494 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Divides an iterable into unmodifiable sublists of the given size, padding
    495  the final iterable with null values if necessary.</TD>
    496 </TR>
    497 <TR BGCOLOR="white" CLASS="TableRowColor">
    498 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    499 <CODE>static
    500 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    501 <TR ALIGN="right" VALIGN="">
    502 <TD NOWRAP><FONT SIZE="-1">
    503 <CODE>&lt;T&gt; <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;<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;T&gt;&gt;</CODE></FONT></TD>
    504 </TR>
    505 </TABLE>
    506 </CODE></FONT></TD>
    507 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#partition(java.lang.Iterable, int)">partition</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;T&gt;&nbsp;iterable,
    508           int&nbsp;size)</CODE>
    509 
    510 <BR>
    511 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Divides an iterable into unmodifiable sublists of the given size (the final
    512  iterable may be smaller).</TD>
    513 </TR>
    514 <TR BGCOLOR="white" CLASS="TableRowColor">
    515 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    516 <CODE>static&nbsp;boolean</CODE></FONT></TD>
    517 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#removeAll(java.lang.Iterable, java.util.Collection)">removeAll</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;?&gt;&nbsp;removeFrom,
    518           <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;?&gt;&nbsp;elementsToRemove)</CODE>
    519 
    520 <BR>
    521 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes, from an iterable, every element that belongs to the provided
    522  collection.</TD>
    523 </TR>
    524 <TR BGCOLOR="white" CLASS="TableRowColor">
    525 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    526 <CODE>static
    527 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    528 <TR ALIGN="right" VALIGN="">
    529 <TD NOWRAP><FONT SIZE="-1">
    530 <CODE>&lt;T&gt; boolean</CODE></FONT></TD>
    531 </TR>
    532 </TABLE>
    533 </CODE></FONT></TD>
    534 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#removeIf(java.lang.Iterable, com.google.common.base.Predicate)">removeIf</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;T&gt;&nbsp;removeFrom,
    535          <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</CODE>
    536 
    537 <BR>
    538 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes, from an iterable, every element that satisfies the provided
    539  predicate.</TD>
    540 </TR>
    541 <TR BGCOLOR="white" CLASS="TableRowColor">
    542 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    543 <CODE>static&nbsp;boolean</CODE></FONT></TD>
    544 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#retainAll(java.lang.Iterable, java.util.Collection)">retainAll</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;?&gt;&nbsp;removeFrom,
    545           <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;?&gt;&nbsp;elementsToRetain)</CODE>
    546 
    547 <BR>
    548 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes, from an iterable, every element that does not belong to the
    549  provided collection.</TD>
    550 </TR>
    551 <TR BGCOLOR="white" CLASS="TableRowColor">
    552 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    553 <CODE>static
    554 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    555 <TR ALIGN="right" VALIGN="">
    556 <TD NOWRAP><FONT SIZE="-1">
    557 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    558 </TR>
    559 </TABLE>
    560 </CODE></FONT></TD>
    561 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#reverse(java.util.List)">reverse</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;T&gt;&nbsp;list)</CODE>
    562 
    563 <BR>
    564 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adapts a list to an iterable with reversed iteration order.</TD>
    565 </TR>
    566 <TR BGCOLOR="white" CLASS="TableRowColor">
    567 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    568 <CODE>static&nbsp;int</CODE></FONT></TD>
    569 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#size(java.lang.Iterable)">size</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;?&gt;&nbsp;iterable)</CODE>
    570 
    571 <BR>
    572 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of elements in <code>iterable</code>.</TD>
    573 </TR>
    574 <TR BGCOLOR="white" CLASS="TableRowColor">
    575 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    576 <CODE>static
    577 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    578 <TR ALIGN="right" VALIGN="">
    579 <TD NOWRAP><FONT SIZE="-1">
    580 <CODE>&lt;T&gt; T[]</CODE></FONT></TD>
    581 </TR>
    582 </TABLE>
    583 </CODE></FONT></TD>
    584 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#toArray(java.lang.Iterable, java.lang.Class)">toArray</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 T&gt;&nbsp;iterable,
    585         <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;T&gt;&nbsp;type)</CODE>
    586 
    587 <BR>
    588 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copies an iterable's elements into an array.</TD>
    589 </TR>
    590 <TR BGCOLOR="white" CLASS="TableRowColor">
    591 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    592 <CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
    593 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#toString(java.lang.Iterable)">toString</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;?&gt;&nbsp;iterable)</CODE>
    594 
    595 <BR>
    596 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string representation of <code>iterable</code>, with the format
    597  <code>[e1, e2, ..., en]</code>.</TD>
    598 </TR>
    599 <TR BGCOLOR="white" CLASS="TableRowColor">
    600 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    601 <CODE>static
    602 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    603 <TR ALIGN="right" VALIGN="">
    604 <TD NOWRAP><FONT SIZE="-1">
    605 <CODE>&lt;F,T&gt; <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;T&gt;</CODE></FONT></TD>
    606 </TR>
    607 </TABLE>
    608 </CODE></FONT></TD>
    609 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#transform(java.lang.Iterable, com.google.common.base.Function)">transform</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;F&gt;&nbsp;fromIterable,
    610           <A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super F,? extends T&gt;&nbsp;function)</CODE>
    611 
    612 <BR>
    613 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an iterable that applies <code>function</code> to each element of <code>fromIterable</code>.</TD>
    614 </TR>
    615 <TR BGCOLOR="white" CLASS="TableRowColor">
    616 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    617 <CODE>static
    618 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    619 <TR ALIGN="right" VALIGN="">
    620 <TD NOWRAP><FONT SIZE="-1">
    621 <CODE>&lt;T&gt; <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;T&gt;</CODE></FONT></TD>
    622 </TR>
    623 </TABLE>
    624 </CODE></FONT></TD>
    625 <TD><CODE><B><A HREF="../../../../com/google/common/collect/Iterables.html#unmodifiableIterable(java.lang.Iterable)">unmodifiableIterable</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;T&gt;&nbsp;iterable)</CODE>
    626 
    627 <BR>
    628 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an unmodifiable view of <code>iterable</code>.</TD>
    629 </TR>
    630 </TABLE>
    631 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
    632 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    633 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    634 <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>
    635 </TR>
    636 <TR BGCOLOR="white" CLASS="TableRowColor">
    637 <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>
    638 </TR>
    639 </TABLE>
    640 &nbsp;
    641 <P>
    642 
    643 <!-- ============ METHOD DETAIL ========== -->
    644 
    645 <A NAME="method_detail"><!-- --></A>
    646 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    647 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    648 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    649 <B>Method Detail</B></FONT></TH>
    650 </TR>
    651 </TABLE>
    652 
    653 <A NAME="unmodifiableIterable(java.lang.Iterable)"><!-- --></A><H3>
    654 unmodifiableIterable</H3>
    655 <PRE>
    656 public static &lt;T&gt; <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;T&gt; <B>unmodifiableIterable</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;T&gt;&nbsp;iterable)</PRE>
    657 <DL>
    658 <DD>Returns an unmodifiable view of <code>iterable</code>.
    659 <P>
    660 <DD><DL>
    661 </DL>
    662 </DD>
    663 </DL>
    664 <HR>
    665 
    666 <A NAME="size(java.lang.Iterable)"><!-- --></A><H3>
    667 size</H3>
    668 <PRE>
    669 public static int <B>size</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;?&gt;&nbsp;iterable)</PRE>
    670 <DL>
    671 <DD>Returns the number of elements in <code>iterable</code>.
    672 <P>
    673 <DD><DL>
    674 </DL>
    675 </DD>
    676 </DL>
    677 <HR>
    678 
    679 <A NAME="contains(java.lang.Iterable, java.lang.Object)"><!-- --></A><H3>
    680 contains</H3>
    681 <PRE>
    682 public static boolean <B>contains</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;?&gt;&nbsp;iterable,
    683                                <FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
    684                                <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>&nbsp;element)</PRE>
    685 <DL>
    686 <DD>Returns <code>true</code> if <code>iterable</code> contains <code>element</code>; that is,
    687  any object for while <code>equals(element)</code> is true.
    688 <P>
    689 <DD><DL>
    690 </DL>
    691 </DD>
    692 </DL>
    693 <HR>
    694 
    695 <A NAME="removeAll(java.lang.Iterable, java.util.Collection)"><!-- --></A><H3>
    696 removeAll</H3>
    697 <PRE>
    698 public static boolean <B>removeAll</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;?&gt;&nbsp;removeFrom,
    699                                 <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;?&gt;&nbsp;elementsToRemove)</PRE>
    700 <DL>
    701 <DD>Removes, from an iterable, every element that belongs to the provided
    702  collection.
    703 
    704  <p>This method calls <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util"><CODE>Collection.removeAll(java.util.Collection<?>)</CODE></A> if <code>iterable</code> is a
    705  collection, and <A HREF="../../../../com/google/common/collect/Iterators.html#removeAll(java.util.Iterator, java.util.Collection)"><CODE>Iterators.removeAll(java.util.Iterator<?>, java.util.Collection<?>)</CODE></A> otherwise.
    706 <P>
    707 <DD><DL>
    708 <DT><B>Parameters:</B><DD><CODE>removeFrom</CODE> - the iterable to (potentially) remove elements from<DD><CODE>elementsToRemove</CODE> - the elements to remove
    709 <DT><B>Returns:</B><DD><code>true</code> if any elements are removed from <code>iterable</code></DL>
    710 </DD>
    711 </DL>
    712 <HR>
    713 
    714 <A NAME="retainAll(java.lang.Iterable, java.util.Collection)"><!-- --></A><H3>
    715 retainAll</H3>
    716 <PRE>
    717 public static boolean <B>retainAll</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;?&gt;&nbsp;removeFrom,
    718                                 <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;?&gt;&nbsp;elementsToRetain)</PRE>
    719 <DL>
    720 <DD>Removes, from an iterable, every element that does not belong to the
    721  provided collection.
    722 
    723  <p>This method calls <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util"><CODE>Collection.retainAll(java.util.Collection<?>)</CODE></A> if <code>iterable</code> is a
    724  collection, and <A HREF="../../../../com/google/common/collect/Iterators.html#retainAll(java.util.Iterator, java.util.Collection)"><CODE>Iterators.retainAll(java.util.Iterator<?>, java.util.Collection<?>)</CODE></A> otherwise.
    725 <P>
    726 <DD><DL>
    727 <DT><B>Parameters:</B><DD><CODE>removeFrom</CODE> - the iterable to (potentially) remove elements from<DD><CODE>elementsToRetain</CODE> - the elements to retain
    728 <DT><B>Returns:</B><DD><code>true</code> if any elements are removed from <code>iterable</code></DL>
    729 </DD>
    730 </DL>
    731 <HR>
    732 
    733 <A NAME="removeIf(java.lang.Iterable, com.google.common.base.Predicate)"><!-- --></A><H3>
    734 removeIf</H3>
    735 <PRE>
    736 public static &lt;T&gt; boolean <B>removeIf</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;T&gt;&nbsp;removeFrom,
    737                                    <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</PRE>
    738 <DL>
    739 <DD>Removes, from an iterable, every element that satisfies the provided
    740  predicate.
    741 <P>
    742 <DD><DL>
    743 <DT><B>Parameters:</B><DD><CODE>removeFrom</CODE> - the iterable to (potentially) remove elements from<DD><CODE>predicate</CODE> - a predicate that determines whether an element should
    744      be removed
    745 <DT><B>Returns:</B><DD><code>true</code> if any elements were removed from the iterable
    746 <DT><B>Throws:</B>
    747 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the iterable does not support
    748      <code>remove()</code>.<DT><B>Since:</B></DT>
    749   <DD>2010.01.04 <b>tentative</b></DD>
    750 </DL>
    751 </DD>
    752 </DL>
    753 <HR>
    754 
    755 <A NAME="elementsEqual(java.lang.Iterable, java.lang.Iterable)"><!-- --></A><H3>
    756 elementsEqual</H3>
    757 <PRE>
    758 public static boolean <B>elementsEqual</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;?&gt;&nbsp;iterable1,
    759                                     <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;?&gt;&nbsp;iterable2)</PRE>
    760 <DL>
    761 <DD>Determines whether two iterables contain equal elements in the same order.
    762  More specifically, this method returns <code>true</code> if <code>iterable1</code>
    763  and <code>iterable2</code> contain the same number of elements and every element
    764  of <code>iterable1</code> is equal to the corresponding element of
    765  <code>iterable2</code>.
    766 <P>
    767 <DD><DL>
    768 </DL>
    769 </DD>
    770 </DL>
    771 <HR>
    772 
    773 <A NAME="toString(java.lang.Iterable)"><!-- --></A><H3>
    774 toString</H3>
    775 <PRE>
    776 public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>(<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;?&gt;&nbsp;iterable)</PRE>
    777 <DL>
    778 <DD>Returns a string representation of <code>iterable</code>, with the format
    779  <code>[e1, e2, ..., en]</code>.
    780 <P>
    781 <DD><DL>
    782 </DL>
    783 </DD>
    784 </DL>
    785 <HR>
    786 
    787 <A NAME="getOnlyElement(java.lang.Iterable)"><!-- --></A><H3>
    788 getOnlyElement</H3>
    789 <PRE>
    790 public static &lt;T&gt; T <B>getOnlyElement</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;T&gt;&nbsp;iterable)</PRE>
    791 <DL>
    792 <DD>Returns the single element contained in <code>iterable</code>.
    793 <P>
    794 <DD><DL>
    795 
    796 <DT><B>Throws:</B>
    797 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</A></CODE> - if the iterable is empty
    798 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the iterable contains multiple
    799      elements</DL>
    800 </DD>
    801 </DL>
    802 <HR>
    803 
    804 <A NAME="getOnlyElement(java.lang.Iterable,java.lang.Object)"><!-- --></A><A NAME="getOnlyElement(java.lang.Iterable, T)"><!-- --></A><H3>
    805 getOnlyElement</H3>
    806 <PRE>
    807 public static &lt;T&gt; T <B>getOnlyElement</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;T&gt;&nbsp;iterable,
    808                                    <FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
    809                                    T&nbsp;defaultValue)</PRE>
    810 <DL>
    811 <DD>Returns the single element contained in <code>iterable</code>, or <code>defaultValue</code> if the iterable is empty.
    812 <P>
    813 <DD><DL>
    814 
    815 <DT><B>Throws:</B>
    816 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the iterator contains multiple
    817      elements</DL>
    818 </DD>
    819 </DL>
    820 <HR>
    821 
    822 <A NAME="toArray(java.lang.Iterable, java.lang.Class)"><!-- --></A><H3>
    823 toArray</H3>
    824 <PRE>
    825 public static &lt;T&gt; T[] <B>toArray</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 T&gt;&nbsp;iterable,
    826                               <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;T&gt;&nbsp;type)</PRE>
    827 <DL>
    828 <DD>Copies an iterable's elements into an array.
    829 <P>
    830 <DD><DL>
    831 <DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the iterable to copy<DD><CODE>type</CODE> - the type of the elements
    832 <DT><B>Returns:</B><DD>a newly-allocated array into which all the elements of the iterable
    833      have been copied</DL>
    834 </DD>
    835 </DL>
    836 <HR>
    837 
    838 <A NAME="addAll(java.util.Collection, java.lang.Iterable)"><!-- --></A><H3>
    839 addAll</H3>
    840 <PRE>
    841 public static &lt;T&gt; boolean <B>addAll</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;T&gt;&nbsp;addTo,
    842                                  <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 T&gt;&nbsp;elementsToAdd)</PRE>
    843 <DL>
    844 <DD>Adds all elements in <code>iterable</code> to <code>collection</code>.
    845 <P>
    846 <DD><DL>
    847 
    848 <DT><B>Returns:</B><DD><code>true</code> if <code>collection</code> was modified as a result of this
    849      operation.</DL>
    850 </DD>
    851 </DL>
    852 <HR>
    853 
    854 <A NAME="frequency(java.lang.Iterable, java.lang.Object)"><!-- --></A><H3>
    855 frequency</H3>
    856 <PRE>
    857 public static int <B>frequency</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;?&gt;&nbsp;iterable,
    858                             <FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
    859                             <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>&nbsp;element)</PRE>
    860 <DL>
    861 <DD>Returns the number of elements in the specified iterable that equal the
    862  specified object.
    863 <P>
    864 <DD><DL>
    865 <DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html?is-external=true#frequency(java.util.Collection, java.lang.Object)" title="class or interface in java.util"><CODE>Collections.frequency(java.util.Collection<?>, java.lang.Object)</CODE></A></DL>
    866 </DD>
    867 </DL>
    868 <HR>
    869 
    870 <A NAME="cycle(java.lang.Iterable)"><!-- --></A><H3>
    871 cycle</H3>
    872 <PRE>
    873 public static &lt;T&gt; <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;T&gt; <B>cycle</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;T&gt;&nbsp;iterable)</PRE>
    874 <DL>
    875 <DD>Returns an iterable whose iterators cycle indefinitely over the elements of
    876  <code>iterable</code>.
    877 
    878  <p>That iterator supports <code>remove()</code> if <code>iterable.iterator()</code>
    879  does. After <code>remove()</code> is called, subsequent cycles omit the removed
    880  element, which is no longer in <code>iterable</code>. The iterator's
    881  <code>hasNext()</code> method returns <code>true</code> until <code>iterable</code> is
    882  empty.
    883 
    884  <p><b>Warning:</b> Typical uses of the resulting iterator may produce an
    885  infinite loop. You should use an explicit <code>break</code> or be certain that
    886  you will eventually remove all the elements.
    887 
    888  <p>To cycle over the iterable <code>n</code> times, use the following:
    889  <code>Iterables.concat(Collections.nCopies(n, iterable))</code>
    890 <P>
    891 <DD><DL>
    892 </DL>
    893 </DD>
    894 </DL>
    895 <HR>
    896 
    897 <A NAME="cycle(java.lang.Object[])"><!-- --></A><A NAME="cycle(T...)"><!-- --></A><H3>
    898 cycle</H3>
    899 <PRE>
    900 public static &lt;T&gt; <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;T&gt; <B>cycle</B>(T...&nbsp;elements)</PRE>
    901 <DL>
    902 <DD>Returns an iterable whose iterators cycle indefinitely over the provided
    903  elements.
    904 
    905  <p>After <code>remove</code> is invoked on a generated iterator, the removed
    906  element will no longer appear in either that iterator or any other iterator
    907  created from the same source iterable. That is, this method behaves exactly
    908  as <code>Iterables.cycle(Lists.newArrayList(elements))</code>. The iterator's
    909  <code>hasNext</code> method returns <code>true</code> until all of the original
    910  elements have been removed.
    911 
    912  <p><b>Warning:</b> Typical uses of the resulting iterator may produce an
    913  infinite loop. You should use an explicit <code>break</code> or be certain that
    914  you will eventually remove all the elements.
    915 
    916  <p>To cycle over the elements <code>n</code> times, use the following:
    917  <code>Iterables.concat(Collections.nCopies(n, Arrays.asList(elements)))</code>
    918 <P>
    919 <DD><DL>
    920 </DL>
    921 </DD>
    922 </DL>
    923 <HR>
    924 
    925 <A NAME="concat(java.lang.Iterable, java.lang.Iterable)"><!-- --></A><H3>
    926 concat</H3>
    927 <PRE>
    928 public static &lt;T&gt; <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;T&gt; <B>concat</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 T&gt;&nbsp;a,
    929                                      <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 T&gt;&nbsp;b)</PRE>
    930 <DL>
    931 <DD>Combines two iterables into a single iterable. The returned iterable has an
    932  iterator that traverses the elements in <code>a</code>, followed by the elements
    933  in <code>b</code>. The source iterators are not polled until necessary.
    934 
    935  <p>The returned iterable's iterator supports <code>remove()</code> when the
    936  corresponding input iterator supports it.
    937 <P>
    938 <DD><DL>
    939 </DL>
    940 </DD>
    941 </DL>
    942 <HR>
    943 
    944 <A NAME="concat(java.lang.Iterable, java.lang.Iterable, java.lang.Iterable)"><!-- --></A><H3>
    945 concat</H3>
    946 <PRE>
    947 public static &lt;T&gt; <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;T&gt; <B>concat</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 T&gt;&nbsp;a,
    948                                      <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 T&gt;&nbsp;b,
    949                                      <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 T&gt;&nbsp;c)</PRE>
    950 <DL>
    951 <DD>Combines three iterables into a single iterable. The returned iterable has
    952  an iterator that traverses the elements in <code>a</code>, followed by the
    953  elements in <code>b</code>, followed by the elements in <code>c</code>. The source
    954  iterators are not polled until necessary.
    955 
    956  <p>The returned iterable's iterator supports <code>remove()</code> when the
    957  corresponding input iterator supports it.
    958 <P>
    959 <DD><DL>
    960 </DL>
    961 </DD>
    962 </DL>
    963 <HR>
    964 
    965 <A NAME="concat(java.lang.Iterable, java.lang.Iterable, java.lang.Iterable, java.lang.Iterable)"><!-- --></A><H3>
    966 concat</H3>
    967 <PRE>
    968 public static &lt;T&gt; <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;T&gt; <B>concat</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 T&gt;&nbsp;a,
    969                                      <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 T&gt;&nbsp;b,
    970                                      <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 T&gt;&nbsp;c,
    971                                      <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 T&gt;&nbsp;d)</PRE>
    972 <DL>
    973 <DD>Combines four iterables into a single iterable. The returned iterable has
    974  an iterator that traverses the elements in <code>a</code>, followed by the
    975  elements in <code>b</code>, followed by the elements in <code>c</code>, followed by
    976  the elements in <code>d</code>. The source iterators are not polled until
    977  necessary.
    978 
    979  <p>The returned iterable's iterator supports <code>remove()</code> when the
    980  corresponding input iterator supports it.
    981 <P>
    982 <DD><DL>
    983 </DL>
    984 </DD>
    985 </DL>
    986 <HR>
    987 
    988 <A NAME="concat(java.lang.Iterable...)"><!-- --></A><H3>
    989 concat</H3>
    990 <PRE>
    991 public static &lt;T&gt; <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;T&gt; <B>concat</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 T&gt;...&nbsp;inputs)</PRE>
    992 <DL>
    993 <DD>Combines multiple iterables into a single iterable. The returned iterable
    994  has an iterator that traverses the elements of each iterable in
    995  <code>inputs</code>. The input iterators are not polled until necessary.
    996 
    997  <p>The returned iterable's iterator supports <code>remove()</code> when the
    998  corresponding input iterator supports it.
    999 <P>
   1000 <DD><DL>
   1001 
   1002 <DT><B>Throws:</B>
   1003 <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 any of the provided iterables is null</DL>
   1004 </DD>
   1005 </DL>
   1006 <HR>
   1007 
   1008 <A NAME="concat(java.lang.Iterable)"><!-- --></A><H3>
   1009 concat</H3>
   1010 <PRE>
   1011 public static &lt;T&gt; <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;T&gt; <B>concat</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 <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 T&gt;&gt;&nbsp;inputs)</PRE>
   1012 <DL>
   1013 <DD>Combines multiple iterables into a single iterable. The returned iterable
   1014  has an iterator that traverses the elements of each iterable in
   1015  <code>inputs</code>. The input iterators are not polled until necessary.
   1016 
   1017  <p>The returned iterable's iterator supports <code>remove()</code> when the
   1018  corresponding input iterator supports it. The methods of the returned
   1019  iterable may throw <code>NullPointerException</code> if any of the input
   1020  iterators are null.
   1021 <P>
   1022 <DD><DL>
   1023 </DL>
   1024 </DD>
   1025 </DL>
   1026 <HR>
   1027 
   1028 <A NAME="partition(java.lang.Iterable, int)"><!-- --></A><H3>
   1029 partition</H3>
   1030 <PRE>
   1031 public static &lt;T&gt; <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;<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;T&gt;&gt; <B>partition</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;T&gt;&nbsp;iterable,
   1032                                               int&nbsp;size)</PRE>
   1033 <DL>
   1034 <DD>Divides an iterable into unmodifiable sublists of the given size (the final
   1035  iterable may be smaller). For example, partitioning an iterable containing
   1036  <code>[a, b, c, d, e]</code> with a partition size of 3 yields <code>[[a, b, c], [d, e]]</code> -- an outer iterable containing two inner lists of
   1037  three and two elements, all in the original order.
   1038 
   1039  <p>Iterators returned by the returned iterable do not support the <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true#remove()" title="class or interface in java.util"><CODE>Iterator.remove()</CODE></A> method. The returned lists implement <A HREF="http://java.sun.com/javase/6/docs/api/java/util/RandomAccess.html?is-external=true" title="class or interface in java.util"><CODE>RandomAccess</CODE></A>, whether or not the input list does.
   1040 
   1041  <p><b>Note:</b> if <code>iterable</code> is a <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util"><CODE>List</CODE></A>, use <A HREF="../../../../com/google/common/collect/Lists.html#partition(java.util.List, int)"><CODE>Lists.partition(List, int)</CODE></A> instead.
   1042 <P>
   1043 <DD><DL>
   1044 <DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the iterable to return a partitioned view of<DD><CODE>size</CODE> - the desired size of each partition (the last may be smaller)
   1045 <DT><B>Returns:</B><DD>an iterable of unmodifiable lists containing the elements of <code>iterable</code> divided into partitions
   1046 <DT><B>Throws:</B>
   1047 <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>size</code> is nonpositive</DL>
   1048 </DD>
   1049 </DL>
   1050 <HR>
   1051 
   1052 <A NAME="paddedPartition(java.lang.Iterable, int)"><!-- --></A><H3>
   1053 paddedPartition</H3>
   1054 <PRE>
   1055 public static &lt;T&gt; <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;<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;T&gt;&gt; <B>paddedPartition</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;T&gt;&nbsp;iterable,
   1056                                                     int&nbsp;size)</PRE>
   1057 <DL>
   1058 <DD>Divides an iterable into unmodifiable sublists of the given size, padding
   1059  the final iterable with null values if necessary. For example, partitioning
   1060  an iterable containing <code>[a, b, c, d, e]</code> with a partition size of 3
   1061  yields <code>[[a, b, c], [d, e, null]]</code> -- an outer iterable containing
   1062  two inner lists of three elements each, all in the original order.
   1063 
   1064  <p>Iterators returned by the returned iterable do not support the <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true#remove()" title="class or interface in java.util"><CODE>Iterator.remove()</CODE></A> method.
   1065 <P>
   1066 <DD><DL>
   1067 <DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the iterable to return a partitioned view of<DD><CODE>size</CODE> - the desired size of each partition
   1068 <DT><B>Returns:</B><DD>an iterable of unmodifiable lists containing the elements of <code>iterable</code> divided into partitions (the final iterable may have
   1069      trailing null elements)
   1070 <DT><B>Throws:</B>
   1071 <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>size</code> is nonpositive</DL>
   1072 </DD>
   1073 </DL>
   1074 <HR>
   1075 
   1076 <A NAME="filter(java.lang.Iterable, com.google.common.base.Predicate)"><!-- --></A><H3>
   1077 filter</H3>
   1078 <PRE>
   1079 public static &lt;T&gt; <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;T&gt; <B>filter</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;T&gt;&nbsp;unfiltered,
   1080                                      <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</PRE>
   1081 <DL>
   1082 <DD>Returns the elements of <code>unfiltered</code> that satisfy a predicate. The
   1083  resulting iterable's iterator does not support <code>remove()</code>.
   1084 <P>
   1085 <DD><DL>
   1086 </DL>
   1087 </DD>
   1088 </DL>
   1089 <HR>
   1090 
   1091 <A NAME="filter(java.lang.Iterable, java.lang.Class)"><!-- --></A><H3>
   1092 filter</H3>
   1093 <PRE>
   1094 public static &lt;T&gt; <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;T&gt; <B>filter</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;?&gt;&nbsp;unfiltered,
   1095                                      <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;T&gt;&nbsp;type)</PRE>
   1096 <DL>
   1097 <DD>Returns all instances of class <code>type</code> in <code>unfiltered</code>. The
   1098  returned iterable has elements whose class is <code>type</code> or a subclass of
   1099  <code>type</code>. The returned iterable's iterator does not support
   1100  <code>remove()</code>.
   1101 <P>
   1102 <DD><DL>
   1103 <DT><B>Parameters:</B><DD><CODE>unfiltered</CODE> - an iterable containing objects of any type<DD><CODE>type</CODE> - the type of elements desired
   1104 <DT><B>Returns:</B><DD>an unmodifiable iterable containing all elements of the original
   1105      iterable that were of the requested type</DL>
   1106 </DD>
   1107 </DL>
   1108 <HR>
   1109 
   1110 <A NAME="any(java.lang.Iterable, com.google.common.base.Predicate)"><!-- --></A><H3>
   1111 any</H3>
   1112 <PRE>
   1113 public static &lt;T&gt; boolean <B>any</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;T&gt;&nbsp;iterable,
   1114                               <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</PRE>
   1115 <DL>
   1116 <DD>Returns <code>true</code> if one or more elements in <code>iterable</code> satisfy
   1117  the predicate.
   1118 <P>
   1119 <DD><DL>
   1120 </DL>
   1121 </DD>
   1122 </DL>
   1123 <HR>
   1124 
   1125 <A NAME="all(java.lang.Iterable, com.google.common.base.Predicate)"><!-- --></A><H3>
   1126 all</H3>
   1127 <PRE>
   1128 public static &lt;T&gt; boolean <B>all</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;T&gt;&nbsp;iterable,
   1129                               <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</PRE>
   1130 <DL>
   1131 <DD>Returns <code>true</code> if every element in <code>iterable</code> satisfies the
   1132  predicate. If <code>iterable</code> is empty, <code>true</code> is returned.
   1133 <P>
   1134 <DD><DL>
   1135 </DL>
   1136 </DD>
   1137 </DL>
   1138 <HR>
   1139 
   1140 <A NAME="find(java.lang.Iterable, com.google.common.base.Predicate)"><!-- --></A><H3>
   1141 find</H3>
   1142 <PRE>
   1143 public static &lt;T&gt; T <B>find</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;T&gt;&nbsp;iterable,
   1144                          <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</PRE>
   1145 <DL>
   1146 <DD>Returns the first element in <code>iterable</code> that satisfies the given
   1147  predicate.
   1148 <P>
   1149 <DD><DL>
   1150 
   1151 <DT><B>Throws:</B>
   1152 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</A></CODE> - if no element in <code>iterable</code> matches
   1153      the given predicate</DL>
   1154 </DD>
   1155 </DL>
   1156 <HR>
   1157 
   1158 <A NAME="indexOf(java.lang.Iterable, com.google.common.base.Predicate)"><!-- --></A><H3>
   1159 indexOf</H3>
   1160 <PRE>
   1161 public static &lt;T&gt; int <B>indexOf</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;T&gt;&nbsp;iterable,
   1162                               <A HREF="../../../../com/google/common/base/Predicate.html" title="interface in com.google.common.base">Predicate</A>&lt;? super T&gt;&nbsp;predicate)</PRE>
   1163 <DL>
   1164 <DD>Returns the index in <code>iterable</code> of the first element that satisfies
   1165  the provided <code>predicate</code>, or <code>-1</code> if the Iterable has no such
   1166  elements.
   1167 
   1168  <p>More formally, returns the lowest index <code>i</code> such that
   1169  <code>predicate.apply(Iterables.get(iterable, i))</code> is <code>true</code> or
   1170  <code>-1</code> if there is no such index.
   1171 <P>
   1172 <DD><DL>
   1173 <DT><B>Since:</B></DT>
   1174   <DD>2010.01.04 <b>tentative</b></DD>
   1175 </DL>
   1176 </DD>
   1177 </DL>
   1178 <HR>
   1179 
   1180 <A NAME="transform(java.lang.Iterable, com.google.common.base.Function)"><!-- --></A><H3>
   1181 transform</H3>
   1182 <PRE>
   1183 public static &lt;F,T&gt; <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;T&gt; <B>transform</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;F&gt;&nbsp;fromIterable,
   1184                                           <A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super F,? extends T&gt;&nbsp;function)</PRE>
   1185 <DL>
   1186 <DD>Returns an iterable that applies <code>function</code> to each element of <code>fromIterable</code>.
   1187 
   1188  <p>The returned iterable's iterator supports <code>remove()</code> if the
   1189  provided iterator does. After a successful <code>remove()</code> call,
   1190  <code>fromIterable</code> no longer contains the corresponding element.
   1191 <P>
   1192 <DD><DL>
   1193 </DL>
   1194 </DD>
   1195 </DL>
   1196 <HR>
   1197 
   1198 <A NAME="get(java.lang.Iterable, int)"><!-- --></A><H3>
   1199 get</H3>
   1200 <PRE>
   1201 public static &lt;T&gt; T <B>get</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;T&gt;&nbsp;iterable,
   1202                         int&nbsp;position)</PRE>
   1203 <DL>
   1204 <DD>Returns the element at the specified position in an iterable.
   1205 <P>
   1206 <DD><DL>
   1207 <DT><B>Parameters:</B><DD><CODE>position</CODE> - position of the element to return
   1208 <DT><B>Returns:</B><DD>the element at the specified position in <code>iterable</code>
   1209 <DT><B>Throws:</B>
   1210 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</A></CODE> - if <code>position</code> is negative or
   1211      greater than or equal to the size of <code>iterable</code></DL>
   1212 </DD>
   1213 </DL>
   1214 <HR>
   1215 
   1216 <A NAME="getLast(java.lang.Iterable)"><!-- --></A><H3>
   1217 getLast</H3>
   1218 <PRE>
   1219 public static &lt;T&gt; T <B>getLast</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;T&gt;&nbsp;iterable)</PRE>
   1220 <DL>
   1221 <DD>Returns the last element of <code>iterable</code>.
   1222 <P>
   1223 <DD><DL>
   1224 
   1225 <DT><B>Returns:</B><DD>the last element of <code>iterable</code>
   1226 <DT><B>Throws:</B>
   1227 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</A></CODE> - if the iterable has no elements</DL>
   1228 </DD>
   1229 </DL>
   1230 <HR>
   1231 
   1232 <A NAME="consumingIterable(java.lang.Iterable)"><!-- --></A><H3>
   1233 consumingIterable</H3>
   1234 <PRE>
   1235 public static &lt;T&gt; <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;T&gt; <B>consumingIterable</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;T&gt;&nbsp;iterable)</PRE>
   1236 <DL>
   1237 <DD>Returns a view of the supplied iterable that wraps each generated
   1238  <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util"><CODE>Iterator</CODE></A> through <A HREF="../../../../com/google/common/collect/Iterators.html#consumingIterator(java.util.Iterator)"><CODE>Iterators.consumingIterator(Iterator)</CODE></A>.
   1239 <P>
   1240 <DD><DL>
   1241 <DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the iterable to wrap
   1242 <DT><B>Returns:</B><DD>a view of the supplied iterable that wraps each generated iterator
   1243      through <A HREF="../../../../com/google/common/collect/Iterators.html#consumingIterator(java.util.Iterator)"><CODE>Iterators.consumingIterator(Iterator)</CODE></A><DT><B>Since:</B></DT>
   1244   <DD>2010.01.04 <b>tentative</b></DD>
   1245 <DT><B>See Also:</B><DD><A HREF="../../../../com/google/common/collect/Iterators.html#consumingIterator(java.util.Iterator)"><CODE>Iterators.consumingIterator(Iterator)</CODE></A></DL>
   1246 </DD>
   1247 </DL>
   1248 <HR>
   1249 
   1250 <A NAME="reverse(java.util.List)"><!-- --></A><H3>
   1251 reverse</H3>
   1252 <PRE>
   1253 public static &lt;T&gt; <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;T&gt; <B>reverse</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;T&gt;&nbsp;list)</PRE>
   1254 <DL>
   1255 <DD>Adapts a list to an iterable with reversed iteration order. It is
   1256  especially useful in foreach-style loops: <pre class="code">   <code>List&lt;String&gt; mylist = ...
   1257    for (String str : Iterables.reverse(mylist)) {
   1258      ...
   1259    }</code></pre>
   1260 
   1261  There is no corresponding method in <A HREF="../../../../com/google/common/collect/Iterators.html" title="class in com.google.common.collect"><CODE>Iterators</CODE></A>, since <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang"><CODE>Iterable.iterator()</CODE></A> can simply be invoked on the result of calling this
   1262  method.
   1263 <P>
   1264 <DD><DL>
   1265 
   1266 <DT><B>Returns:</B><DD>an iterable with the same elements as the list, in reverse</DL>
   1267 </DD>
   1268 </DL>
   1269 <HR>
   1270 
   1271 <A NAME="isEmpty(java.lang.Iterable)"><!-- --></A><H3>
   1272 isEmpty</H3>
   1273 <PRE>
   1274 public static &lt;T&gt; boolean <B>isEmpty</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;T&gt;&nbsp;iterable)</PRE>
   1275 <DL>
   1276 <DD>Determines if the given iterable contains no elements.
   1277 
   1278  <p>There is no precise <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util"><CODE>Iterator</CODE></A> equivalent to this method, since
   1279  one can only ask an iterator whether it has any elements <i>remaining</i>
   1280  (which one does using <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true#hasNext()" title="class or interface in java.util"><CODE>Iterator.hasNext()</CODE></A>).
   1281 <P>
   1282 <DD><DL>
   1283 
   1284 <DT><B>Returns:</B><DD><code>true</code> if the iterable contains no elements</DL>
   1285 </DD>
   1286 </DL>
   1287 <!-- ========= END OF CLASS DATA ========= -->
   1288 <HR>
   1289 
   1290 
   1291 <!-- ======= START OF BOTTOM NAVBAR ====== -->
   1292 <A NAME="navbar_bottom"><!-- --></A>
   1293 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
   1294 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
   1295 <TR>
   1296 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
   1297 <A NAME="navbar_bottom_firstrow"><!-- --></A>
   1298 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
   1299   <TR ALIGN="center" VALIGN="top">
   1300   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
   1301   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
   1302   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
   1303   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Iterables.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
   1304   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
   1305   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
   1306   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
   1307   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
   1308   </TR>
   1309 </TABLE>
   1310 </TD>
   1311 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
   1312 </EM>
   1313 </TD>
   1314 </TR>
   1315 
   1316 <TR>
   1317 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
   1318 &nbsp;<A HREF="../../../../com/google/common/collect/ImmutableSortedSet.Builder.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
   1319 &nbsp;<A HREF="../../../../com/google/common/collect/Iterators.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
   1320 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
   1321   <A HREF="../../../../index.html?com/google/common/collect/Iterables.html" target="_top"><B>FRAMES</B></A>  &nbsp;
   1322 &nbsp;<A HREF="Iterables.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
   1323 &nbsp;<SCRIPT type="text/javascript">
   1324   <!--
   1325   if(window==top) {
   1326     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
   1327   }
   1328   //-->
   1329 </SCRIPT>
   1330 <NOSCRIPT>
   1331   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
   1332 </NOSCRIPT>
   1333 
   1334 
   1335 </FONT></TD>
   1336 </TR>
   1337 <TR>
   1338 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
   1339   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
   1340 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
   1341 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
   1342 </TR>
   1343 </TABLE>
   1344 <A NAME="skip-navbar_bottom"></A>
   1345 <!-- ======== END OF BOTTOM NAVBAR ======= -->
   1346 
   1347 <HR>
   1348 
   1349 </BODY>
   1350 </HTML>
   1351