public class StringLengthComparator extends Object implements Comparator<String>, Serializable
Constructor and Description |
---|
StringLengthComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(String arg0,
String arg1)
This function actually compares String lengths
so that they are sorted from longest to shortest
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public int compare(String arg0, String arg1)
compare
in interface Comparator<String>
arg0
- First stringarg1
- Second stringCopyright © 2005-2024 LSC project. All Rights Reserved.