net.sf.staccatocommons.lang.internal
Class NaturalComparator<A extends Comparable<A>>

java.lang.Object
  extended by net.sf.staccatocommons.lang.internal.NaturalComparator<A>
All Implemented Interfaces:
Serializable, Comparator<A>

public class NaturalComparator<A extends Comparable<A>>
extends Object
implements Comparator<A>, Serializable

Author:
flbulgarelli
See Also:
Serialized Form

Constructor Summary
NaturalComparator()
           
 
Method Summary
 int compare(A o1, A o2)
           
static
<A extends Comparable<A>>
Comparator<A>
natural()
          Answers a NaturalComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

NaturalComparator

public NaturalComparator()
Method Detail

compare

public int compare(A o1,
                   A o2)
Specified by:
compare in interface Comparator<A extends Comparable<A>>

natural

@Constant
public static <A extends Comparable<A>> Comparator<A> natural()
Answers a NaturalComparator

Type Parameters:
A -
Returns:
a natural comparator


Copyright © 2010-2012 Staccatocommons. All Rights Reserved.