Enum EndpointTypeComparators

    • Enum Constant Detail

      • CANONICAL

        public static final EndpointTypeComparators CANONICAL
        Default comparator that compares end point types in the following order )[](.
      • CANONICAL_INVERTED

        public static final EndpointTypeComparators CANONICAL_INVERTED
        Comparator that compares end point types in the opposite order CANONICAL, that is (][).
      • END_START

        public static final EndpointTypeComparators END_START
        Comparator that sort end points before start points, that is )][(.
      • START_END

        public static final EndpointTypeComparators START_END
        Comparator that sort start points before end points, that is [()].
      • UNORDERED

        public static final EndpointTypeComparators UNORDERED
        Comparator that treats all end point types as equal.
    • Method Detail

      • values

        public static EndpointTypeComparators[] 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 (EndpointTypeComparators c : EndpointTypeComparators.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EndpointTypeComparators 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
      • compare

        public int compare​(EndpointDirection lhsDirection,
                           com.google.common.collect.BoundType lhsBoundType,
                           EndpointDirection rhsDirection,
                           com.google.common.collect.BoundType rhsBoundType)
        Description copied from interface: EndpointTypeComparator
        Compares two end points.
        Specified by:
        compare in interface EndpointTypeComparator
        Parameters:
        lhsDirection - The direction of the first end point.
        lhsBoundType - The bound type of the first end point.
        rhsDirection - The direction of the second end point.
        rhsBoundType - The bound type of the second end point.
        Returns:
        -1 if the first end point is less than the second end point, 0 if both end points are equals, or +1 otherwise.
      • 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.