net.ontopia.utils
Class LexicalComparator

java.lang.Object
  extended by net.ontopia.utils.LexicalComparator
All Implemented Interfaces:
java.util.Comparator

public class LexicalComparator
extends java.lang.Object
implements java.util.Comparator

INTERNAL: Comparator that performs a lexical comparison. It calls the toString method on the objects and compares the result. It can be configured to be case insensitive. It is case sensitive by default.


Field Summary
static LexicalComparator CASE_INSENSITIVE
           
static LexicalComparator CASE_SENSITIVE
           
protected  java.text.Collator collator
           
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
           
 
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

CASE_SENSITIVE

public static final LexicalComparator CASE_SENSITIVE

CASE_INSENSITIVE

public static final LexicalComparator CASE_INSENSITIVE

collator

protected java.text.Collator collator
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
Specified by:
compare in interface java.util.Comparator


Copyright © 2000-2012 Ontopia.