Class Timeline<Timestamp extends java.lang.Comparable<Timestamp>>

  • Direct Known Subclasses:
    CompactTimeline, SingletonTimeline

    public abstract class Timeline<Timestamp extends java.lang.Comparable<Timestamp>>
    extends java.lang.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 Detail

      • Timeline

        public Timeline()
    • Method Detail

      • asChangeSequence

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

        public abstract boolean isPresentAtInfinity()
      • isEmpty

        public abstract boolean isEmpty()
      • size

        public abstract int size()
      • getUnsigned

        public abstract Timestamp getUnsigned​(int index)
      • 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object