Class StringLengthComparator
- java.lang.Object
-
- com.sun.identity.console.base.model.StringLengthComparator
-
- All Implemented Interfaces:
Comparator
public class StringLengthComparator extends Object implements Comparator
This compares the length of two string.
-
-
Constructor Summary
Constructors Constructor Description StringLengthComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Object s1, Object s2)Performs string comparison on string length.-
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
-
-
-
-
Method Detail
-
compare
public int compare(Object s1, Object s2)
Performs string comparison on string length.- Specified by:
comparein interfaceComparator- Parameters:
s1- first string.s2- second string.- Returns:
- 0 if both strings have same length; less than 0 if
length of
s1is longer than length ofs2; greater than 0 if length ofs1is shorted than length ofs2.
-
-