org.opengts.util
Class ListTools.StringComparator<T>

java.lang.Object
  extended by org.opengts.util.ListTools.StringComparator<T>
All Implemented Interfaces:
java.util.Comparator<T>
Direct Known Subclasses:
ListTools.NameComparator
Enclosing class:
ListTools

public static class ListTools.StringComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>

StringComparator class for sorting objects based on their 'toString()' value


Constructor Summary
ListTools.StringComparator()
           
ListTools.StringComparator(boolean ascending)
           
ListTools.StringComparator(boolean ascending, boolean ignoreCase)
           
 
Method Summary
 int compare(T o1, T o2)
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getDefaultString(java.lang.Object obj)
           
 java.lang.String getObjectString(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListTools.StringComparator

public ListTools.StringComparator()

ListTools.StringComparator

public ListTools.StringComparator(boolean ascending)

ListTools.StringComparator

public ListTools.StringComparator(boolean ascending,
                                  boolean ignoreCase)
Method Detail

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface java.util.Comparator<T>

getObjectString

public java.lang.String getObjectString(java.lang.Object obj)

getDefaultString

public java.lang.String getDefaultString(java.lang.Object obj)

equals

public boolean equals(java.lang.Object other)
Specified by:
equals in interface java.util.Comparator<T>
Overrides:
equals in class java.lang.Object