Class Timeline<Timestamp extends Comparable<Timestamp>>

java.lang.Object
tools.refinery.interpreter.matchers.util.timeline.Timeline<Timestamp>
Direct Known Subclasses:
CompactTimeline, SingletonTimeline

public abstract class Timeline<Timestamp extends Comparable<Timestamp>> extends Object
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 Details

    • Timeline

      public Timeline()
  • Method Details

    • asChangeSequence

      public abstract Iterable<Signed<Timestamp>> asChangeSequence()
    • isPresentAtInfinity

      public abstract boolean isPresentAtInfinity()
    • isEmpty

      public abstract boolean isEmpty()
    • size

      public abstract int size()
    • getSigned

      public abstract Signed<Timestamp> getSigned(int index)
    • getUnsigned

      public abstract Timestamp getUnsigned(int index)
    • mergeMultiplicative

      public Timeline<Timestamp> mergeMultiplicative(Timeline<Timestamp> that)
    • mergeAdditive

      public Timeline<Timestamp> mergeAdditive(Diff<Timestamp> diff)
      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

      public String toString()
      Overrides:
      toString in class Object