# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.interval

## Enum IntervalRelation

• All Implemented Interfaces:
Serializable, Comparable<IntervalRelation>

public enum IntervalRelation
extends Enum<IntervalRelation>
Allen's Interval Algebra is a calculus for temporal reasoning that was introduced by James F. Allen in 1983. The calculus defines possible relations between time intervals and provides a composition table that can be used as a basis for reasoning about temporal descriptions of events. This implementation has the 13 base relations that capture the possible relations between two intervals.
Wikipedia: Allen's Interval Algebra
• ### Enum Constant Summary

Enum Constants
Enum Constant and Description
AFTER
X takes place after Y.
BEFORE
X takes place before Y.
DURING
X during Y.
DURING_INVERSE
Y during X.
EQUAL
X is equal to Y.
FINISH
X finishes Y
FINISH_INVERSE
Y finishes X.
MEET
X meets Y.
MEET_INVERSE
Y meets X.
OVERLAP
X overlaps with Y.
OVERLAP_INVERSE
Y overlaps with X.
START
X starts Y.
START_INVERSE
Y starts X.
• ### Method Summary

All Methods
Modifier and Type Method and Description
abstract <T extends Comparable<? super T>>boolean isBetween(Interval<T> X, Interval<T> Y)
Check if X and Y satisfy a certain relation.
static IntervalRelation valueOf(String name)
Returns the enum constant of this type with the specified name.
static IntervalRelation[] 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 class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait
• ### Enum Constant Detail

• #### BEFORE

public static final IntervalRelation BEFORE
X takes place before Y.
• #### AFTER

public static final IntervalRelation AFTER
X takes place after Y.
• #### MEET

public static final IntervalRelation MEET
X meets Y.
• #### MEET_INVERSE

public static final IntervalRelation MEET_INVERSE
Y meets X.
• #### OVERLAP

public static final IntervalRelation OVERLAP
X overlaps with Y.
• #### OVERLAP_INVERSE

public static final IntervalRelation OVERLAP_INVERSE
Y overlaps with X.
• #### START

public static final IntervalRelation START
X starts Y.
• #### START_INVERSE

public static final IntervalRelation START_INVERSE
Y starts X.
• #### DURING

public static final IntervalRelation DURING
X during Y.
• #### DURING_INVERSE

public static final IntervalRelation DURING_INVERSE
Y during X.
• #### FINISH

public static final IntervalRelation FINISH
X finishes Y
• #### FINISH_INVERSE

public static final IntervalRelation FINISH_INVERSE
Y finishes X.
• #### EQUAL

public static final IntervalRelation EQUAL
X is equal to Y.
• ### Method Detail

• #### values

public static IntervalRelation[] 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 (IntervalRelation c : IntervalRelation.values())
System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared
• #### valueOf

public static IntervalRelation 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
• #### isBetween

public abstract <T extends Comparable<? super T>> boolean isBetween(Interval<T> X,
Interval<T> Y)
Check if X and Y satisfy a certain relation.
Type Parameters:
T - a Comparable type
Parameters:
X - an interval
Y - an interval
Returns:
true is if X and Y satisfy the relation