Kieker 1.12

kieker.tools.opad.timeseries
Class TimeSeries<T>

java.lang.Object
  extended by kieker.tools.opad.timeseries.TimeSeries<T>
Type Parameters:
T - The type of the time series.
All Implemented Interfaces:
ITimeSeries<T>

public class TimeSeries<T>
extends java.lang.Object
implements ITimeSeries<T>

Since:
1.10
Author:
Andre van Hoorn, Tobias Rudolph, Andreas Eberlein

Field Summary
 
Fields inherited from interface kieker.tools.opad.timeseries.ITimeSeries
INFINITE_CAPACITY
 
Constructor Summary
TimeSeries(long startTime, java.util.concurrent.TimeUnit timeUnit, long deltaTime)
          Constructor using the timeunit as unit for internal usage and deltatime time unit.
TimeSeries(long startTime, java.util.concurrent.TimeUnit timeUnit, long deltaTime, int frequency)
           
TimeSeries(long startTime, java.util.concurrent.TimeUnit timeUnit, long deltaTime, int frequency, int capacity)
          Constructor using the timeunit as unit for internal usage and deltatime time unit.
TimeSeries(long startTime, java.util.concurrent.TimeUnit timeSeriesTimeUnit, long deltaTime, java.util.concurrent.TimeUnit deltaTimeUnit)
           
TimeSeries(long startTime, java.util.concurrent.TimeUnit timeSeriesTimeUnit, long deltaTime, java.util.concurrent.TimeUnit deltaTimeUnit, int capacity)
           
TimeSeries(long startTime, java.util.concurrent.TimeUnit timeSeriesTimeUnit, long deltaTime, java.util.concurrent.TimeUnit deltaTimeUnit, int frequency, int capacity)
           
 
Method Summary
 ITimeSeriesPoint<T> append(T value)
          Appends the given value to the time series.
 java.util.List<ITimeSeriesPoint<T>> appendAll(T[] values)
          Appends the given value to the time series.
 int getCapacity()
          Returns the maximum number of elements held in this time series.
 long getDeltaTime()
          Returns the temporal distance between to time series values with respect to the configured TimeUnit ITimeSeries.getDeltaTime().
 java.util.concurrent.TimeUnit getDeltaTimeUnit()
          The TimeUnit used to specify the temporal distance between to values (ITimeSeries.getDeltaTime()).
 long getEndTime()
          Returns the time corresponding to the most recent value in the time series.
 int getFrequency()
          Returns the frequency of the time series (how many time series points add up to an time unit of interest) needed to improve forecast accuracy e.g.
 java.util.List<ITimeSeriesPoint<T>> getPoints()
          Returns the ITimeSeriesPoints of this time series.
 long getStartTime()
          Returns the start of the time series, i.e., the time of the first value.
 long getStepSize()
          Returns the step size between each item in the timeseries.
 java.util.concurrent.TimeUnit getTimeSeriesTimeUnit()
          The TimeUnit used to specify the temporal distance between to values (ITimeSeries.getStartTime()).
 java.util.List<T> getValues()
          Returns a list of all getPoints()getValues().
 int size()
          Returns the number of value contained in the time series.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeSeries

public TimeSeries(long startTime,
                  java.util.concurrent.TimeUnit timeSeriesTimeUnit,
                  long deltaTime,
                  java.util.concurrent.TimeUnit deltaTimeUnit,
                  int frequency,
                  int capacity)
Parameters:
startTime - start time of Timeseries
timeSeriesTimeUnit - time unit of the startTime
deltaTime - time of timeseries
deltaTimeUnit - Time unit
capacity - length of timeseries

TimeSeries

public TimeSeries(long startTime,
                  java.util.concurrent.TimeUnit timeSeriesTimeUnit,
                  long deltaTime,
                  java.util.concurrent.TimeUnit deltaTimeUnit,
                  int capacity)
Parameters:
startTime - start time of Timeseries
timeSeriesTimeUnit - time unit of the startTime
deltaTime - time of timeseries
deltaTimeUnit - Time unit
capacity - length of timeseries

TimeSeries

public TimeSeries(long startTime,
                  java.util.concurrent.TimeUnit timeSeriesTimeUnit,
                  long deltaTime,
                  java.util.concurrent.TimeUnit deltaTimeUnit)
