Package com.pnfsoftware.jeb.util.format
Class AlphanumCharComparator
java.lang.Object
com.pnfsoftware.jeb.util.format.AlphanumCharComparator
- All Implemented Interfaces:
Comparator<Character>
A character comparator that sort strings using a specific order.
The sorting order is as follows:
- Special characters
- Number characters
- Alphabetic characters (note: accented character are sorted after the non-accented representation)
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a case-sensitive comparator.AlphanumCharComparator(boolean caseSensitive) Create a comparator. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
AlphanumCharComparator
public AlphanumCharComparator()Create a case-sensitive comparator. -
AlphanumCharComparator
public AlphanumCharComparator(boolean caseSensitive) Create a comparator.- Parameters:
caseSensitive- if true, upper-case letters will be sorted before lower-case
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<Character>
-