org.salespointframework.core
Class NaturalComparator<T extends java.lang.Comparable<java.lang.Object>>

java.lang.Object
  extended by org.salespointframework.core.NaturalComparator<T>
All Implemented Interfaces:
java.util.Comparator<T>

public final class NaturalComparator<T extends java.lang.Comparable<java.lang.Object>>
extends java.lang.Object
implements java.util.Comparator<T>

A comparator that compares Objects using their natural order.

This is a convenience facade for the Comparable interface.

Since:
v2.0
Version:
2.0 27/07/1999
Author:
Steffen Zschaler

Field Summary
private  boolean categoryAware
           
 
Constructor Summary
NaturalComparator()
           
NaturalComparator(boolean categoryAware)
           
 
Method Summary
 int compare(T o1, T o2)
          Compare the two objects assuming they are both comparable.
 
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
 

Field Detail

categoryAware

private boolean categoryAware
Constructor Detail

NaturalComparator

public NaturalComparator()

NaturalComparator

public NaturalComparator(boolean categoryAware)
Method Detail

compare

public final int compare(T o1,
                         T o2)
Compare the two objects assuming they are both comparable.

Specified by:
compare in interface java.util.Comparator<T extends java.lang.Comparable<java.lang.Object>>