jabble.indicators
Class TimeDifferenceFunctionField

java.lang.Object
  extended by jabble.indicators.TimeDifferenceFunctionField
All Implemented Interfaces:
FunctionField

public class TimeDifferenceFunctionField
extends java.lang.Object
implements FunctionField

Calculates the absolute value of the difference between a field on a given slice and the previous slice at a point.


Constructor Summary
TimeDifferenceFunctionField(java.lang.String fieldName)
          Creates a new instance of TimeDerivativeFunctionField
 
Method Summary
 double calculateAt(Point point)
          Calculates the expression at a given point.
 void setupFields(java.util.List<Slice> slices)
          Sets the set of slices on which the expression will be calculated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeDifferenceFunctionField

public TimeDifferenceFunctionField(java.lang.String fieldName)
Creates a new instance of TimeDerivativeFunctionField

Method Detail

setupFields

public void setupFields(java.util.List<Slice> slices)
Description copied from interface: FunctionField
Sets the set of slices on which the expression will be calculated. The implementation of this method should extract all the fields and constants that are going to be needed for calculateAt().

Specified by:
setupFields in interface FunctionField
Parameters:
slices - a list of slices in reverse evolution order (newest first)

calculateAt

public double calculateAt(Point point)
Description copied from interface: FunctionField
Calculates the expression at a given point.

Specified by:
calculateAt in interface FunctionField
Parameters:
point - the Point at which the expression is calculated.
Returns:
the value of the expression.