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.
    See Also:
    Wikipedia: Allen's Interval Algebra
    • 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