org.zkoss.lang
Class Comparables

java.lang.Object
  extended by org.zkoss.lang.Comparables

public final class Comparables
extends Object

Utilities regarding Comparable type objects.

Author:
henrichen

Constructor Summary
Comparables()
           
 
Method Summary
static Comparable max(Comparable a, Comparable b)
          Given two comparables, return the maximum of the two.
static Comparable min(Comparable a, Comparable b)
          Given two comparables, return the minimum of the two.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Comparables

public Comparables()
Method Detail

min

public static final Comparable min(Comparable a,
                                   Comparable b)
Given two comparables, return the minimum of the two. Note that the two Comparable must be with compatible type, or a ClassCastException might be thrown.


max

public static final Comparable max(Comparable a,
                                   Comparable b)
Given two comparables, return the maximum of the two. Note that the two Comparable must be with compatible type, or a ClassCastException might be thrown.



Copyright © 2015. All rights reserved.