Class Timeline<Timestamp extends Comparable<Timestamp>>
java.lang.Object
tools.refinery.interpreter.matchers.util.timeline.Timeline<Timestamp>
- Direct Known Subclasses:
CompactTimeline
,SingletonTimeline
A timeline describes the life cycle of a piece of data (typically a tuple in a relation) as a sequence of moments.
Even moments represent appearances, odd moments represent disappearances. A timeline is immutable, once created, it
is not possible to extend it with further moments.
- Since:
- 2.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSigned
(int index) abstract Timestamp
getUnsigned
(int index) abstract boolean
isEmpty()
abstract boolean
mergeAdditive
(Diff<Timestamp> diff) Merges this timeline with the given timestamp diff.mergeMultiplicative
(Timeline<Timestamp> that) abstract int
size()
toString()
-
Constructor Details
-
Timeline
public Timeline()
-
-
Method Details
-
asChangeSequence
-
isPresentAtInfinity
public abstract boolean isPresentAtInfinity() -
isEmpty
public abstract boolean isEmpty() -
size
public abstract int size() -
getSigned
-
getUnsigned
-
mergeMultiplicative
-
mergeAdditive
Merges this timeline with the given timestamp diff. The expectation is that the resulting timeline starts with an insertion. The logic is similar to a merge sort; we iterate side-by-side over the timeline and the diff. During the merge, cancellation can happen if at the same timestamp we observe different signs at the corresponding timeline and diff elements. -
toString
-