T - the numeric typepublic class RangeExtendedComparator<T extends Number & Comparable> extends Object
Range objects capable of discerning the 18 different possible
interval comparisons as described by:
Brian Hayes (2003) A lucid interval.Constants describing each of these possible comparisons are defined in the
American Scientist 91(6):484-488.Available at: http://www.cs.utep.edu/interval-comp/hayes.pdf
RangeComparator.Result class.
Normally, client code will not need to use the methods defined in this class
directly but will work through the Range class.
| Modifier and Type | Class and Description |
|---|---|
static class |
RangeExtendedComparator.Result
Constants defining the names, notation and descriptions for the 18 different
possible interval comparisons as described by:
Brian Hayes (2003) A lucid interval.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
EQ
Constant for "equal to".
|
static int |
GT
Constant for "greater than".
|
static int |
LT
Constant for "less than".
|
static int |
MAX_MAX
Index of
RangeExtendedComparator.Result element for the comparison of the max value
of the first Range with the max value of the second range. |
static int |
MAX_MIN
Index of
RangeExtendedComparator.Result element for the comparison of the max value
of the first Range with the min value of the second range. |
static int |
MIN_MAX
Index of
RangeExtendedComparator.Result element for the comparison of the min value
of the first Range with the max value of the second range. |
static int |
MIN_MIN
Index of
RangeExtendedComparator.Result element for the comparison of the min value
of the first Range with the min value of the second range. |
| Constructor and Description |
|---|
RangeExtendedComparator() |
| Modifier and Type | Method and Description |
|---|---|
RangeExtendedComparator.Result |
compare(Range<T> r1,
Range<T> r2)
Compares two Range objects and return the
RangeComparator.Result
that describes the relationship between them from the point of view of the first Range |
static boolean |
isIntersection(RangeExtendedComparator.Result r)
Tests if a Result value describes an intersection between two ranges.
|
public static final int LT
public static final int EQ
public static final int GT
public static final int MIN_MAX
RangeExtendedComparator.Result element for the comparison of the min value
of the first Range with the max value of the second range.public static final int MIN_MIN
RangeExtendedComparator.Result element for the comparison of the min value
of the first Range with the min value of the second range.public static final int MAX_MAX
RangeExtendedComparator.Result element for the comparison of the max value
of the first Range with the max value of the second range.public static final int MAX_MIN
RangeExtendedComparator.Result element for the comparison of the max value
of the first Range with the min value of the second range.public static boolean isIntersection(RangeExtendedComparator.Result r)
r - the Result valuepublic RangeExtendedComparator.Result compare(Range<T> r1, Range<T> r2)
RangeComparator.Result
that describes the relationship between them from the point of view of the first Ranger1 - the first Ranger2 - the second RangeRangeComparator.Result constantCopyright © 2009–2018. All rights reserved.