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 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 Details

    • 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 Details

    • values

      public static EndpointAccessorsIdentity[] 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

      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 name
      NullPointerException - if the argument is null
    • getBoundType

      public com.google.common.collect.BoundType getBoundType(Comparable item)
      Specified by:
      getBoundType in interface EndpointAccessor<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 interface EndpointAccessor<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 interface EndpointAccessor<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 interface EndpointAccessor<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 the Range.
      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 the Range.
      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 the Range.
      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 the Range.
      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 the Range.
      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 the Range.
      Returns:
      An accessor for the open, upper endpoint of a range. Just returns UPPER_ENDPOINT_OPEN cast to the correct type.