public class OptionsComparator
extends java.lang.Object
implements java.util.Comparator
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
delimiter
The delimiter that marks the beginning of the label.
|
| Constructor and Description |
|---|
OptionsComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.String o1,
java.lang.String o2)
Uses the default
compareTo method defined by the Comparable interface
of String to compare labels returned from calls to getLabel. |
protected java.lang.String |
getLabel(java.lang.String s)
Get the label from the supplied String.
|
public static final java.lang.String delimiter
The delimiter that marks the beginning of the label.
public int compare(java.lang.String o1,
java.lang.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 java.util.Comparatorprotected java.lang.String getLabel(java.lang.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 - 2010 Alfresco Software, Inc. All Rights Reserved.