Class TemporalDistance
java.lang.Object
com.darkcollective.relix.processor.eval.TemporalDistance
The absolute temporal distance between two values — the metric that
complements
ValueComparator's order, for the operators that bound how
far apart two rows may be (the AS-OF join's WITHIN tolerance).
The distance is defined as the language's own subtraction rather
than restated as a second table of type pairs, so the two cannot drift: a
distance exists exactly where a − b yields a DURATION, which is
between two TIMESTAMPs, two DATEs (a whole-day span) and two DURATIONs. That
inherits the same string coercion the comparator applies, so a text cell
measured against a typed temporal value reads as the value it spells.
Everything else — two strings, two numbers, a TIMESTAMP against a DURATION, or two TIMEs, whose difference the arithmetic algebra deliberately leaves undefined because a wall-clock span wraps — has no distance, reported as an empty result so the caller can phrase the objection in its own terms.
-
Method Summary
-
Method Details
-
between
Returns the absolute distance between two non-NULL values, or empty when no distance is defined for the pair.- Parameters:
a- the first valueb- the second value- Returns:
- the absolute distance, or empty when the pair has none
-