Package net.sf.basedb.util
Class StringLengthComparator
java.lang.Object
net.sf.basedb.util.StringLengthComparator
- All Implemented Interfaces:
Comparator<String>
A comparator implementation for strings that sorts them according
to their length. Shortest strings are sorted first. Strings of equal
length are sorted in their natural order.
- Since:
- 2.16.2
- Author:
- Nicklas
- Last modified
- $Date: 2011-02-18 13:23:23 +0100 (fr, 18 feb 2011) $
-
Constructor Summary
-
Method Summary
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
-
Constructor Details
-
StringLengthComparator
public StringLengthComparator()Create a new string length comparator instance.
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<String>
-