Package net.ontopia.utils
Class LexicalComparator
- java.lang.Object
-
- net.ontopia.utils.LexicalComparator
-
- All Implemented Interfaces:
Comparator<Object>
public class LexicalComparator extends Object implements Comparator<Object>
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
Fields Modifier and Type Field Description static LexicalComparator
CASE_INSENSITIVE
static LexicalComparator
CASE_SENSITIVE
protected Collator
collator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Object obj1, 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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
CASE_SENSITIVE
public static final LexicalComparator CASE_SENSITIVE
-
CASE_INSENSITIVE
public static final LexicalComparator CASE_INSENSITIVE
-
collator
protected Collator collator
-
-
Method Detail
-
compare
public int compare(Object obj1, Object obj2)
- Specified by:
compare
in interfaceComparator<Object>
-
-