org.systemsbiology.data
Class SlidingWindowTimeSeriesQueue

java.lang.Object
  extended byorg.systemsbiology.data.SlidingWindowTimeSeriesQueue

public class SlidingWindowTimeSeriesQueue
extends Object

Implements a queue of ordered pairs of floating-point values. The first element of the ordered pair is the time, and the second element of the ordered pair is the value of some variable at that time. When the queue fills up, it start overwriting itself, discarding the oldest point first. Therefore it is a FIFO (first-in, first-out) queue. The temporal ordering of the timestamps is not enforced.

Author:
Stephen Ramsey

Constructor Summary
SlidingWindowTimeSeriesQueue(int pNumTimePoints)
           
 
Method Summary
 void clear()
           
 double getAverageValue()
           
 double getLastTimePoint()
           
 double getMinTime()
           
 int getNumStoredPoints()
           
 double getTimeLastNonzeroValue()
           
 double getTimePoint(int pIndex)
           
 double[] getTimePoints()
           
 double getValue(int pIndex)
           
 double[] getValues()
           
 boolean hasNonzeroValue()
           
 void initialize(int pNumTimePoints)
           
 void insertPoint(double pTime, double pValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlidingWindowTimeSeriesQueue

public SlidingWindowTimeSeriesQueue(int pNumTimePoints)
Method Detail

initialize

public void initialize(int pNumTimePoints)

getValue

public double getValue(int pIndex)

clear

public void clear()

hasNonzeroValue

public boolean hasNonzeroValue()

getTimeLastNonzeroValue

public double getTimeLastNonzeroValue()
                               throws IllegalStateException
Throws:
IllegalStateException

getLastTimePoint

public double getLastTimePoint()

getNumStoredPoints

public int getNumStoredPoints()

getTimePoint

public double getTimePoint(int pIndex)

getAverageValue

public double getAverageValue()

insertPoint

public void insertPoint(double pTime,
                        double pValue)

getMinTime

public double getMinTime()

getTimePoints

public double[] getTimePoints()

getValues

public double[] getValues()