• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
7Ordering (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">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="Ordering (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/Ordering.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/ObjectArrays.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../com/google/common/collect/PeekingIterator.html" title="interface 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/Ordering.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="Ordering.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;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&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">
91com.google.common.collect</FONT>
92<BR>
93Class Ordering&lt;T&gt;</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.Ordering&lt;T&gt;</B>
97</PRE>
98<DL>
99<DT><B>All Implemented Interfaces:</B> <DD><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;T&gt;</DD>
100</DL>
101<HR>
102<DL>
103<DT><PRE>public abstract class <B>Ordering&lt;T&gt;</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><DT>implements <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;T&gt;</DL>
104</PRE>
105
106<P>
107A comparator with added methods to support common functions. For example:
108 <pre>   <code>if (Ordering.from(comparator).reverse().isOrdered(list)) { ... }</code></pre>
109
110 <p>The <A HREF="../../../../com/google/common/collect/Ordering.html#from(java.util.Comparator)"><CODE>from(Comparator)</CODE></A> method returns the equivalent <code>Ordering</code> instance for a pre-existing comparator. You can also skip the
111 comparator step and extend <code>Ordering</code> directly: <pre>   <code>Ordering&lt;String&gt; byLengthOrdering = new Ordering&lt;String&gt;() {
112     public int compare(String left, String right) {
113       return Ints.compare(left.length(), right.length());
114     }
115   };</code></pre>
116
117 Except as noted, the orderings returned by the factory methods of this
118 class are serializable if and only if the provided instances that back them
119 are. For example, if <code>ordering</code> and <code>function</code> can themselves be
120 serialized, then <code>ordering.onResultOf(function)</code> can as well.
121<P>
122
123<P>
124<DL>
125<DT><B>Since:</B></DT>
126  <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD>
127<DT><B>Author:</B></DT>
128  <DD>Jesse Wilson, Kevin Bourrillion</DD>
129</DL>
130<HR>
131
132<P>
133
134<!-- ======== CONSTRUCTOR SUMMARY ======== -->
135
136<A NAME="constructor_summary"><!-- --></A>
137<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
138<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
139<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
140<B>Constructor Summary</B></FONT></TH>
141</TR>
142<TR BGCOLOR="white" CLASS="TableRowColor">
143<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
144<CODE>protected </CODE></FONT></TD>
145<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#Ordering()">Ordering</A></B>()</CODE>
146
147<BR>
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new instance of this class (only invokable by the subclass
149 constructor, typically implicit).</TD>
150</TR>
151</TABLE>
152&nbsp;
153<!-- ========== METHOD SUMMARY =========== -->
154
155<A NAME="method_summary"><!-- --></A>
156<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
157<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
158<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
159<B>Method Summary</B></FONT></TH>
160</TR>
161<TR BGCOLOR="white" CLASS="TableRowColor">
162<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
163<CODE>static&nbsp;<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;<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>&gt;</CODE></FONT></TD>
164<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#arbitrary()">arbitrary</A></B>()</CODE>
165
166<BR>
167&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an arbitrary ordering over all objects, for which <code>compare(a,
168 b) == 0</code> implies <code>a == b</code> (identity equality).</TD>
169</TR>
170<TR BGCOLOR="white" CLASS="TableRowColor">
171<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
172<CODE>&nbsp;int</CODE></FONT></TD>
173<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#binarySearch(java.util.List, T)">binarySearch</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="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;sortedList,
174             <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&nbsp;key)</CODE>
175
176<BR>
177&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html?is-external=true#binarySearch(java.util.List, T, java.util.Comparator)" title="class or interface in java.util"><CODE>Searches</CODE></A>
178 <code>sortedList</code> for <code>key</code> using the binary search algorithm.</TD>
179</TR>
180<TR BGCOLOR="white" CLASS="TableRowColor">
181<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
182<CODE>
183<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
184<TR ALIGN="right" VALIGN="">
185<TD NOWRAP><FONT SIZE="-1">
186<CODE>&lt;U extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
187<BR>
188<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;U&gt;</CODE></FONT></TD>
189</TR>
190</TABLE>
191</CODE></FONT></TD>
192<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#compound(java.util.Comparator)">compound</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 U&gt;&nbsp;secondaryComparator)</CODE>
193
194<BR>
195&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering which first uses the ordering <code>this</code>, but which
196 in the event of a "tie", then delegates to <code>secondaryComparator</code>.</TD>
197</TR>
198<TR BGCOLOR="white" CLASS="TableRowColor">
199<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
200<CODE>static
201<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
202<TR ALIGN="right" VALIGN="">
203<TD NOWRAP><FONT SIZE="-1">
204<CODE>&lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;</CODE></FONT></TD>
205</TR>
206</TABLE>
207</CODE></FONT></TD>
208<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#compound(java.lang.Iterable)">compound</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/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;? super T&gt;&gt;&nbsp;comparators)</CODE>
209
210<BR>
211&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering which tries each given comparator in order until a
212 non-zero result is found, returning that result, and returning zero only if
213 all comparators return zero.</TD>
214</TR>
215<TR BGCOLOR="white" CLASS="TableRowColor">
216<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
217<CODE>static
218<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
219<TR ALIGN="right" VALIGN="">
220<TD NOWRAP><FONT SIZE="-1">
221<CODE>&lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;</CODE></FONT></TD>
222</TR>
223</TABLE>
224</CODE></FONT></TD>
225<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#explicit(java.util.List)">explicit</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;valuesInOrder)</CODE>
226
227<BR>
228&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering that compares objects according to the order in
229 which they appear in the given list.</TD>
230</TR>
231<TR BGCOLOR="white" CLASS="TableRowColor">
232<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
233<CODE>static
234<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
235<TR ALIGN="right" VALIGN="">
236<TD NOWRAP><FONT SIZE="-1">
237<CODE>&lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;</CODE></FONT></TD>
238</TR>
239</TABLE>
240</CODE></FONT></TD>
241<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#explicit(T, T...)">explicit</A></B>(T&nbsp;leastValue,
242         T...&nbsp;remainingValuesInOrder)</CODE>
243
244<BR>
245&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering that compares objects according to the order in
246 which they are given to this method.</TD>
247</TR>
248<TR BGCOLOR="white" CLASS="TableRowColor">
249<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
250<CODE>static
251<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
252<TR ALIGN="right" VALIGN="">
253<TD NOWRAP><FONT SIZE="-1">
254<CODE>&lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;</CODE></FONT></TD>
255</TR>
256</TABLE>
257</CODE></FONT></TD>
258<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#from(java.util.Comparator)">from</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;T&gt;&nbsp;comparator)</CODE>
259
260<BR>
261&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering for a pre-existing <code>comparator</code>.</TD>
262</TR>
263<TR BGCOLOR="white" CLASS="TableRowColor">
264<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
265<CODE>static
266<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
267<TR ALIGN="right" VALIGN="">
268<TD NOWRAP><FONT SIZE="-1">
269<CODE>&lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;</CODE></FONT></TD>
270</TR>
271</TABLE>
272</CODE></FONT></TD>
273<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#from(com.google.common.collect.Ordering)">from</A></B>(<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;&nbsp;ordering)</CODE>
274
275<BR>
276&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>no need to use this</I></TD>
277</TR>
278<TR BGCOLOR="white" CLASS="TableRowColor">
279<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
280<CODE>&nbsp;boolean</CODE></FONT></TD>
281<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#isOrdered(java.lang.Iterable)">isOrdered</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="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;iterable)</CODE>
282
283<BR>
284&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if each element in <code>iterable</code> after the first is
285 greater than or equal to the element that preceded it, according to this
286 ordering.</TD>
287</TR>
288<TR BGCOLOR="white" CLASS="TableRowColor">
289<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
290<CODE>&nbsp;boolean</CODE></FONT></TD>
291<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#isStrictlyOrdered(java.lang.Iterable)">isStrictlyOrdered</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="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;iterable)</CODE>
292
293<BR>
294&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if each element in <code>iterable</code> after the first is
295 <i>strictly</i> greater than the element that preceded it, according to
296 this ordering.</TD>
297</TR>
298<TR BGCOLOR="white" CLASS="TableRowColor">
299<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
300<CODE>
301<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
302<TR ALIGN="right" VALIGN="">
303<TD NOWRAP><FONT SIZE="-1">
304<CODE>&lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
305<BR>
306<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;<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;S&gt;&gt;</CODE></FONT></TD>
307</TR>
308</TABLE>
309</CODE></FONT></TD>
310<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#lexicographical()">lexicographical</A></B>()</CODE>
311
312<BR>
313&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new ordering which sorts iterables by comparing corresponding
314 elements pairwise until a nonzero result is found; imposes "dictionary
315 order".</TD>
316</TR>
317<TR BGCOLOR="white" CLASS="TableRowColor">
318<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
319<CODE>
320<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
321<TR ALIGN="right" VALIGN="">
322<TD NOWRAP><FONT SIZE="-1">
323<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
324<BR>
325E</CODE></FONT></TD>
326</TR>
327</TABLE>
328</CODE></FONT></TD>
329<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#max(E, E)">max</A></B>(E&nbsp;a,
330    E&nbsp;b)</CODE>
331
332<BR>
333&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the larger of the two values according to this ordering.</TD>
334</TR>
335<TR BGCOLOR="white" CLASS="TableRowColor">
336<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
337<CODE>
338<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
339<TR ALIGN="right" VALIGN="">
340<TD NOWRAP><FONT SIZE="-1">
341<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
342<BR>
343E</CODE></FONT></TD>
344</TR>
345</TABLE>
346</CODE></FONT></TD>
347<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#max(E, E, E, E...)">max</A></B>(E&nbsp;a,
348    E&nbsp;b,
349    E&nbsp;c,
350    E...&nbsp;rest)</CODE>
351
352<BR>
353&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the largest of the specified values according to this ordering.</TD>
354</TR>
355<TR BGCOLOR="white" CLASS="TableRowColor">
356<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
357<CODE>
358<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
359<TR ALIGN="right" VALIGN="">
360<TD NOWRAP><FONT SIZE="-1">
361<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
362<BR>
363E</CODE></FONT></TD>
364</TR>
365</TABLE>
366</CODE></FONT></TD>
367<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#max(java.lang.Iterable)">max</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)</CODE>
368
369<BR>
370&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the largest of the specified values according to this ordering.</TD>
371</TR>
372<TR BGCOLOR="white" CLASS="TableRowColor">
373<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
374<CODE>
375<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
376<TR ALIGN="right" VALIGN="">
377<TD NOWRAP><FONT SIZE="-1">
378<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
379<BR>
380E</CODE></FONT></TD>
381</TR>
382</TABLE>
383</CODE></FONT></TD>
384<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#min(E, E)">min</A></B>(E&nbsp;a,
385    E&nbsp;b)</CODE>
386
387<BR>
388&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the smaller of the two values according to this ordering.</TD>
389</TR>
390<TR BGCOLOR="white" CLASS="TableRowColor">
391<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
392<CODE>
393<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
394<TR ALIGN="right" VALIGN="">
395<TD NOWRAP><FONT SIZE="-1">
396<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
397<BR>
398E</CODE></FONT></TD>
399</TR>
400</TABLE>
401</CODE></FONT></TD>
402<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#min(E, E, E, E...)">min</A></B>(E&nbsp;a,
403    E&nbsp;b,
404    E&nbsp;c,
405    E...&nbsp;rest)</CODE>
406
407<BR>
408&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the smallest of the specified values according to this ordering.</TD>
409</TR>
410<TR BGCOLOR="white" CLASS="TableRowColor">
411<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
412<CODE>
413<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
414<TR ALIGN="right" VALIGN="">
415<TD NOWRAP><FONT SIZE="-1">
416<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
417<BR>
418E</CODE></FONT></TD>
419</TR>
420</TABLE>
421</CODE></FONT></TD>
422<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#min(java.lang.Iterable)">min</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)</CODE>
423
424<BR>
425&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the smallest of the specified values according to this ordering.</TD>
426</TR>
427<TR BGCOLOR="white" CLASS="TableRowColor">
428<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
429<CODE>static
430<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
431<TR ALIGN="right" VALIGN="">
432<TD NOWRAP><FONT SIZE="-1">
433<CODE>&lt;C 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;
434<BR>
435<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;C&gt;</CODE></FONT></TD>
436</TR>
437</TABLE>
438</CODE></FONT></TD>
439<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#natural()">natural</A></B>()</CODE>
440
441<BR>
442&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a serializable ordering that uses the natural order of the values.</TD>
443</TR>
444<TR BGCOLOR="white" CLASS="TableRowColor">
445<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
446<CODE>
447<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
448<TR ALIGN="right" VALIGN="">
449<TD NOWRAP><FONT SIZE="-1">
450<CODE>&lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
451<BR>
452<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;S&gt;</CODE></FONT></TD>
453</TR>
454</TABLE>
455</CODE></FONT></TD>
456<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#nullsFirst()">nullsFirst</A></B>()</CODE>
457
458<BR>
459&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering that treats <code>null</code> as less than all other values
460 and uses <code>this</code> to compare non-null values.</TD>
461</TR>
462<TR BGCOLOR="white" CLASS="TableRowColor">
463<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
464<CODE>
465<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
466<TR ALIGN="right" VALIGN="">
467<TD NOWRAP><FONT SIZE="-1">
468<CODE>&lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
469<BR>
470<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;S&gt;</CODE></FONT></TD>
471</TR>
472</TABLE>
473</CODE></FONT></TD>
474<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#nullsLast()">nullsLast</A></B>()</CODE>
475
476<BR>
477&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering that treats <code>null</code> as greater than all other
478 values and uses this ordering to compare non-null values.</TD>
479</TR>
480<TR BGCOLOR="white" CLASS="TableRowColor">
481<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
482<CODE>
483<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
484<TR ALIGN="right" VALIGN="">
485<TD NOWRAP><FONT SIZE="-1">
486<CODE>&lt;F&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;F&gt;</CODE></FONT></TD>
487</TR>
488</TABLE>
489</CODE></FONT></TD>
490<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#onResultOf(com.google.common.base.Function)">onResultOf</A></B>(<A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;F,? extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;function)</CODE>
491
492<BR>
493&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new ordering on <code>F</code> which orders elements by first applying
494 a function to them, then comparing those results using <code>this</code>.</TD>
495</TR>
496<TR BGCOLOR="white" CLASS="TableRowColor">
497<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
498<CODE>
499<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
500<TR ALIGN="right" VALIGN="">
501<TD NOWRAP><FONT SIZE="-1">
502<CODE>&lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
503<BR>
504<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;S&gt;</CODE></FONT></TD>
505</TR>
506</TABLE>
507</CODE></FONT></TD>
508<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#reverse()">reverse</A></B>()</CODE>
509
510<BR>
511&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the reverse of this ordering; the <code>Ordering</code> equivalent to
512 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html?is-external=true#reverseOrder(java.util.Comparator)" title="class or interface in java.util"><CODE>Collections.reverseOrder(Comparator)</CODE></A>.</TD>
513</TR>
514<TR BGCOLOR="white" CLASS="TableRowColor">
515<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
516<CODE>
517<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
518<TR ALIGN="right" VALIGN="">
519<TD NOWRAP><FONT SIZE="-1">
520<CODE>&lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;
521<BR>
522<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;E&gt;</CODE></FONT></TD>
523</TR>
524</TABLE>
525</CODE></FONT></TD>
526<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#sortedCopy(java.lang.Iterable)">sortedCopy</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)</CODE>
527
528<BR>
529&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a copy of the given iterable sorted by this ordering.</TD>
530</TR>
531<TR BGCOLOR="white" CLASS="TableRowColor">
532<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
533<CODE>static&nbsp;<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;<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>&gt;</CODE></FONT></TD>
534<TD><CODE><B><A HREF="../../../../com/google/common/collect/Ordering.html#usingToString()">usingToString</A></B>()</CODE>
535
536<BR>
537&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an ordering that compares objects by the natural ordering of their
538 string representations as returned by <code>toString()</code>.</TD>
539</TR>
540</TABLE>
541&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
542<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
543<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
544<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>
545</TR>
546<TR BGCOLOR="white" CLASS="TableRowColor">
547<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>
548</TR>
549</TABLE>
550&nbsp;<A NAME="methods_inherited_from_class_java.util.Comparator"><!-- --></A>
551<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
552<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
553<TH ALIGN="left"><B>Methods inherited from interface java.util.<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></B></TH>
554</TR>
555<TR BGCOLOR="white" CLASS="TableRowColor">
556<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true#compare(T, T)" title="class or interface in java.util">compare</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</A></CODE></TD>
557</TR>
558</TABLE>
559&nbsp;
560<P>
561
562<!-- ========= CONSTRUCTOR DETAIL ======== -->
563
564<A NAME="constructor_detail"><!-- --></A>
565<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
566<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
567<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
568<B>Constructor Detail</B></FONT></TH>
569</TR>
570</TABLE>
571
572<A NAME="Ordering()"><!-- --></A><H3>
573Ordering</H3>
574<PRE>
575protected <B>Ordering</B>()</PRE>
576<DL>
577<DD>Constructs a new instance of this class (only invokable by the subclass
578 constructor, typically implicit).
579<P>
580</DL>
581
582<!-- ============ METHOD DETAIL ========== -->
583
584<A NAME="method_detail"><!-- --></A>
585<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
586<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
587<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
588<B>Method Detail</B></FONT></TH>
589</TR>
590</TABLE>
591
592<A NAME="natural()"><!-- --></A><H3>
593natural</H3>
594<PRE>
595public static &lt;C 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="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;C&gt; <B>natural</B>()</PRE>
596<DL>
597<DD>Returns a serializable ordering that uses the natural order of the values.
598 The ordering throws a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><CODE>NullPointerException</CODE></A> when passed a null
599 parameter.
600
601 <p>The type specification is <code>&lt;C extends Comparable&gt;</code>, instead of
602 the technically correct <code>&lt;C extends Comparable&lt;? super C&gt;&gt;</code>, to
603 support legacy types from before Java 5.
604<P>
605<DD><DL>
606</DL>
607</DD>
608<DD><DL>
609</DL>
610</DD>
611</DL>
612<HR>
613
614<A NAME="from(java.util.Comparator)"><!-- --></A><H3>
615from</H3>
616<PRE>
617public static &lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt; <B>from</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;T&gt;&nbsp;comparator)</PRE>
618<DL>
619<DD>Returns an ordering for a pre-existing <code>comparator</code>. Note
620 that if the comparator is not pre-existing, and you don't require
621 serialization, you can subclass <code>Ordering</code> and implement its
622 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true#compare(T, T)" title="class or interface in java.util"><CODE>compare</CODE></A> method instead.
623<P>
624<DD><DL>
625</DL>
626</DD>
627<DD><DL>
628<DT><B>Parameters:</B><DD><CODE>comparator</CODE> - the comparator that defines the order</DL>
629</DD>
630</DL>
631<HR>
632
633<A NAME="from(com.google.common.collect.Ordering)"><!-- --></A><H3>
634from</H3>
635<PRE>
636<FONT SIZE="-1"><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
637</FONT>public static &lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt; <B>from</B>(<A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt;&nbsp;ordering)</PRE>
638<DL>
639<DD><B>Deprecated.</B>&nbsp;<I>no need to use this</I>
640<P>
641<DD>Simply returns its argument.
642<P>
643<DD><DL>
644</DL>
645</DD>
646<DD><DL>
647</DL>
648</DD>
649</DL>
650<HR>
651
652<A NAME="explicit(java.util.List)"><!-- --></A><H3>
653explicit</H3>
654<PRE>
655public static &lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt; <B>explicit</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;valuesInOrder)</PRE>
656<DL>
657<DD>Returns an ordering that compares objects according to the order in
658 which they appear in the given list. Only objects present in the list
659 (according to <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>) may be compared. This comparator
660 imposes a "partial ordering" over the type <code>T</code>. Subsequent changes
661 to the <code>valuesInOrder</code> list will have no effect on the returned
662 comparator. Null values in the list are not supported.
663
664 <p>The returned comparator throws an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang"><CODE>ClassCastException</CODE></A> when it
665 receives an input parameter that isn't among the provided values.
666
667 <p>The generated comparator is serializable if all the provided values are
668 serializable.
669<P>
670<DD><DL>
671</DL>
672</DD>
673<DD><DL>
674<DT><B>Parameters:</B><DD><CODE>valuesInOrder</CODE> - the values that the returned comparator will be able
675     to compare, in the order the comparator should induce
676<DT><B>Returns:</B><DD>the comparator described above
677<DT><B>Throws:</B>
678<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 values is null
679<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>valuesInOrder</code> contains any
680     duplicate values (according to <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>)</DL>
681</DD>
682</DL>
683<HR>
684
685<A NAME="explicit(java.lang.Object,java.lang.Object[])"><!-- --></A><A NAME="explicit(T, T...)"><!-- --></A><H3>
686explicit</H3>
687<PRE>
688public static &lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt; <B>explicit</B>(T&nbsp;leastValue,
689                                       T...&nbsp;remainingValuesInOrder)</PRE>
690<DL>
691<DD>Returns an ordering that compares objects according to the order in
692 which they are given to this method. Only objects present in the argument
693 list (according to <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(java.lang.Object)</CODE></A>) may be compared. This comparator
694 imposes a "partial ordering" over the type <code>T</code>. Null values in the
695 argument list are not supported.
696
697 <p>The returned comparator throws a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang"><CODE>ClassCastException</CODE></A> when it
698 receives an input parameter that isn't among the provided values.
699
700 <p>The generated comparator is serializable if all the provided values are
701 serializable.
702<P>
703<DD><DL>
704</DL>
705</DD>
706<DD><DL>
707<DT><B>Parameters:</B><DD><CODE>leastValue</CODE> - the value which the returned comparator should consider
708     the "least" of all values<DD><CODE>remainingValuesInOrder</CODE> - the rest of the values that the returned
709     comparator will be able to compare, in the order the comparator should
710     follow
711<DT><B>Returns:</B><DD>the comparator described above
712<DT><B>Throws:</B>
713<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 values is null
714<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 any duplicate values (according to
715     <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(Object)</CODE></A>) are present among the method arguments</DL>
716</DD>
717</DL>
718<HR>
719
720<A NAME="arbitrary()"><!-- --></A><H3>
721arbitrary</H3>
722<PRE>
723public static <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;<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>&gt; <B>arbitrary</B>()</PRE>
724<DL>
725<DD>Returns an arbitrary ordering over all objects, for which <code>compare(a,
726 b) == 0</code> implies <code>a == b</code> (identity equality). There is no meaning
727 whatsoever to the order imposed, but it is constant for the life of the VM.
728
729 <p>Because the ordering is identity-based, it is not "consistent with
730 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><CODE>Object.equals(Object)</CODE></A>" as defined by <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util"><CODE>Comparator</CODE></A>. Use
731 caution when building a <A HREF="http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html?is-external=true" title="class or interface in java.util"><CODE>SortedSet</CODE></A> or <A HREF="http://java.sun.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util"><CODE>SortedMap</CODE></A> from it, as
732 the resulting collection will not behave exactly according to spec.
733
734 <p>This ordering is not serializable, as its implementation relies on
735 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/System.html?is-external=true#identityHashCode(java.lang.Object)" title="class or interface in java.lang"><CODE>System.identityHashCode(Object)</CODE></A>, so its behavior cannot be
736 preserved across serialization.
737<P>
738<DD><DL>
739</DL>
740</DD>
741<DD><DL>
742<DT><B>Since:</B></DT>
743  <DD>2010.01.04 <b>tentative</b></DD>
744</DL>
745</DD>
746</DL>
747<HR>
748
749<A NAME="usingToString()"><!-- --></A><H3>
750usingToString</H3>
751<PRE>
752public static <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;<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>&gt; <B>usingToString</B>()</PRE>
753<DL>
754<DD>Returns an ordering that compares objects by the natural ordering of their
755 string representations as returned by <code>toString()</code>. It does not
756 support null values.
757
758 <p>The comparator is serializable.
759<P>
760<DD><DL>
761</DL>
762</DD>
763<DD><DL>
764</DL>
765</DD>
766</DL>
767<HR>
768
769<A NAME="compound(java.lang.Iterable)"><!-- --></A><H3>
770compound</H3>
771<PRE>
772public static &lt;T&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;T&gt; <B>compound</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/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;? super T&gt;&gt;&nbsp;comparators)</PRE>
773<DL>
774<DD>Returns an ordering which tries each given comparator in order until a
775 non-zero result is found, returning that result, and returning zero only if
776 all comparators return zero. The returned ordering is based on the state of
777 the <code>comparators</code> iterable at the time it was provided to this
778 method.
779
780 <p>The returned ordering is equivalent to that produced using <code>Ordering.from(comp1).compound(comp2).compound(comp3) . . .</code>.
781
782 <p><b>Warning:</b> Supplying an argument with undefined iteration order,
783 such as a <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>, will produce non-deterministic results.
784<P>
785<DD><DL>
786</DL>
787</DD>
788<DD><DL>
789<DT><B>Parameters:</B><DD><CODE>comparators</CODE> - the comparators to try in order</DL>
790</DD>
791</DL>
792<HR>
793
794<A NAME="compound(java.util.Comparator)"><!-- --></A><H3>
795compound</H3>
796<PRE>
797public &lt;U extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;U&gt; <B>compound</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 U&gt;&nbsp;secondaryComparator)</PRE>
798<DL>
799<DD>Returns an ordering which first uses the ordering <code>this</code>, but which
800 in the event of a "tie", then delegates to <code>secondaryComparator</code>.
801 For example, to sort a bug list first by status and second by priority, you
802 might use <code>byStatus.compound(byPriority)</code>. For a compound ordering
803 with three or more components, simply chain multiple calls to this method.
804
805 <p>An ordering produced by this method, or a chain of calls to this method,
806 is equivalent to one created using <A HREF="../../../../com/google/common/collect/Ordering.html#compound(java.lang.Iterable)"><CODE>compound(Iterable)</CODE></A> on
807 the same component comparators.
808<P>
809<DD><DL>
810</DL>
811</DD>
812<DD><DL>
813</DL>
814</DD>
815</DL>
816<HR>
817
818<A NAME="reverse()"><!-- --></A><H3>
819reverse</H3>
820<PRE>
821public &lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;S&gt; <B>reverse</B>()</PRE>
822<DL>
823<DD>Returns the reverse of this ordering; the <code>Ordering</code> equivalent to
824 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html?is-external=true#reverseOrder(java.util.Comparator)" title="class or interface in java.util"><CODE>Collections.reverseOrder(Comparator)</CODE></A>.
825<P>
826<DD><DL>
827</DL>
828</DD>
829<DD><DL>
830</DL>
831</DD>
832</DL>
833<HR>
834
835<A NAME="onResultOf(com.google.common.base.Function)"><!-- --></A><H3>
836onResultOf</H3>
837<PRE>
838public &lt;F&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;F&gt; <B>onResultOf</B>(<A HREF="../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;F,? extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;function)</PRE>
839<DL>
840<DD>Returns a new ordering on <code>F</code> which orders elements by first applying
841 a function to them, then comparing those results using <code>this</code>. For
842 example, to compare objects by their string forms, in a case-insensitive
843 manner, use: <pre>   <code>Ordering.from(String.CASE_INSENSITIVE_ORDER)
844       .onResultOf(Functions.toStringFunction())</code></pre>
845<P>
846<DD><DL>
847</DL>
848</DD>
849<DD><DL>
850</DL>
851</DD>
852</DL>
853<HR>
854
855<A NAME="lexicographical()"><!-- --></A><H3>
856lexicographical</H3>
857<PRE>
858public &lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;<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;S&gt;&gt; <B>lexicographical</B>()</PRE>
859<DL>
860<DD>Returns a new ordering which sorts iterables by comparing corresponding
861 elements pairwise until a nonzero result is found; imposes "dictionary
862 order". If the end of one iterable is reached, but not the other, the
863 shorter iterable is considered to be less than the longer one. For example,
864 a lexicographical natural ordering over integers considers <code>[] &lt; [1] &lt; [1, 1] &lt; [1, 2] &lt; [2]</code>.
865
866 <p>Note that <code>ordering.lexicographical().reverse()</code> is not
867 equivalent to <code>ordering.reverse().lexicographical()</code> (consider how
868 each would order <code>[1]</code> and <code>[1, 1]</code>).
869<P>
870<DD><DL>
871</DL>
872</DD>
873<DD><DL>
874<DT><B>Since:</B></DT>
875  <DD>2010.01.04 <b>tentative</b></DD>
876</DL>
877</DD>
878</DL>
879<HR>
880
881<A NAME="nullsFirst()"><!-- --></A><H3>
882nullsFirst</H3>
883<PRE>
884public &lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;S&gt; <B>nullsFirst</B>()</PRE>
885<DL>
886<DD>Returns an ordering that treats <code>null</code> as less than all other values
887 and uses <code>this</code> to compare non-null values.
888<P>
889<DD><DL>
890</DL>
891</DD>
892<DD><DL>
893</DL>
894</DD>
895</DL>
896<HR>
897
898<A NAME="nullsLast()"><!-- --></A><H3>
899nullsLast</H3>
900<PRE>
901public &lt;S extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect">Ordering</A>&lt;S&gt; <B>nullsLast</B>()</PRE>
902<DL>
903<DD>Returns an ordering that treats <code>null</code> as greater than all other
904 values and uses this ordering to compare non-null values.
905<P>
906<DD><DL>
907</DL>
908</DD>
909<DD><DL>
910</DL>
911</DD>
912</DL>
913<HR>
914
915<A NAME="binarySearch(java.util.List,java.lang.Object)"><!-- --></A><A NAME="binarySearch(java.util.List, T)"><!-- --></A><H3>
916binarySearch</H3>
917<PRE>
918public int <B>binarySearch</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="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;sortedList,
919                        <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&nbsp;key)</PRE>
920<DL>
921<DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collections.html?is-external=true#binarySearch(java.util.List, T, java.util.Comparator)" title="class or interface in java.util"><CODE>Searches</CODE></A>
922 <code>sortedList</code> for <code>key</code> using the binary search algorithm. The
923 list must be sorted using this ordering.
924<P>
925<DD><DL>
926</DL>
927</DD>
928<DD><DL>
929<DT><B>Parameters:</B><DD><CODE>sortedList</CODE> - the list to be searched<DD><CODE>key</CODE> - the key to be searched for</DL>
930</DD>
931</DL>
932<HR>
933
934<A NAME="sortedCopy(java.lang.Iterable)"><!-- --></A><H3>
935sortedCopy</H3>
936<PRE>
937public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; <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;E&gt; <B>sortedCopy</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)</PRE>
938<DL>
939<DD>Returns a copy of the given iterable sorted by this ordering. The input is
940 not modified. The returned list is modifiable, serializable, and has random
941 access.
942
943 <p>Unlike <A HREF="../../../../com/google/common/collect/Sets.html#newTreeSet(java.lang.Iterable)"><CODE>Sets.newTreeSet(Iterable)</CODE></A>, this method does not collapse
944 elements that compare as zero, and the resulting collection does not
945 maintain its own sort order.
946<P>
947<DD><DL>
948</DL>
949</DD>
950<DD><DL>
951<DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the elements to be copied and sorted
952<DT><B>Returns:</B><DD>a new list containing the given elements in sorted order</DL>
953</DD>
954</DL>
955<HR>
956
957<A NAME="isOrdered(java.lang.Iterable)"><!-- --></A><H3>
958isOrdered</H3>
959<PRE>
960public boolean <B>isOrdered</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="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;iterable)</PRE>
961<DL>
962<DD>Returns <code>true</code> if each element in <code>iterable</code> after the first is
963 greater than or equal to the element that preceded it, according to this
964 ordering. Note that this is always true when the iterable has fewer than
965 two elements.
966<P>
967<DD><DL>
968</DL>
969</DD>
970<DD><DL>
971</DL>
972</DD>
973</DL>
974<HR>
975
976<A NAME="isStrictlyOrdered(java.lang.Iterable)"><!-- --></A><H3>
977isStrictlyOrdered</H3>
978<PRE>
979public boolean <B>isStrictlyOrdered</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="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt;&nbsp;iterable)</PRE>
980<DL>
981<DD>Returns <code>true</code> if each element in <code>iterable</code> after the first is
982 <i>strictly</i> greater than the element that preceded it, according to
983 this ordering. Note that this is always true when the iterable has fewer
984 than two elements.
985<P>
986<DD><DL>
987</DL>
988</DD>
989<DD><DL>
990</DL>
991</DD>
992</DL>
993<HR>
994
995<A NAME="max(java.lang.Iterable)"><!-- --></A><H3>
996max</H3>
997<PRE>
998public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; E <B>max</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)</PRE>
999<DL>
1000<DD>Returns the largest of the specified values according to this ordering. If
1001 there are multiple largest values, the first of those is returned.
1002<P>
1003<DD><DL>
1004</DL>
1005</DD>
1006<DD><DL>
1007<DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the iterable whose maximum element is to be determined
1008<DT><B>Throws:</B>
1009<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 <code>iterable</code> is empty
1010<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</A></CODE> - if the parameters are not <i>mutually
1011     comparable</i> under this ordering.</DL>
1012</DD>
1013</DL>
1014<HR>
1015
1016<A NAME="max(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object[])"><!-- --></A><A NAME="max(E, E, E, E...)"><!-- --></A><H3>
1017max</H3>
1018<PRE>
1019public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; E <B>max</B>(E&nbsp;a,
1020                           E&nbsp;b,
1021                           E&nbsp;c,
1022                           E...&nbsp;rest)</PRE>
1023<DL>
1024<DD>Returns the largest of the specified values according to this ordering. If
1025 there are multiple largest values, the first of those is returned.
1026<P>
1027<DD><DL>
1028</DL>
1029</DD>
1030<DD><DL>
1031<DT><B>Parameters:</B><DD><CODE>a</CODE> - value to compare, returned if greater than or equal to the rest.<DD><CODE>b</CODE> - value to compare<DD><CODE>c</CODE> - value to compare<DD><CODE>rest</CODE> - values to compare
1032<DT><B>Throws:</B>
1033<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</A></CODE> - if the parameters are not <i>mutually
1034     comparable</i> under this ordering.</DL>
1035</DD>
1036</DL>
1037<HR>
1038
1039<A NAME="max(java.lang.Object,java.lang.Object)"><!-- --></A><A NAME="max(E, E)"><!-- --></A><H3>
1040max</H3>
1041<PRE>
1042public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; E <B>max</B>(E&nbsp;a,
1043                           E&nbsp;b)</PRE>
1044<DL>
1045<DD>Returns the larger of the two values according to this ordering. If the
1046 values compare as 0, the first is returned.
1047
1048 <p><b>Implementation note:</b> this method is invoked by the default
1049 implementations of the other <code>max</code> overloads, so overriding it will
1050 affect their behavior.
1051<P>
1052<DD><DL>
1053</DL>
1054</DD>
1055<DD><DL>
1056<DT><B>Parameters:</B><DD><CODE>a</CODE> - value to compare, returned if greater than or equal to b.<DD><CODE>b</CODE> - value to compare.
1057<DT><B>Throws:</B>
1058<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</A></CODE> - if the parameters are not <i>mutually
1059     comparable</i> under this ordering.</DL>
1060</DD>
1061</DL>
1062<HR>
1063
1064<A NAME="min(java.lang.Iterable)"><!-- --></A><H3>
1065min</H3>
1066<PRE>
1067public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; E <B>min</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)</PRE>
1068<DL>
1069<DD>Returns the smallest of the specified values according to this ordering. If
1070 there are multiple smallest values, the first of those is returned.
1071<P>
1072<DD><DL>
1073</DL>
1074</DD>
1075<DD><DL>
1076<DT><B>Parameters:</B><DD><CODE>iterable</CODE> - the iterable whose minimum element is to be determined
1077<DT><B>Throws:</B>
1078<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 <code>iterable</code> is empty
1079<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</A></CODE> - if the parameters are not <i>mutually
1080     comparable</i> under this ordering.</DL>
1081</DD>
1082</DL>
1083<HR>
1084
1085<A NAME="min(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object[])"><!-- --></A><A NAME="min(E, E, E, E...)"><!-- --></A><H3>
1086min</H3>
1087<PRE>
1088public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; E <B>min</B>(E&nbsp;a,
1089                           E&nbsp;b,
1090                           E&nbsp;c,
1091                           E...&nbsp;rest)</PRE>
1092<DL>
1093<DD>Returns the smallest of the specified values according to this ordering. If
1094 there are multiple smallest values, the first of those is returned.
1095<P>
1096<DD><DL>
1097</DL>
1098</DD>
1099<DD><DL>
1100<DT><B>Parameters:</B><DD><CODE>a</CODE> - value to compare, returned if less than or equal to the rest.<DD><CODE>b</CODE> - value to compare<DD><CODE>c</CODE> - value to compare<DD><CODE>rest</CODE> - values to compare
1101<DT><B>Throws:</B>
1102<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</A></CODE> - if the parameters are not <i>mutually
1103     comparable</i> under this ordering.</DL>
1104</DD>
1105</DL>
1106<HR>
1107
1108<A NAME="min(java.lang.Object,java.lang.Object)"><!-- --></A><A NAME="min(E, E)"><!-- --></A><H3>
1109min</H3>
1110<PRE>
1111public &lt;E extends <A HREF="../../../../com/google/common/collect/Ordering.html" title="type parameter in Ordering">T</A>&gt; E <B>min</B>(E&nbsp;a,
1112                           E&nbsp;b)</PRE>
1113<DL>
1114<DD>Returns the smaller of the two values according to this ordering. If the
1115 values compare as 0, the first is returned.
1116
1117 <p><b>Implementation note:</b> this method is invoked by the default
1118 implementations of the other <code>min</code> overloads, so overriding it will
1119 affect their behavior.
1120<P>
1121<DD><DL>
1122</DL>
1123</DD>
1124<DD><DL>
1125<DT><B>Parameters:</B><DD><CODE>a</CODE> - value to compare, returned if less than or equal to b.<DD><CODE>b</CODE> - value to compare.
1126<DT><B>Throws:</B>
1127<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</A></CODE> - if the parameters are not <i>mutually
1128     comparable</i> under this ordering.</DL>
1129</DD>
1130</DL>
1131<!-- ========= END OF CLASS DATA ========= -->
1132<HR>
1133
1134
1135<!-- ======= START OF BOTTOM NAVBAR ====== -->
1136<A NAME="navbar_bottom"><!-- --></A>
1137<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
1138<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
1139<TR>
1140<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
1141<A NAME="navbar_bottom_firstrow"><!-- --></A>
1142<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
1143  <TR ALIGN="center" VALIGN="top">
1144  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
1145  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
1146  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
1147  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Ordering.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
1148  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
1149  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
1150  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
1151  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
1152  </TR>
1153</TABLE>
1154</TD>
1155<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
1156</EM>
1157</TD>
1158</TR>
1159
1160<TR>
1161<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1162&nbsp;<A HREF="../../../../com/google/common/collect/ObjectArrays.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
1163&nbsp;<A HREF="../../../../com/google/common/collect/PeekingIterator.html" title="interface in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
1164<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1165  <A HREF="../../../../index.html?com/google/common/collect/Ordering.html" target="_top"><B>FRAMES</B></A>  &nbsp;
1166&nbsp;<A HREF="Ordering.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
1167&nbsp;<SCRIPT type="text/javascript">
1168  <!--
1169  if(window==top) {
1170    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
1171  }
1172  //-->
1173</SCRIPT>
1174<NOSCRIPT>
1175  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
1176</NOSCRIPT>
1177
1178
1179</FONT></TD>
1180</TR>
1181<TR>
1182<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1183  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1184<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1185DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1186</TR>
1187</TABLE>
1188<A NAME="skip-navbar_bottom"></A>
1189<!-- ======== END OF BOTTOM NAVBAR ======= -->
1190
1191<HR>
1192
1193</BODY>
1194</HTML>
1195