com.steema.teechart.functions
Class ExpAverage

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.functions.Function
          extended by com.steema.teechart.functions.Moving
              extended by com.steema.teechart.functions.ExpAverage

public class ExpAverage
extends Moving

Title: ExpAverage class

Description: Exponential Average Function.

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL


Field Summary
 
Fields inherited from class com.steema.teechart.functions.Function
canUsePeriod, dPeriod, HideSourceList, noSourceRequired, series, SingleSource, updating
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
ExpAverage()
           
ExpAverage(IBaseChart c)
           
 
Method Summary
 double calculate(Series s, int firstIndex, int lastIndex)
          Performs function operation on SourceSeries series.
 java.lang.String getDescription()
          Gets descriptive text.
 double getWeight()
          Performs an Exponential average based on its DataSource values.
 void setWeight(double value)
          Performs an Exponential average based on its DataSource values.
 
Methods inherited from class com.steema.teechart.functions.Moving
doCalculation
 
Methods inherited from class com.steema.teechart.functions.Function
addFunctionXY, addPoints, calculateAllPoints, calculateByPeriod, calculateMany, calculatePeriod, clear, dispose, getPeriod, getPeriodAlign, getPeriodStyle, getSeries, newInstance, readResolve, recalculate, setPeriod, setPeriodAlign, setPeriodStyle, setSeries, valueList
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpAverage

public ExpAverage()

ExpAverage

public ExpAverage(IBaseChart c)
Method Detail

getWeight

public double getWeight()
Performs an Exponential average based on its DataSource values.

The formula used is:

ExpAverage ( point ) = ExpAverage ( previous point ) * ( 1 - Weight ) + Weight * PointValue
Default value: 0.2

Returns:
double

setWeight

public void setWeight(double value)
               throws ChartException
Performs an Exponential average based on its DataSource values.

Default value: 0.2D

Parameters:
value - double
Throws:
TeeChartException
ChartException
See Also:
getWeight()

calculate

public double calculate(Series s,
                        int firstIndex,
                        int lastIndex)
Performs function operation on SourceSeries series.
First and Last parameters are ValueIndex of first and last point used in calculation.
You can override Calculate function to perform customized calculation on one SourceSeries.

Overrides:
calculate in class Function
Parameters:
s - Series
firstIndex - int
lastIndex - int
Returns:
double

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Function
Returns:
String