Class ChronologicalOperator
java.lang.Object
org.episteme.social.history.clock.ChronologicalOperator
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 Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if two events or periods were potentially contemporaneous.static long[]durationRange(TimeInterval from, TimeInterval to) Returns the potential duration range (minimum and maximum milliseconds) between two events.static Optional<TimeInterval> Calculates the intersection of two temporal intervals.static longmaximumGapMillis(TimeInterval earliest, TimeInterval latest) Calculates the maximum possible duration (in milliseconds) between two events.static longminimumGapMillis(TimeInterval earlier, TimeInterval later) Calculates the minimum possible duration (in milliseconds) between two events.static TimeIntervalunion(TimeInterval a, TimeInterval b) Calculates the union of two temporal intervals.
-
Method Details
-
intersection
Calculates the intersection of two temporal intervals. Returns the period where both ranges overlap, or empty if they are disjoint.- Parameters:
a- the first intervalb- the second interval- Returns:
- optional intersection interval
- Throws:
NullPointerException- if a or b is null
-
union
Calculates the union of two temporal intervals. Returns the smallest range that encompassing both (the bounding interval).- Parameters:
a- the first intervalb- the second interval- Returns:
- the union interval
- Throws:
NullPointerException- if a or b is null
-
areContemporaneous
Checks if two events or periods were potentially contemporaneous. Two events are contemporaneous if their time intervals overlap.- Parameters:
a- the first intervalb- the second interval- Returns:
- true if they overlap
- Throws:
NullPointerException- if a or b is null
-
minimumGapMillis
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 intervallater- the presumed later interval- Returns:
- minimum gap in milliseconds
- Throws:
NullPointerException- if earlier or later is null
-
maximumGapMillis
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 eventlatest- possible end of second event- Returns:
- maximum gap in milliseconds
- Throws:
NullPointerException- if earliest or latest is null
-
durationRange
Returns the potential duration range (minimum and maximum milliseconds) between two events.- Parameters:
from- start event intervalto- end event interval- Returns:
- array where [0] is min millis and [1] is max millis
- Throws:
NullPointerException- if from or to is null
-