Packages

case class TSEntry[+T](timestamp: Long, value: T, validity: Long) extends TimeSeries[T] with Product with Serializable

Represents a time series entry on the time-line, including its validity.

Can also be used as a 'constant' time series that has a single value.

'specialized' is used to have non-generic implementations for primitive types, which tend to be used a lot, in order to reduce the memory pressure a little bit.

Linear Supertypes
Serializable, Product, Equals, TimeSeries[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TSEntry
  2. Serializable
  3. Product
  4. Equals
  5. TimeSeries
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TSEntry(timestamp: Long, value: T, validity: Long)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def *[U >: T](other: TimeSeries[U])(implicit n: Numeric[U]): TimeSeries[U]
    Definition Classes
    TimeSeries
  4. def +[U >: T](other: TimeSeries[U])(implicit n: Numeric[U]): TimeSeries[U]
    Definition Classes
    TimeSeries
  5. def -[U >: T](other: TimeSeries[U])(implicit n: Numeric[U]): TimeSeries[U]
    Definition Classes
    TimeSeries
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def append[U >: T](other: TimeSeries[U], compress: Boolean = true): TimeSeries[U]

    Append the 'other' time series to this one at exactly the first of other's entries timestamp.

    Append the 'other' time series to this one at exactly the first of other's entries timestamp.

    if t_app = other.head.timestamp, this time series domain will be completely forgotten for all t > t_app, and replaced with whatever is in the domain of 'other'.

    This is equivalent to right-trimming this time series at other.head.timestamp and prepending it as-is to 'other'.

    If 'other' is empty, this time series is unchanged.

    Definition Classes
    TimeSeries
  8. def appendEntry[U >: T](other: TSEntry[U], compress: Boolean = true): Seq[TSEntry[U]]

    Append the other entry to this one.

    Append the other entry to this one. Any part of this entry that is defined for t > other.timestamp will be overwritten, either by 'other' or by nothing if 'others's validity does not reach t.

    Notes: - if 'other' has a timestamp before this value, only 'other' is returned. - if compression is enabled 'other' will be compressed into 'this' if their domains overlap and their values are strictly equal. In that case, this entry may be shrunk if 'other's domain of definition ends before 'this' one.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def at(t: Long): Option[T]

    The value valid at time 't' if there is one.

    The value valid at time 't' if there is one.

    Definition Classes
    TSEntryTimeSeries
  11. def bucket(buckets: Stream[Long]): Stream[(Long, TimeSeries[T])]

    Buckets this TimeSeries into sub-time series that have a domain of definition that is at most that specified by the passed bucket boundaries.

    Buckets this TimeSeries into sub-time series that have a domain of definition that is at most that specified by the passed bucket boundaries.

    buckets

    a stream of times representing bucket boundaries. A stream of (a, b, c, ...) will generate buckets with domain (([a, b[), ([b, c[), ...) Note that it is wise to have 'buckets' start at a meaningfully close point in time relative to the time series first entry.

    returns

    a stream of (bucket-start, timeseries).

    Definition Classes
    TimeSeries
  12. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. def defined(at: Long): Boolean

    True if this time series is defined at 'at'.

    True if this time series is defined at 'at'. Ie, at('at') would return Some[T]

    Definition Classes
    TSEntryTimeSeries
  14. def definedUntil: Long

    Non-inclusive end of validity of the entry.

    Non-inclusive end of validity of the entry. E.g. the first timestamp where it is not defined anymore.

  15. def entries: Seq[TSEntry[T]]

    Return a Seq of the TSEntries representing this time series.

    Return a Seq of the TSEntries representing this time series.

    Definition Classes
    TSEntryTimeSeries
  16. def entryAt(t: Long): Option[TSEntry[T]]

    Return this entry within an option if it is valid at time t

    Return this entry within an option if it is valid at time t

    Definition Classes
    TSEntryTimeSeries
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def extendValidity(validityIncrement: Long): TSEntry[T]

    Creates a new entry with an extended validity.

    Creates a new entry with an extended validity.

    validityIncrement

    The validity increment

  19. def fallback[U >: T](other: TimeSeries[U]): TimeSeries[U]

    Fallback to other when this is not defined

    Fallback to other when this is not defined

    U

    The new underlying parameter

    other

    Another time series which should contain the value when this is not defined

    returns

    A time series which contains the values of this if defined, and of other otherwise

    Definition Classes
    TimeSeries
  20. def fill[U >: T](whenUndef: U): TimeSeries[U]

    Fill the wholes in the definition domain of this time series with the passed value.

    Fill the wholes in the definition domain of this time series with the passed value. The resulting time series will have a single continuous definition domain, provided the original time series was non-empty.

    Definition Classes
    TSEntryTimeSeries
  21. def filter(predicate: (TSEntry[T]) => Boolean): TimeSeries[T]

    Return a time series that will only contain entries for which the passed predicate returned True.

    Return a time series that will only contain entries for which the passed predicate returned True.

    Definition Classes
    TSEntryTimeSeries
  22. def filterValues(predicate: (T) => Boolean): TimeSeries[T]

    Return a time series that will only contain entries containing values for which the passed predicate returned True.

    Return a time series that will only contain entries containing values for which the passed predicate returned True.

    Definition Classes
    TSEntryTimeSeries
  23. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def head: TSEntry[T]

    Return the first (chronological) entry in this time series.

    Return the first (chronological) entry in this time series.

    Definition Classes
    TSEntryTimeSeries
    Exceptions thrown

    NoSuchElementException if this time series is empty.

  26. def headOption: Option[TSEntry[T]]

    Return a filled option containing the first (chronological) entry in this time series.

    Return a filled option containing the first (chronological) entry in this time series. None if this time series is empty.

    Definition Classes
    TSEntryTimeSeries
  27. def headValue: T

    Return the first (chronological) value in this time series.

    Return the first (chronological) value in this time series.

    Definition Classes
    TimeSeries
    Exceptions thrown

    NoSuchElementException if this time series is empty.

  28. def headValueOption: Option[T]

    Return a filled option containing the first (chronological) value in this time series.

    Return a filled option containing the first (chronological) value in this time series. None if this time series is empty.

    Definition Classes
    TimeSeries
  29. def integral[U >: T](timeUnit: TimeUnit = TimeUnit.MILLISECONDS)(implicit n: Numeric[U]): Double

    Compute the integral of this entry that is essentially "value * validity", with the validity first being converted to seconds according to the passed time unit.

    Compute the integral of this entry that is essentially "value * validity", with the validity first being converted to seconds according to the passed time unit. By default, milliseconds are assumed and converted.

    Note

    This currently only returns doubles.

  30. def integralEntry[U >: T](timeUnit: TimeUnit = TimeUnit.MILLISECONDS)(implicit n: Numeric[U]): TSEntry[Double]

    See integral.

  31. def isCompressed: Boolean

    Returns true if it is guaranteed that this timeseries was compressed at construction.

    Returns true if it is guaranteed that this timeseries was compressed at construction. If this returns false it is not known whether the series has been compressed.

    Definition Classes
    TSEntryTimeSeries
  32. def isDomainContinuous: Boolean

    Returns true if it is guaranteed that this timeseries is defined for all t in its looseDomain.

    Returns true if it is guaranteed that this timeseries is defined for all t in its looseDomain. I. e. whether there are holes in its time domain or not. If this returns false it is not known whether the series has been compressed.

    Definition Classes
    TSEntryTimeSeries
  33. def isEmpty: Boolean

    Convenient and efficient method for size == 0

    Convenient and efficient method for size == 0

    Definition Classes
    TSEntryTimeSeries
  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def last: TSEntry[T]

    Return the last (chronological) entry in this time series.

    Return the last (chronological) entry in this time series.

    Definition Classes
    TSEntryTimeSeries
    Exceptions thrown

    NoSuchElementException if this time series is empty.

  36. def lastOption: Option[TSEntry[T]]

    Return a filled option containing the last (chronological) entry in this time series.

    Return a filled option containing the last (chronological) entry in this time series. None if this time series is empty.

    Definition Classes
    TSEntryTimeSeries
  37. def lastValue: T

    Return the last (chronological) value in this time series.

    Return the last (chronological) value in this time series.

    Definition Classes
    TimeSeries
    Exceptions thrown

    NoSuchElementException if this time series is empty.

  38. def lastValueOption: Option[T]

    Return a filled option containing the last (chronological) value in this time series.

    Return a filled option containing the last (chronological) value in this time series. None if this time series is empty.

    Definition Classes
    TimeSeries
  39. def looseDomain: TimeDomain

    The loose domain of an entry is simply its domain.

    The loose domain of an entry is simply its domain.

    returns

    The looseDomain of the time series

    Definition Classes
    TSEntryTimeSeries
  40. def map[O](f: (T) => O, compress: Boolean = true)(implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[O]): TSEntry[O]

    Map value contained in this timeseries using the passed function

    Map value contained in this timeseries using the passed function

    Definition Classes
    TSEntryTimeSeries
  41. def mapWithTime[O](f: (Long, T) => O, compress: Boolean = true)(implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[O]): TSEntry[O]

    Map the values within the time series.

    Map the values within the time series. Timestamps and validities of entries remain unchanged, but the time is made available for cases where the new value would depend on it.

    Definition Classes
    TSEntryTimeSeries
  42. def merge[O, R](op: (Option[T], Option[O]) => Option[R])(other: TimeSeries[O]): TimeSeries[R]

    Merge another time series to this one, using the provided operator to merge entries.

    Merge another time series to this one, using the provided operator to merge entries.

    The operator can define all four cases encountered during merging:

    • both entries defined
    • only one of the entries defined
    • no entry defined

    In any case, the returned time series will only be defined between the bounds defined by min(this.head.timestamp, other.head.timestamp) and max(this.last.definedUntil, other.last.definedUntil).

    Definition Classes
    TimeSeries
  43. def minus[U >: T](other: TimeSeries[U], leftHandDefault: Option[U] = None, rightHandDefault: Option[U] = None)(implicit n: Numeric[U]): TimeSeries[U]

    Subtract the entries within this and the provided time series such that this.at(x) - other.at(x) = returned.at(x) where x may take any value where both time series are defined.

    Subtract the entries within this and the provided time series such that this.at(x) - other.at(x) = returned.at(x) where x may take any value where both time series are defined.

    Definition Classes
    TimeSeries
  44. def multiply[U >: T](other: TimeSeries[U])(implicit n: Numeric[U]): TimeSeries[U]

    Multiply the entries within this and the provided time series such that this.at(x) * other.at(x) = returned.at(x) where x may take any value where both time series are defined.

    Multiply the entries within this and the provided time series such that this.at(x) * other.at(x) = returned.at(x) where x may take any value where both time series are defined.

    Definition Classes
    TimeSeries
  45. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. def newBuilder[U](compress: Boolean = true)(implicit tag: scala.reflect.api.JavaUniverse.WeakTypeTag[U]): TimeSeriesBuilder[U]

    returns

    a builder that constructs a new timeseries of this implementation

    Definition Classes
    TimeSeries
  47. def nonEmpty: Boolean

    Convenient method for !isEmpty

    Convenient method for !isEmpty

    Definition Classes
    TimeSeries
  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  50. def overlaps[O](other: TSEntry[O]): Boolean

    return true if this and the other entry have an overlapping domain of definition.

    return true if this and the other entry have an overlapping domain of definition. False if the domains are only contiguous.

  51. def plus[U >: T](other: TimeSeries[U], strict: Boolean = true)(implicit n: Numeric[U]): TimeSeries[U]

    Sum the entries within this and the provided time series such that

    Sum the entries within this and the provided time series such that

    - If strict (default): this.at(x) + other.at(x) = returned.at(x) where x may take any value where both time series are defined. - If non strict : this.at(x) + other.at(x) = returned.at(x) where x may take any value where any time series is defined.

    Definition Classes
    TimeSeries
  52. def prepend[U >: T](other: TimeSeries[U], compress: Boolean = true): TimeSeries[U]

    Prepend the 'other' time series to this one at exactly the last of other's entries definedUntil().

    Prepend the 'other' time series to this one at exactly the last of other's entries definedUntil().

    if t_prep = other.last.definedUntil, this time series domain will be completely forgotten for all t <= t_prep, and replaced with whatever is in the domain of 'other'.

    This is equivalent to left-trimming this time series at other.last.definedUntil and appending it as-is with to 'other'.

    If 'other' is empty, this time series is unchanged.

    Definition Classes
    TimeSeries
  53. def prependEntry[U >: T](other: TSEntry[U]): Seq[TSEntry[U]]

    Prepend the other entry to this one.

    Prepend the other entry to this one. Any part of this entry that is defined at t < other.definedUntil will be overwritten by the other entry, or not be defined if t < other.timestamp

  54. def productElementNames: Iterator[String]
    Definition Classes
    Product
  55. def rollup[R](buckets: Stream[Long], aggregator: (TimeSeries[T]) => R): TimeSeries[R]

    Given the passed bucket delimiters, apply 'aggregator' for each generated bucket.

    Given the passed bucket delimiters, apply 'aggregator' for each generated bucket.

    Note that the timestamps and validities of the entries present in the returned timeseries are ONLY driven by the boundaries generated by 'buckets': the first and last entry may well be defined outside of the domain of definition of this time series

    R

    the type returned by the aggregator

    buckets

    a stream generating the bucket boundaries for the rollup/aggregation

    aggregator

    a function that computes an aggregate over a time series

    returns

    a TimeSeries, the values of which are generated by the aggregator and the entries' domains are defined by the respective buckets.

    Definition Classes
    TimeSeries
  56. def sample(start: Long, sampleRate: Long, useClosestInWindow: Boolean, compress: Boolean = false): TimeSeries[T]

    Sample this TimeSeries at fixed time intervals of length sampleRate starting at the start timestamp.

    Sample this TimeSeries at fixed time intervals of length sampleRate starting at the start timestamp. By default, all resulting entries will have the duration of sampleRate. If equal contiguous entries are compressed (set the compress flag) all entries have a duration that is a multiple of sampleRate.

    In the strict mode (useClosestInWindow = false), the sampled values are exactly equal to the value of this TimeSeries at the sample points. In the useClosestInWindow mode, the sampling looks at the entries in the window of [samplePoint - sampleRate/2, samplePoint + sampleRate/2[. The value of the entry that starts the closest to the samplePoint among those starting in the window is taken.

    start

    timestamp of first sample point

    sampleRate

    interval between sample points

    useClosestInWindow

    enables non-strict look-around sampling

    compress

    specifies whether equal contiguous entries should be compressed

    returns

    the sampled time series

    Definition Classes
    TimeSeries
    Note

    In either case, this function does **not** perform any kind of aggregation or roll-up.

  57. def size: Int

    The number of elements in this time series.

    The number of elements in this time series.

    Definition Classes
    TSEntryTimeSeries
  58. def slice(from: Long, to: Long): TimeSeries[T]

    Extract a slice from this time series.

    Extract a slice from this time series.

    The returned slice will only be defined between the specified bounds such that:

    this.at(x) == returned.at(x) for all x in [from, to[.

    If x is outside of the bounds, returned.at(x) is None.

    Definition Classes
    TimeSeries
  59. def sliceDiscrete(from: Long, to: Long, fromInclusive: Boolean = true, toInclusive: Boolean = true): TimeSeries[T]

    Extract a slice from this time series, while preventing entries on the slice boundaries from being split.

    Extract a slice from this time series, while preventing entries on the slice boundaries from being split.

    Definition Classes
    TimeSeries
  60. def slidingIntegral[U >: T](window: Long, sampleRate: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS)(implicit n: Numeric[U]): TimeSeries[Double]

    Compute a new time series that will contain, for any query time t, the integral over the entries present in this time series that are defined for a time between t - window and t.

    Compute a new time series that will contain, for any query time t, the integral over the entries present in this time series that are defined for a time between t - window and t.

    Note: returns a step function, meaning that there is a slight level of imprecision depending on your resolution. The bigger the window is relative to the sampleRate, the smaller the imprecision becomes.

    window

    width of the window

    sampleRate

    frequency of resampling

    timeUnit

    time unit used for this entry. By default, milliseconds are assumed.

    returns

    a TimeSeries that for any queried time will return an approximate integral of this time series over the past window

    Definition Classes
    TimeSeries
  61. def split(at: Long): (TimeSeries[T], TimeSeries[T])

    Split this time series into two.

    Split this time series into two.

    Returns a tuple of two contiguous time series, such that the left time series is never defined for t >= 'at' and the right time series is never defined for t < 'at'.

    Default implementation simply returns (this.trimRight(at), this.trimLeft(at))

    Definition Classes
    TimeSeries
  62. def splitDiscrete(at: Long, splitAfterEntry: Boolean = true): (TimeSeries[T], TimeSeries[T])

    Split this time series into two.

    Split this time series into two.

    If 'at' is within the domain of a particular entry, the time series will be split either at the beginning or end of that entry, according to the passed 'splitAfterEntry'

    Definition Classes
    TimeSeries
  63. def splitEntriesLongerThan(entryMaxLength: Long): TimeSeries[T]

    Splits up all entries of this timeseries that are longer than the given maximal length.

    Splits up all entries of this timeseries that are longer than the given maximal length. This is slightly similar but not strictly equivalent to resampling a series: if you need some form of resampling, make sure this is what you need.

    entryMaxLength

    to use for splitting

    returns

    timeseries with entries guaranteed to be shorter than the given maximal length

    Definition Classes
    TSEntryTimeSeries
  64. def stepIntegral[U >: T](stepLengthMs: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS)(implicit n: Numeric[U]): TimeSeries[Double]

    Computes the integral of this time series.

    Computes the integral of this time series. This function returns a step function, so only represents an approximation. Use it if you need to compute multiple integrals of the same time series.

    Definition Classes
    TimeSeries
  65. def strictMerge[O, R](op: (T, O) => R)(other: TimeSeries[O]): TimeSeries[R]

    Merge another time series to this one, using the provided operator to merge entries.

    Merge another time series to this one, using the provided operator to merge entries. The resulting series has the value defined by the operator at all times where both input series are defined. At all other times (i.e. where only one or none of the input series is defined), the resulting series is not defined.

    op

    the operator for the merge

    other

    TimeSeries to merge

    returns

    the strictly merged TimeSeries

    Definition Classes
    TimeSeries
  66. def strictZip[O](other: TimeSeries[O]): TimeSeries[(T, O)]

    Zips this time series with another one, returning a time series of tuples containing the values from both this and the other time series across their common domain.

    Zips this time series with another one, returning a time series of tuples containing the values from both this and the other time series across their common domain.

    Definition Classes
    TimeSeries
  67. def supportRatio: Double

    returns

    The probability that the time series is defined over its loose-domain

    Definition Classes
    TSEntryTimeSeries
  68. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  69. val timestamp: Long
  70. def trimEntryLeft(at: Long): TSEntry[T]

    Similar to trimLeft, but returns a TSEntry instead of a time series and throws if 'at' exceeds the entry's definition.

  71. def trimEntryLeftNRight(l: Long, r: Long): TSEntry[T]

    Equivalent to calling trimEntryLeft(l).trimEntryRight(r) without the intermediary step.

  72. def trimEntryRight(at: Long): TSEntry[T]

    Similar to trimLeft, but returns a TSEntry instead of a time series and throws if 'at' is before the entry's timestamp.

  73. def trimLeft(at: Long): TimeSeries[T]

    Move this entry's timestamp to 'at' and shorten the validity accordingly, if this entry is defined at 'at'.

    Move this entry's timestamp to 'at' and shorten the validity accordingly, if this entry is defined at 'at'.

    Definition Classes
    TSEntryTimeSeries
  74. def trimLeftDiscrete(at: Long, includeEntry: Boolean): TimeSeries[T]

    Returns an empty entry if:

    Returns an empty entry if:

    • 'at' is after this entry's domain
    • 'at' is within the entry (but not equal to the timestamp) and it must not be split in two
    Definition Classes
    TSEntryTimeSeries
  75. def trimRight(at: Long): TimeSeries[T]

    Shorten this entry's validity if it exceed 'at'.

    Shorten this entry's validity if it exceed 'at'. No effect otherwise.

    If the entry's timestamp is after 'at', the entry remains unchanged.

    Definition Classes
    TSEntryTimeSeries
  76. def trimRightDiscrete(at: Long, includeEntry: Boolean): TimeSeries[T]

    Returns an empty entry if:

    Returns an empty entry if:

    • 'at' is before or at the exact begin boundary of this entry's domain
    • 'at' is within the entry and it must not be split in two
    Definition Classes
    TSEntryTimeSeries
  77. val validity: Long
  78. val value: T
  79. def values: Seq[T]

    Return a Seq of the values contained by this series, in their chronological order.

    Return a Seq of the values contained by this series, in their chronological order.

    Definition Classes
    TSEntryTimeSeries
  80. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  81. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  82. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def integrateBetween[U >: T](from: Long, to: Long)(implicit n: Numeric[U]): U
    Definition Classes
    TimeSeries
    Annotations
    @deprecated
    Deprecated

    This function does only sum values in a slice of the series. Use slice and stepIntegral or slidingIntegral.

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from TimeSeries[T]

Inherited from AnyRef

Inherited from Any

Ungrouped