net.ontopia.utils
Class StringifierComparator<T>

java.lang.Object
  extended by net.ontopia.utils.StringifierComparator<T>
All Implemented Interfaces:
Comparator<T>

public class StringifierComparator<T>
extends Object
implements Comparator<T>

INTERNAL: Comparator that stringifies the arguments and compares them using another comparator. DefaultStringifier is the default stringifier.


Field Summary
protected  Comparator<? super T> comparator
           
protected  StringifierIF<T> stringifier
           
 
Constructor Summary
StringifierComparator()
           
StringifierComparator(StringifierIF<T> stringifier)
           
StringifierComparator(StringifierIF<T> stringifier, Comparator<? super T> comparator)
           
 
Method Summary
 int compare(T obj1, T obj2)
           
 Comparator<? super T> getComparator()
          Gets the comparator which is to be used.
 void setComparator(Comparator<? super T> comparator)
          Sets the comparator which is to be used.
 
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

comparator

protected Comparator<? super T> comparator

stringifier

protected StringifierIF<T> stringifier
Constructor Detail

StringifierComparator

public StringifierComparator()

StringifierComparator

public StringifierComparator(StringifierIF<T> stringifier)

StringifierComparator

public StringifierComparator(StringifierIF<T> stringifier,
                             Comparator<? super T> comparator)
Method Detail

getComparator

public Comparator<? super T> getComparator()
Gets the comparator which is to be used.


setComparator

public void setComparator(Comparator<? super T> comparator)
Sets the comparator which is to be used.


compare

public int compare(T obj1,
                   T obj2)
Specified by:
compare in interface Comparator<T>


Copyright © 2000-2012 Ontopia.