CronoSeries  0.1.*
A fork of Cronos with a focus on being a Time Series class library.
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Properties | List of all members
CronoSeries.TimeSeries.Data.TimeSeriesBase< T > Class Template Reference

Public Member Functions

DateTime TimeStamp (int idx)
 
int IndexAtOrBefore (DateTime time, out bool exact)
 
void InsertInMiddle (DateTime time, T value, bool forceOverwrite)
 inserts a new point into the time series. if the datetime already has a value, then it either replaces it or throws an exception More...
 
TimeSeriesBase< T > GetSubrange (DateTime t0, DateTime t1)
 
ValueAtTime (DateTime time)
 does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned. More...
 
ValueAtTime (DateTime time, out bool gotExactTime)
 does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned. this function sets an output flag indicating whether or not there was an exact time match. More...
 
void DeletePoint (DateTime time)
 
void DeleteBefore (DateTime time, bool keepOne)
 removes all points strictly before the specified time More...
 
void SetValue (int idx, T value)
 
DateTime GetFirstTime ()
 
DateTime GetLastTime ()
 
TimeSpan GetCommonSamplingInterval ()
 
void Add (TimeSeriesBase< T > otherTS, bool forceOverwrite)
 adds a whole additional time series to the end of this one (actually it doesn't have to be at the end, but it's most efficient that way) More...
 
void Add (DateTime time, T value, bool forceOverwrite)
 adds a value to the time series. works most efficiently if it comes at the end chronologically. if the timestamp already exists, then it either throws an exception or overwrites the existing value. More...
 
void RemoveFirst ()
 
void RemoveLast ()
 

Public Attributes

int Count => values.Count
 
this[int i] => values[i]
 

Static Public Attributes

static readonly double ticksPerDay = new TimeSpan(24, 0, 0).Ticks
 

Protected Attributes

List< DateTime > times
 
List< T > values
 

Properties

int Dimension [get, set]
 
string Title [get, set]
 
string Description [get, set]
 

Member Function Documentation

◆ Add() [1/2]

void CronoSeries.TimeSeries.Data.TimeSeriesBase< T >.Add ( DateTime  time,
value,
bool  forceOverwrite 
)
inline

adds a value to the time series. works most efficiently if it comes at the end chronologically. if the timestamp already exists, then it either throws an exception or overwrites the existing value.

Parameters
timetime of new point
valuevalue to add
forceOverwriteif timestamp already exists, determines whether to throw an exception or overwrite existing value

◆ Add() [2/2]

void CronoSeries.TimeSeries.Data.TimeSeriesBase< T >.Add ( TimeSeriesBase< T >  otherTS,
bool  forceOverwrite 
)
inline

adds a whole additional time series to the end of this one (actually it doesn't have to be at the end, but it's most efficient that way)

Parameters
otherTS
forceOverwrite

◆ DeleteBefore()

void CronoSeries.TimeSeries.Data.TimeSeriesBase< T >.DeleteBefore ( DateTime  time,
bool  keepOne 
)
inline

removes all points strictly before the specified time

Parameters
time
keepOnetrue if one extra point should be kept

◆ InsertInMiddle()

void CronoSeries.TimeSeries.Data.TimeSeriesBase< T >.InsertInMiddle ( DateTime  time,
value,
bool  forceOverwrite 
)
inline

inserts a new point into the time series. if the datetime already has a value, then it either replaces it or throws an exception

Parameters
timetime at which value is to be inserted
valuevalue to be inserted
forceOverwritedetermines whether exception is thrown when point alread exists

◆ ValueAtTime() [1/2]

T CronoSeries.TimeSeries.Data.TimeSeriesBase< T >.ValueAtTime ( DateTime  time)
inline

does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned.

◆ ValueAtTime() [2/2]

T CronoSeries.TimeSeries.Data.TimeSeriesBase< T >.ValueAtTime ( DateTime  time,
out bool  gotExactTime 
)
inline

does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned. this function sets an output flag indicating whether or not there was an exact time match.

Parameters
time
gotExactTime
Returns

The documentation for this class was generated from the following file: