Class AveragingTicker

java.lang.Object
  |
  +--Ticker
        |
        +--AveragingTicker
All Implemented Interfaces:
DataSource

public class AveragingTicker
extends Ticker

An AveragingTicker smooths out a stream of ticks by applying a moving average function over an arbitrary number of recent ticks.


Constructor Summary
AveragingTicker(java.lang.String filename, int n)
          Sole constructor.
 
Method Summary
 PointValue next()
          Fetches the next point value
 
Methods inherited from class Ticker
max, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AveragingTicker

public AveragingTicker(java.lang.String filename,
                       int n)
Sole constructor.

Parameters:
filename - source file for ticks
n - averaging window size
Method Detail

next

public PointValue next()
Description copied from class: Ticker
Fetches the next point value

Specified by:
next in interface DataSource
Overrides:
next in class Ticker
Returns:
next, null if no more.