public class OptionsComparator extends Object implements Comparator<String>
| Modifier and Type | Field and Description |
|---|---|
static String |
delimiter
The delimiter that marks the beginning of the label.
|
| Constructor and Description |
|---|
OptionsComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(String o1,
String o2)
Uses the default
compareTo method defined by the Comparable interface
of String to compare labels returned from calls to getLabel. |
protected String |
getLabel(String s)
Get the label from the supplied String.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalspublic static final String delimiter
The delimiter that marks the beginning of the label.
public int compare(String o1, String o2)
Uses the default compareTo method defined by the Comparable interface
of String to compare labels returned from calls to getLabel.
compare in interface Comparator<String>protected String getLabel(String s)
Get the label from the supplied String. The label begins after the delimiter. The label is used as the basis for a natural sort. It is converted into lower case as a natural sort will place ALL upper-case characters before lower-case ones. If the delimiter is not found then the supplied string is returned.
s - The String to find the label within.Copyright © 2005–2014 Alfresco Software. All rights reserved.