Parameters:
startTime - start time of Timeseries
timeSeriesTimeUnit - time unit of the startTime
deltaTime - time of timeseries
deltaTimeUnit - Time unit

TimeSeries

public TimeSeries(long startTime,
                  java.util.concurrent.TimeUnit timeUnit,
                  long deltaTime)
Constructor using the timeunit as unit for internal usage and deltatime time unit. Furthermore using infinite capacity and a frequency of 24 by default.


TimeSeries

public TimeSeries(long startTime,
                  java.util.concurrent.TimeUnit timeUnit,
                  long deltaTime,
                  int frequency,
                  int capacity)
Constructor using the timeunit as unit for internal usage and deltatime time unit.


TimeSeries

public TimeSeries(long startTime,
                  java.util.concurrent.TimeUnit timeUnit,
                  long deltaTime,
                  int frequency)
Method Detail

getStartTime

public long getStartTime()
Description copied from interface: ITimeSeries
Returns the start of the time series, i.e., the time of the first value.

Specified by:
getStartTime in interface ITimeSeries<T>

getTimeSeriesTimeUnit

public java.util.concurrent.TimeUnit getTimeSeriesTimeUnit()
Description copied from interface: ITimeSeries
The TimeUnit used to specify the temporal distance between to values (ITimeSeries.getStartTime()).

Specified by:
getTimeSeriesTimeUnit in interface ITimeSeries<T>

getDeltaTime

public long getDeltaTime()
Description copied from interface: ITimeSeries
Returns the temporal distance between to time series values with respect to the configured TimeUnit ITimeSeries.getDeltaTime().

Specified by:
getDeltaTime in interface ITimeSeries<T>

getDeltaTimeUnit

public java.util.concurrent.TimeUnit getDeltaTimeUnit()
Description copied from interface: ITimeSeries
The TimeUnit used to specify the temporal distance between to values (ITimeSeries.getDeltaTime()).

Specified by:
getDeltaTimeUnit in interface ITimeSeries<T>

getStepSize

public long getStepSize()
Returns the step size between each item in the timeseries. The TimeUnit of the stepSize is equal to the timeSeriesTimeUnit.

Returns:
step size

append

public ITimeSeriesPoint<T> append(T value)
Description copied from interface: ITimeSeries
Appends the given value to the time series.

Specified by:
append in interface ITimeSeries<T>
Parameters:
value - value which should append to timeseries
Returns:
tspoint

getPoints

public java.util.List<ITimeSeriesPoint<T>> getPoints()
Description copied from interface: ITimeSeries
Returns the ITimeSeriesPoints of this time series.

Specified by:
getPoints in interface ITimeSeries<T>
Returns:
Points

getValues

public java.util.List<T> getValues()
Description copied from interface: ITimeSeries
Returns a list of all getPoints()getValues().

Specified by:
getValues in interface ITimeSeries<T>

getCapacity

public int getCapacity()
Description copied from interface: ITimeSeries
Returns the maximum number of elements held in this time series.

Specified by:
getCapacity in interface ITimeSeries<T>
Returns:
the capacity; ITimeSeries.INFINITE_CAPACITY if the capacity is infinite

size

public int size()
Description copied from interface: ITimeSeries
Returns the number of value contained in the time series.

Specified by:
size in interface ITimeSeries<T>

getEndTime

public long getEndTime()
Description copied from interface: ITimeSeries
Returns the time corresponding to the most recent value in the time series.

Specified by:
getEndTime in interface ITimeSeries<T>

appendAll

public java.util.List<ITimeSeriesPoint<T>> appendAll(T[] values)
Description copied from interface: ITimeSeries
Appends the given value to the time series.

Specified by:
appendAll in interface ITimeSeries<T>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFrequency

public int getFrequency()
Description copied from interface: ITimeSeries
Returns the frequency of the time series (how many time series points add up to an time unit of interest) needed to improve forecast accuracy e.g. a time series point each 15 minutes, interested in forecasting days: frequency is 96

Specified by:
getFrequency in interface ITimeSeries<T>
Returns:
frequency as the number of time series points that add up either to the next bigger time unit and/or to the estimated length of seasonal patterns in focus. The value should not be too small (still able to approximate the shape of the seasonal pattern) and not to high (to limit the computational effort of complex forecast strategies)

Kieker 1.12

Copyright 2015 Kieker Project, http://kieker-monitoring.net