scuffed-code/tools/unicodetools/com/ibm/text/utility/LengthFirstComparator.java
Mark Davis 1cd275c205 First check-in
X-SVN-Rev: 5636
2001-08-30 20:50:18 +00:00

13 lines
329 B
Java

package com.ibm.text.utility;
import java.util.*;
public final class LengthFirstComparator implements Comparator {
public int compare(Object a, Object b) {
String as = (String) a;
String bs = (String) b;
if (as.length() < bs.length()) return -1;
if (as.length() > bs.length()) return 1;
return as.compareTo(bs);
}
}