Class ChronologicalOperator

java.lang.Object
org.episteme.social.history.clock.ChronologicalOperator

public final class ChronologicalOperator extends Object
Provides chronological operations on uncertain dates. Enables set-theoretic operations like intersection and union, as well as distance and concomitance calculations for historical analysis.
Since:
1.0
Version:
1.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • intersection

      public static Optional<TimeInterval> intersection(TimeInterval a, TimeInterval b)
      Calculates the intersection of two temporal intervals. Returns the period where both ranges overlap, or empty if they are disjoint.
      Parameters:
      a - the first interval
      b - the second interval
      Returns:
      optional intersection interval
      Throws:
      NullPointerException - if a or b is null
    • union

      public static TimeInterval union(TimeInterval a, TimeInterval b)
      Calculates the union of two temporal intervals. Returns the smallest range that encompassing both (the bounding interval).
      Parameters:
      a - the first interval
      b - the second interval
      Returns:
      the union interval
      Throws:
      NullPointerException - if a or b is null
    • areContemporaneous

      public static boolean areContemporaneous(TimeInterval a, TimeInterval b)
      Checks if two events or periods were potentially contemporaneous. Two events are contemporaneous if their time intervals overlap.
      Parameters:
      a - the first interval
      b - the second interval
      Returns:
      true if they overlap
      Throws:
      NullPointerException - if a or b is null
    • minimumGapMillis

      public static long minimumGapMillis(TimeInterval earlier, TimeInterval later)
      Calculates the minimum possible duration (in milliseconds) between two events. Returns 0 if they could potentially overlap or occur in any order relative to each other within their uncertainty.
      Parameters:
      earlier - the presumed earlier interval
      later - the presumed later interval
      Returns:
      minimum gap in milliseconds
      Throws:
      NullPointerException - if earlier or later is null
    • maximumGapMillis

      public static long maximumGapMillis(TimeInterval earliest, TimeInterval latest)
      Calculates the maximum possible duration (in milliseconds) between two events. Defined as distance between earliest start and latest end minus lengths? Usually distance between A and B max is (Latest point of B - Earliest point of A) if A is before B.
      Parameters:
      earliest - possible start of first event
      latest - possible end of second event
      Returns:
      maximum gap in milliseconds
      Throws:
      NullPointerException - if earliest or latest is null
    • durationRange

      public static long[] durationRange(TimeInterval from, TimeInterval to)
      Returns the potential duration range (minimum and maximum milliseconds) between two events.
      Parameters:
      from - start event interval
      to - end event interval
      Returns:
      array where [0] is min millis and [1] is max millis
      Throws:
      NullPointerException - if from or to is null