Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TimeSeries<T>

Container for historical data

This class acts as a generic repository for a set of historical data. Any single datum can be accessed through its date, while sets of consecutive data can be accessed through iterators.

The Container type must satisfy the requirements set by the C++ standard for associative containers.

Type parameters

  • T

Hierarchy

  • TimeSeries

Index

Properties

Private _reverse

_reverse: Map<Integer, T> = new Map()

Private _values

_values: Map<Integer, T> = new Map()

Methods

at

  • at(i: Size): [Date, T]
  • Parameters

    Returns [Date, T]

dates

  • dates(): Date[]
  • Returns Date[]

empty

  • empty(): boolean
  • Returns boolean

first

  • first(): [Date, T]
  • Returns [Date, T]

firstDate

  • firstDate(): Date
  • Returns Date

get

  • get(d: Date): T
  • Parameters

    • d: Date

    Returns T

init1

  • Parameters

    • d: Date[]
    • v: T[]

    Returns TimeSeries<T>

init2

  • Parameters

    • firstDate: Date
    • v: T[]

    Returns TimeSeries<T>

last

  • last(): [Date, T]
  • Returns [Date, T]

lastDate

  • lastDate(): Date
  • Returns Date

reverse

  • reverse(): void
  • Returns void

set

  • set(d: Date, v: T): void
  • Parameters

    • d: Date
    • v: T

    Returns void

size

  • Returns Size

sort

  • sort(asc?: boolean): void
  • Parameters

    • Default value asc: boolean = true

    Returns void

values

  • values(): T[]
  • Returns T[]