Package de.xima.fc.utils.range
Enum EndpointTypes
- java.lang.Object
-
- java.lang.Enum<EndpointTypes>
-
- de.xima.fc.utils.range.EndpointTypes
-
- All Implemented Interfaces:
EndpointType
,Serializable
,Comparable<EndpointTypes>
public enum EndpointTypes extends Enum<EndpointTypes> implements EndpointType
An enumeration with implementations of all possibleEndpointType
s.- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LOWER_CLOSED
Closed lower end of an interval ([
).LOWER_OPEN
Open lower end of an interval ((
).UPPER_CLOSED
Closed upper end of an interval (]
).UPPER_OPEN
Open upper end of an interval ()
).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EndpointTypeComparator
createComparator(EndpointTypes... order)
Creates a new end point comparator that compares end points in the given order.com.google.common.collect.BoundType
getBoundType()
EndpointDirection
getDirection()
static EndpointTypes
valueOf(String name)
Returns the enum constant of this type with the specified name.static EndpointTypes[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOWER_CLOSED
public static final EndpointTypes LOWER_CLOSED
Closed lower end of an interval ([
).
-
LOWER_OPEN
public static final EndpointTypes LOWER_OPEN
Open lower end of an interval ((
).
-
UPPER_CLOSED
public static final EndpointTypes UPPER_CLOSED
Closed upper end of an interval (]
).
-
UPPER_OPEN
public static final EndpointTypes UPPER_OPEN
Open upper end of an interval ()
).
-
-
Method Detail
-
values
public static EndpointTypes[] 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 (EndpointTypes c : EndpointTypes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EndpointTypes 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
-
getBoundType
public com.google.common.collect.BoundType getBoundType()
- Specified by:
getBoundType
in interfaceEndpointType
- Returns:
- Whether the interval end is open or closed.
-
getDirection
public EndpointDirection getDirection()
- Specified by:
getDirection
in interfaceEndpointType
- Returns:
- Whether the interval end is a lower or upper end.
-
createComparator
public static EndpointTypeComparator createComparator(EndpointTypes... order)
Creates a new end point comparator that compares end points in the given order.- Parameters:
order
- Target order of the end points.- Returns:
- A comparator for end points that compares in the given order.
-
-