com.steema.teechart.functions
Class BaseTrend

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.functions.Function
          extended by com.steema.teechart.functions.BaseTrend
Direct Known Subclasses:
Correlation, Trend

public class BaseTrend
extends Function

Title: BaseTrend class

Description: Internal use. Base class for different trend functions.

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
BaseTrend()
           
BaseTrend(IBaseChart c)
           
 
Method Summary
 double calculate(Series s, int firstIndex, int lastIndex)
          Performs function operation on SourceSeries series.
protected  void calculateAllPoints(Series source, ValueList notMandatorySource)
           
 double calculateMany(java.util.Vector sourceSeriesList, int valueIndex)
          Performs function operation on list of series (SourceSeriesList).
protected  void calculatePeriod(Series source, double tmpX, int firstIndex, int lastIndex)
           
 com.steema.teechart.functions.BaseTrend.CalcTrend calculateTrend(Series s, int firstIndex, int lastIndex)
          Calculates trend line parameters m and b, where y=m*x+b
protected  double coefficient(Series s, int firstIndex, int lastIndex)
          Calculates trendline first order parameter
 TrendStyle getTrendStyle()
          Method used for calculating trendline.
 void setTrendStyle(TrendStyle value)
          Defines different methods for calculating trendline.
 
Methods inherited from class com.steema.teechart.functions.Function
addFunctionXY, addPoints, calculateByPeriod, clear, dispose, doCalculation, getDescription, 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

BaseTrend

public BaseTrend()

BaseTrend

public BaseTrend(IBaseChart c)
Method Detail

getTrendStyle

public TrendStyle getTrendStyle()
Method used for calculating trendline.
Default value: TrendStyle.Normal

Returns:
TrendStyle

setTrendStyle

public void setTrendStyle(TrendStyle value)
Defines different methods for calculating trendline.
Default value: TrendStyle.Normal

Parameters:
value - TrendStyle

calculate

public double calculate(Series s,
                        int firstIndex,
                        int lastIndex)
Description copied from class: Function
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

calculateMany

public double calculateMany(java.util.Vector sourceSeriesList,
                            int valueIndex)
Description copied from class: Function
Performs function operation on list of series (SourceSeriesList).
The ValueIndex parameter defines ValueIndex of point in each Series in list.
You can override CalculateMany function to perform customized calculation on list of SourceSeries.

Overrides:
calculateMany in class Function
Parameters:
sourceSeriesList - ArrayList
valueIndex - int
Returns:
double

coefficient

protected double coefficient(Series s,
                             int firstIndex,
                             int lastIndex)
Calculates trendline first order parameter

Parameters:
s - Series
firstIndex - int
lastIndex - int
Returns:
double trendline parameter

calculatePeriod

protected void calculatePeriod(Series source,
                               double tmpX,
                               int firstIndex,
                               int lastIndex)
Overrides:
calculatePeriod in class Function

calculateAllPoints

protected void calculateAllPoints(Series source,
                                  ValueList notMandatorySource)
Overrides:
calculateAllPoints in class Function

calculateTrend

public com.steema.teechart.functions.BaseTrend.CalcTrend calculateTrend(Series s,
                                                                        int firstIndex,
                                                                        int lastIndex)
Calculates trend line parameters m and b, where y=m*x+b

Parameters:
s - Series
firstIndex - int
lastIndex - int
Returns:
CalcTrend