simulator
Class OldValue

java.lang.Object
  |
  +--simulator.OldValue

class OldValue
extends java.lang.Object

Remember a sliding window of old value


Field Summary
protected  int n
          The actual size of sliding window
protected  int N
          The number of element to remember
protected  double[] old
          The storage of element to remember
 
Constructor Summary
OldValue(int size)
          Build an empty window of value
 
Method Summary
 double get()
          Get the oldest value
 void set(double el)
          Set the youngest value
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

N

protected int N
The number of element to remember

n

protected int n
The actual size of sliding window

old

protected double[] old
The storage of element to remember
Constructor Detail

OldValue

public OldValue(int size)
Build an empty window of value
Method Detail

get

public double get()
Get the oldest value
Returns:
the oldest value

set

public void set(double el)
Set the youngest value
Parameters:
el - the youngest value