- java.lang.Object
-
- java.lang.Enum<PathSortStrategy>
-
- org.refcodes.struct.PathSortStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<PathSortStrategy>
public enum PathSortStrategy extends Enum<PathSortStrategy>
ThePathSortStrategy
defines strategies to use when sorting e.g. when using aPathComparator
or the methodPathMap.sortedKeys(PathSortStrategy)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALPHABETIC
Sort alphabetically, differentiating between upper case and lower case, e.g. "10" will be sorted before "2".ALPHABETIC_IGNORE_CASE
Sort alphabetically, not differentiating between upper case and lower case, e.g. "10" will be sorted before "2".ALPHANUMERIC
Sort alphabetically, differentiating between upper case and lower case and considering any path elements representing an integral number, e.gALPHANUMERIC_IGNORE_CASE
Sort alphabetically, not differentiating between upper case and lower case and considering any path elements representing an integral number, e.g. "10" will be sorted below "2".DEFAULT
Default sort strategy beingALPHANUMERIC_IGNORE_CASE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAlphanumeric()
Determines whether to sort alphabetically and considering any path elements representing an integral number, e.g. "10" will be sorted below "2".boolean
isIgnoreCase()
Determines whether to sort by not differentiating between upper case and lower case.static PathSortStrategy
valueOf(String name)
Returns the enum constant of this type with the specified name.static PathSortStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final PathSortStrategy DEFAULT
Default sort strategy beingALPHANUMERIC_IGNORE_CASE
-
ALPHABETIC
public static final PathSortStrategy ALPHABETIC
Sort alphabetically, differentiating between upper case and lower case, e.g. "10" will be sorted before "2".
-
ALPHABETIC_IGNORE_CASE
public static final PathSortStrategy ALPHABETIC_IGNORE_CASE
Sort alphabetically, not differentiating between upper case and lower case, e.g. "10" will be sorted before "2".
-
ALPHANUMERIC
public static final PathSortStrategy ALPHANUMERIC
Sort alphabetically, differentiating between upper case and lower case and considering any path elements representing an integral number, e.g. "10" will be sorted below "2".
-
ALPHANUMERIC_IGNORE_CASE
public static final PathSortStrategy ALPHANUMERIC_IGNORE_CASE
Sort alphabetically, not differentiating between upper case and lower case and considering any path elements representing an integral number, e.g. "10" will be sorted below "2".
-
-
Method Detail
-
values
public static PathSortStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PathSortStrategy c : PathSortStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PathSortStrategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isAlphanumeric
public boolean isAlphanumeric()
Determines whether to sort alphabetically and considering any path elements representing an integral number, e.g. "10" will be sorted below "2".- Returns:
- True in case to sort alphanumerically.
-
isIgnoreCase
public boolean isIgnoreCase()
Determines whether to sort by not differentiating between upper case and lower case.- Returns:
- True when not differentiating between upper case and lower case.
-
-