Package de.xima.fc.utils.range
Enum EndpointAccessorsIdentity
- java.lang.Object
-
- java.lang.Enum<EndpointAccessorsIdentity>
-
- de.xima.fc.utils.range.EndpointAccessorsIdentity
-
- All Implemented Interfaces:
EndpointAccessor<Comparable,Comparable>
,Serializable
,Comparable<EndpointAccessorsIdentity>
public enum EndpointAccessorsIdentity extends Enum<EndpointAccessorsIdentity> implements EndpointAccessor<Comparable,Comparable>
An enumeration containing instances ofEndpointAccessor
, forRange.lowerEndpoint()
s orRange.upperEndpoint()
. You should use anEndpointDescriptor
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 Constants Enum Constant Description 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.BoundType
getBoundType(Comparable item)
EndpointDirection
getDirection(Comparable item)
Comparable
getPoint(Comparable item)
boolean
hasBound(Comparable item)
static <C extends Comparable>
EndpointAccessor<C,C>lowerEndpointClosed()
static <C extends Comparable>
EndpointAccessor<C,C>lowerEndpointOpen()
static <T,C extends Comparable>
EndpointAccessor<T,C>negativeInfinity()
static <T,C extends Comparable>
EndpointAccessor<T,C>positiveInfinity()
static <C extends Comparable>
EndpointAccessor<C,C>upperEndpointClosed()
static <C extends Comparable>
EndpointAccessor<C,C>upperEndpointOpen()
static EndpointAccessorsIdentity
valueOf(String name)
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 Detail
-
LOWER_ENDPOINT_CLOSED
public static final EndpointAccessorsIdentity LOWER_ENDPOINT_CLOSED
Accessor for the closed, lower end point of a range.
-
LOWER_ENDPOINT_OPEN
public static final EndpointAccessorsIdentity LOWER_ENDPOINT_OPEN
Accessor for the open, lower end point of a range.
-
NEGATIVE_INFINITY
public static final EndpointAccessorsIdentity NEGATIVE_INFINITY
Accessor for the negative infinity (lower) end point of a half-open range.
-
POSITIVE_INFINITY
public static final EndpointAccessorsIdentity POSITIVE_INFINITY
Accessor for the positive infinity (upper) end point of a half-open range.
-
UPPER_ENDPOINT_CLOSED
public static final EndpointAccessorsIdentity UPPER_ENDPOINT_CLOSED
Accessor for the closed, upper end point of a range.
-
UPPER_ENDPOINT_OPEN
public static final EndpointAccessorsIdentity UPPER_ENDPOINT_OPEN
Accessor for the open, upper end point of a range.
-
-
Method Detail
-
values
public static EndpointAccessorsIdentity[] 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 (EndpointAccessorsIdentity c : EndpointAccessorsIdentity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EndpointAccessorsIdentity 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(Comparable item)
- 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
public EndpointDirection getDirection(Comparable item)
- 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
public Comparable getPoint(Comparable item)
- 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
public boolean hasBound(Comparable item)
- 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
public static <C extends Comparable> EndpointAccessor<C,C> 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
public static <C extends Comparable> EndpointAccessor<C,C> 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
public static <T,C extends Comparable> EndpointAccessor<T,C> 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
public static <T,C extends Comparable> EndpointAccessor<T,C> 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
public static <C extends Comparable> EndpointAccessor<C,C> 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
public static <C extends Comparable> EndpointAccessor<C,C> 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.
-
-