com.fasterxml.sort.util
Class NaturalComparator<T extends Comparable<T>>

java.lang.Object
  extended by com.fasterxml.sort.util.NaturalComparator<T>
All Implemented Interfaces:
Comparator<T>

public class NaturalComparator<T extends Comparable<T>>
extends Object
implements Comparator<T>

Simple Comparator implementation that can be used when items to compare have "natural" sorting order that can be used via Comparable interface.


Constructor Summary
NaturalComparator()
           
 
Method Summary
 int compare(T arg0, T arg1)
           
 
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(T arg0,
                   T arg1)
Specified by:
compare in interface Comparator<T extends Comparable<T>>


Copyright © 2011. All Rights Reserved.