Package de.xima.fc.utils.range
Enum EndpointAccessorsIdentity
- All Implemented Interfaces:
EndpointAccessor<Comparable,
,Comparable> Serializable
,Comparable<EndpointAccessorsIdentity>
public enum EndpointAccessorsIdentity
extends Enum<EndpointAccessorsIdentity>
implements EndpointAccessor<Comparable,Comparable>
An enumeration containing instances of
EndpointAccessor
, for Range.lowerEndpoint()
s or
Range.upperEndpoint()
. You should use an EndpointDescriptor
instead if possible. For example:
final Range<Integer> range = RangeUtils.createRange( // 1, // EndpointAccessorsIdentity.lowerEndpointClosed(), // null, // EndpointAccessorsIdentity.positiveInfinity() // );
- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAccessor for the closed, lower end point of a range.Accessor for the open, lower end point of a range.Accessor for the negative infinity (lower) end point of a half-open range.Accessor for the positive infinity (upper) end point of a half-open range.Accessor for the closed, upper end point of a range.Accessor for the open, upper end point of a range. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.BoundType
getBoundType
(Comparable item) getDirection
(Comparable item) getPoint
(Comparable item) boolean
hasBound
(Comparable item) static <C extends Comparable>
EndpointAccessor<C,C> static <C extends Comparable>
EndpointAccessor<C,C> static <T,
C extends Comparable>
EndpointAccessor<T,C> static <T,
C extends Comparable>
EndpointAccessor<T,C> static <C extends Comparable>
EndpointAccessor<C,C> static <C extends Comparable>
EndpointAccessor<C,C> static EndpointAccessorsIdentity
Returns the enum constant of this type with the specified name.static EndpointAccessorsIdentity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface de.xima.fc.utils.range.EndpointAccessor
compareByEndpoint, compareByEndpoint, createByEndpointComparator, createByEndpointComparator, mapping, toDescriptor, toEndpoint
-
Enum Constant Details
-
LOWER_ENDPOINT_CLOSED
Accessor for the closed, lower end point of a range. -
LOWER_ENDPOINT_OPEN
Accessor for the open, lower end point of a range. -
NEGATIVE_INFINITY
Accessor for the negative infinity (lower) end point of a half-open range. -
POSITIVE_INFINITY
Accessor for the positive infinity (upper) end point of a half-open range. -
UPPER_ENDPOINT_CLOSED
Accessor for the closed, upper end point of a range. -
UPPER_ENDPOINT_OPEN
Accessor for the open, upper end point of a range.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
- Specified by:
getBoundType
in interfaceEndpointAccessor<Comparable,
Comparable> - Parameters:
item
- An item with an endpoint to check.- Returns:
- Whether the endpoint describes by the given item is closed or open.
-
getDirection
- Specified by:
getDirection
in interfaceEndpointAccessor<Comparable,
Comparable> - Parameters:
item
- An item with an endpoint to check.- Returns:
- Whether the end point described by the given item is a lower or upper end point.
-
getPoint
- Specified by:
getPoint
in interfaceEndpointAccessor<Comparable,
Comparable> - Parameters:
item
- An item with an endpoint to process.- Returns:
- The endpoint described by the given item.
-
hasBound
- Specified by:
hasBound
in interfaceEndpointAccessor<Comparable,
Comparable> - Parameters:
item
- An item with an endpoint to check.- Returns:
- Whether the range defined by the item has a bound (or describes positive or negative infinity).
-
lowerEndpointClosed
- Type Parameters:
C
- Type of the end point of theRange
.- Returns:
- An accessor for the closed, lower endpoint of a range. Just returns
LOWER_ENDPOINT_CLOSED
cast to the correct type.
-
lowerEndpointOpen
- Type Parameters:
C
- Type of the end point of theRange
.- Returns:
- An accessor for the open, lower endpoint of a range. Just returns
LOWER_ENDPOINT_OPEN
cast to the correct type.
-
negativeInfinity
- Type Parameters:
T
- Type of the object holding the endpoint. Can be anything as the end point is never actually accessed.C
- Type of the end point of theRange
.- Returns:
- Accessor for the negative infinity (lower) endpoint of a half-open range. Just returns
NEGATIVE_INFINITY
cast to the correct type.
-
positiveInfinity
- Type Parameters:
T
- Type of the object holding the endpoint. Can be anything as the end point is never actually accessed.C
- Type of the end point of theRange
.- Returns:
- Accessor for the positive infinity (upper) endpoint of a half-open range. Just returns
POSITIVE_INFINITY
cast to the correct type.
-
upperEndpointClosed
- Type Parameters:
C
- Type of the end point of theRange
.- Returns:
- An accessor for the closed, upper endpoint of a range. Just returns
UPPER_ENDPOINT_CLOSED
cast to the correct type.
-
upperEndpointOpen
- Type Parameters:
C
- Type of the end point of theRange
.- Returns:
- An accessor for the open, upper endpoint of a range. Just returns
UPPER_ENDPOINT_OPEN
cast to the correct type.
-