Interface EndpointAccessor<T,​C extends Comparable>

    • Method Detail

      • compareByEndpoint

        default int compareByEndpoint​(T lhs,
                                      T rhs)
        Compares the given items by the end points they hold. The default comparator EndpointTypeComparators.UNORDERED for endpoints is used.
        Parameters:
        lhs - First item with an end point to compare.
        rhs - Second item with an end point to compare.
        Returns:
        -1 if the first item is less than the second, 0 if both are equal, or +1 otherwise.
      • compareByEndpoint

        default int compareByEndpoint​(T lhs,
                                      T rhs,
                                      EndpointTypeComparator comparator)
        Compares the given items by the end points they hold.
        Parameters:
        lhs - First item with an end point to compare.
        rhs - Second item with an end point to compare.
        comparator - The comparator to use for comparing the end points.
        Returns:
        -1 if the first item is less than the second, 0 if both are equal, or +1 otherwise.
      • createByEndpointComparator

        default Comparator<T> createByEndpointComparator()
        Returns:
        A comparator for the items holding an endpoint, that compares the items the endpoint they hold. The default comparator EndpointTypeComparators.UNORDERED for endpoints is used.
      • createByEndpointComparator

        default Comparator<T> createByEndpointComparator​(EndpointTypeComparator comparator)
        Parameters:
        comparator - Comparator to use for comparing the endpoints.
        Returns:
        A comparator for the items holding an endpoint, that compares the items the endpoint they hold.
      • getBoundType

        com.google.common.collect.BoundType getBoundType​(T item)
        Parameters:
        item - An item with an endpoint to check.
        Returns:
        Whether the endpoint describes by the given item is closed or open.
      • getDirection

        EndpointDirection getDirection​(T item)
        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

        C getPoint​(T item)
        Parameters:
        item - An item with an endpoint to process.
        Returns:
        The endpoint described by the given item.
      • hasBound

        boolean hasBound​(T item)
        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).
      • toDescriptor

        default EndpointDescriptor toDescriptor​(T item)
        Creates an endpoint descriptor describing the endpoint of held by the given item.
        Parameters:
        item - An item holding an endpoint.
        Returns:
        An endpoint descriptor for the endpoint of the given item.
      • toEndpoint

        default Endpoint<C> toEndpoint​(T item)
        Parameters:
        item - An item holding an endpoint.
        Returns:
        The endpoint held by the given item.