Enum Class AllenRelation

java.lang.Object
java.lang.Enum<AllenRelation>
com.darkcollective.relix.ast.AllenRelation
All Implemented Interfaces:
Serializable, Comparable<AllenRelation>, Constable

public enum AllenRelation extends Enum<AllenRelation>
Allen's interval algebra relations used in IntervalJoinNode.

Each constant describes the temporal relationship between a left interval [ℓ.start, ℓ.end) and a right interval [r.start, r.end), using half-open intervals.

The thirteen base relations of Allen's algebra form seven converse pairs (with EQUALS as its own converse): for every relation X there is a converse X_BY such that ℓ X r iff r X_BY ℓ. Stating the converse explicitly lets you keep the left and right inputs in their natural order rather than swapping them. Beyond the thirteen, INTERSECTS is a convenience superset (any shared time) that is not one of Allen's base relations.

Semantics. All thirteen base relations use strict endpoint bounds (Allen 1983), so they are mutually exclusive and jointly exhaustive — any pair of intervals stands in exactly one of them. Shared-boundary cases are named by their own relation (STARTS, FINISHES, EQUALS) rather than folded into DURING/CONTAINS. The only overlap is the convenience INTERSECTS, which by construction subsumes every relation that shares any time.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Left interval strictly contains the right (both endpoints interior; converse of DURING): ℓ.start < r.start ∧ r.end < ℓ.end.
    Left interval is strictly inside the right (both endpoints interior): r.start < ℓ.start ∧ ℓ.end < r.end.
    The intervals are identical: ℓ.start = r.start ∧ ℓ.end = r.end.
    Both intervals finish together and right starts later (converse of FINISHES): ℓ.end = r.end ∧ ℓ.start < r.start.
    Both intervals finish together and left starts later: ℓ.end = r.end ∧ r.start < ℓ.start.
    Intervals overlap in some time: ℓ.start < r.end ∧ r.start < ℓ.end (symmetric — left and right are interchangeable for this test).
    Left ends exactly where right begins (adjacent, no gap): ℓ.end = r.start.
    Left begins exactly where right ends (adjacent, no gap; converse of MEETS): ℓ.start = r.end.
    Right starts before left and ends within it (converse of OVERLAPS): r.start < ℓ.start ∧ r.end > ℓ.start ∧ r.end < ℓ.end.
    Left starts before right and ends within it: ℓ.start < r.start ∧ ℓ.end > r.start ∧ ℓ.end < r.end.
    Left begins after right ends (converse of PRECEDES): ℓ.start > r.end.
    Left ends before right begins: ℓ.end < r.start.
    Both intervals start together and right finishes first (converse of STARTS): ℓ.start = r.start ∧ r.end < ℓ.end.
    Both intervals start together and left finishes first: ℓ.start = r.start ∧ ℓ.end < r.end.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static AllenRelation[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • INTERSECTS

      public static final AllenRelation INTERSECTS
      Intervals overlap in some time: ℓ.start < r.end ∧ r.start < ℓ.end (symmetric — left and right are interchangeable for this test). A convenience superset; not one of Allen's thirteen base relations.
    • OVERLAPS

      public static final AllenRelation OVERLAPS
      Left starts before right and ends within it: ℓ.start < r.start ∧ ℓ.end > r.start ∧ ℓ.end < r.end. Converse of OVERLAPPED_BY.
    • OVERLAPPED_BY

      public static final AllenRelation OVERLAPPED_BY
      Right starts before left and ends within it (converse of OVERLAPS): r.start < ℓ.start ∧ r.end > ℓ.start ∧ r.end < ℓ.end.
    • DURING

      public static final AllenRelation DURING
      Left interval is strictly inside the right (both endpoints interior): r.start < ℓ.start ∧ ℓ.end < r.end. Converse of CONTAINS.
    • CONTAINS

      public static final AllenRelation CONTAINS
      Left interval strictly contains the right (both endpoints interior; converse of DURING): ℓ.start < r.start ∧ r.end < ℓ.end.
    • STARTS

      public static final AllenRelation STARTS
      Both intervals start together and left finishes first: ℓ.start = r.start ∧ ℓ.end < r.end. Converse of STARTED_BY.
    • STARTED_BY

      public static final AllenRelation STARTED_BY
      Both intervals start together and right finishes first (converse of STARTS): ℓ.start = r.start ∧ r.end < ℓ.end.
    • FINISHES

      public static final AllenRelation FINISHES
      Both intervals finish together and left starts later: ℓ.end = r.end ∧ r.start < ℓ.start. Converse of FINISHED_BY.
    • FINISHED_BY

      public static final AllenRelation FINISHED_BY
      Both intervals finish together and right starts later (converse of FINISHES): ℓ.end = r.end ∧ ℓ.start < r.start.
    • EQUALS

      public static final AllenRelation EQUALS
      The intervals are identical: ℓ.start = r.start ∧ ℓ.end = r.end. Self-converse.
    • MEETS

      public static final AllenRelation MEETS
      Left ends exactly where right begins (adjacent, no gap): ℓ.end = r.start. Converse of MET_BY.
    • MET_BY

      public static final AllenRelation MET_BY
      Left begins exactly where right ends (adjacent, no gap; converse of MEETS): ℓ.start = r.end.
    • PRECEDES

      public static final AllenRelation PRECEDES
      Left ends before right begins: ℓ.end < r.start. Converse of PRECEDED_BY.
    • PRECEDED_BY

      public static final AllenRelation PRECEDED_BY
      Left begins after right ends (converse of PRECEDES): ℓ.start > r.end.
  • Method Details

    • values

      public static AllenRelation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AllenRelation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null