org.lsc.utils
Class StringLengthComparator

java.lang.Object
  extended by org.lsc.utils.StringLengthComparator
All Implemented Interfaces:
Serializable, Comparator<String>

public class StringLengthComparator
extends Object
implements Comparator<String>, Serializable

See Also:
Serialized Form

Constructor Summary
StringLengthComparator()
           
 
Method Summary
 int compare(String arg0, String arg1)
          This function actually compares String lengths so that they are sorted from longest to shortest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

StringLengthComparator

public StringLengthComparator()
Method Detail

compare

public int compare(String arg0,
                   String arg1)
This function actually compares String lengths so that they are sorted from longest to shortest

Specified by:
compare in interface Comparator<String>
Parameters:
arg0 - First string
arg1 - Second string
Returns:
int To order strings by length


Copyright © 2005-2010 LSC project. All Rights Reserved.