enum DimensionComparator extends java.lang.Enum<DimensionComparator> implements java.util.Comparator<Dimension>
Dimension
.Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
private static int |
NON_NULLS
Used to indicate the two objects being compared are both non-nulls.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Dimension dim1,
Dimension dim2) |
private int |
nullCompare(java.lang.Object first,
java.lang.Object second)
Partially compares the two given objects for order, handling null as
necessary.
|
private int |
nullSafeCompare(java.lang.String first,
java.lang.String second)
Compares the two given strings for order, handling null as necessary.
|
static DimensionComparator |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static DimensionComparator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DimensionComparator INSTANCE
private static final int NON_NULLS
public static DimensionComparator[] values()
for (DimensionComparator c : DimensionComparator.values()) System.out.println(c);
public static DimensionComparator valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int compare(Dimension dim1, Dimension dim2)
compare
in interface java.util.Comparator<Dimension>
private int nullSafeCompare(java.lang.String first, java.lang.String second)
private int nullCompare(java.lang.Object first, java.lang.Object second)
NON_NULLS
is returned which means both
objects are non-null but not identical.