com.webmethods.caf.faces.data.object
Class DefaultComparator

java.lang.Object
  extended by com.webmethods.caf.faces.data.object.DefaultComparator
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
NodePropertyComparator

public class DefaultComparator
extends Object
implements Comparator

Compares two objects using a locale-specific collator for strings. Because this object caches the current user's locale, it cannot be shared among user sessions.


Field Summary
protected  boolean m_ascending
           
protected  Collator m_collator
           
 
Constructor Summary
DefaultComparator()
          New comparator, using the current user's locale.
DefaultComparator(boolean ascending)
          New comparator, using the current user's locale.
 
Method Summary
 int compare(Object o1, Object o2)
           
 
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

m_ascending

protected boolean m_ascending

m_collator

protected Collator m_collator
Constructor Detail

DefaultComparator

public DefaultComparator()
New comparator, using the current user's locale.


DefaultComparator

public DefaultComparator(boolean ascending)
New comparator, using the current user's locale.

Method Detail

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator