public enum EndpointTypeComparators extends Enum<EndpointTypeComparators> implements EndpointTypeComparator
EndpointTypeComparator
.Enum Constant and Description |
---|
CANONICAL
Default comparator that compares end point types in the following order
)[]( . |
CANONICAL_INVERTED
Comparator that compares end point types in the opposite order
CANONICAL , that is (][) . |
END_START
Comparator that sort end points before start points, that is
)][( . |
START_END
Comparator that sort start points before end points, that is
[()] . |
UNORDERED
Comparator that treats all end point types as equal.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(EndpointDirection lhsDirection,
com.google.common.collect.BoundType lhsBoundType,
EndpointDirection rhsDirection,
com.google.common.collect.BoundType rhsBoundType)
Compares two end points.
|
static EndpointTypeComparator |
createComparator(EndpointTypes... order)
Creates a new end point comparator that compares end points in the given order.
|
static EndpointTypeComparators |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EndpointTypeComparators[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
compare
public static final EndpointTypeComparators CANONICAL
)[](
.public static final EndpointTypeComparators CANONICAL_INVERTED
CANONICAL
, that is (][)
.public static final EndpointTypeComparators END_START
)][(
.public static final EndpointTypeComparators START_END
[()]
.public static final EndpointTypeComparators UNORDERED
public static EndpointTypeComparators[] values()
for (EndpointTypeComparators c : EndpointTypeComparators.values()) System.out.println(c);
public static EndpointTypeComparators valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int compare(EndpointDirection lhsDirection, com.google.common.collect.BoundType lhsBoundType, EndpointDirection rhsDirection, com.google.common.collect.BoundType rhsBoundType)
EndpointTypeComparator
compare
in interface EndpointTypeComparator
lhsDirection
- The direction of the first end point.lhsBoundType
- The bound type of the first end point.rhsDirection
- The direction of the second end point.rhsBoundType
- The bound type of the second end point.-1
if the first end point is less than the second end point, 0
if both end points are
equals, or +1
otherwise.public static EndpointTypeComparator createComparator(EndpointTypes... order)
order
- Target order of the end points.Copyright © 2020 XIMA MEDIA GmbH. All rights reserved.