public class Function extends TeeBase
Title: Function class
Description: Basic abstract function class. Examples of derived functions are: Add, Subtract, High, Low, Average and Count.
Copyright (c) 2005-2019 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
Modifier and Type | Field and Description |
---|---|
protected boolean |
canUsePeriod |
protected double |
dPeriod |
boolean |
HideSourceList |
boolean |
noSourceRequired |
protected Series |
series |
boolean |
SingleSource |
protected boolean |
updating |
chart, InternalUse
Constructor and Description |
---|
Function() |
Function(IBaseChart c) |
Modifier and Type | Method and Description |
---|---|
protected void |
addFunctionXY(boolean yMandatorySource,
double tmpX,
double tmpY) |
void |
addPoints(java.util.ArrayList source)
Gets all points from Source series, performs a function operation and
stores results in ParentSeries.
|
double |
calculate(Series source,
int first,
int last)
Performs function operation on SourceSeries series.
First and Last parameters are ValueIndex of first and last point used in calculation. |
protected void |
calculateAllPoints(Series source,
ValueList notMandatorySource) |
protected void |
calculateByPeriod(Series source,
ValueList notMandatorySource) |
double |
calculateMany(java.util.ArrayList sourceSeries,
int valueIndex)
Performs function operation on list of series (SourceSeriesList).
The ValueIndex parameter defines ValueIndex of point in each Series in list. |
protected void |
calculatePeriod(Series source,
double tmpX,
int firstIndex,
int lastIndex) |
void |
clear() |
void |
dispose() |
protected void |
doCalculation(Series source,
ValueList notMandatorySource) |
java.lang.String |
getDescription()
Gets descriptive text.
|
double |
getPeriod()
Controls how many points or X range will trigger a new point
calculation.
Zero means all source points. For example, Average function uses the Period property to calculate a new average point each time the "Period" number of points or X range is exceed. |
PeriodAlign |
getPeriodAlign()
Controls where to place function calculations inside the full period
space.
The position of calculation output points within range. When the function Period is greater than zero (so it calculates by groups of points), the function results are added to the series by default at the center position of the Function Period. |
PeriodStyle |
getPeriodStyle()
Controls how the Period property is interpreted.
Either as number of points or as range. Range means Period property is specified in a range of values. |
Series |
getSeries()
Returns the Series parent of Function.
Run-time and read only. |
static Function |
newInstance(java.lang.Class f) |
protected java.lang.Object |
readResolve() |
void |
recalculate()
Performs a checkDataSource method call on parent Series.
Basically, all points in parent Series are recalculated. The recalculating is performed only if internal updating flag is set to false. To make sure updating is set to false, you can call Function endUpdate() method prior to calling Function recalculate. |
void |
setPeriod(double value) |
void |
setPeriodAlign(PeriodAlign value) |
void |
setPeriodStyle(PeriodStyle value) |
void |
setSeries(Series value) |
protected ValueList |
valueList(Series s) |
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
protected double dPeriod
public transient boolean noSourceRequired
protected transient Series series
protected transient boolean updating
protected transient boolean canUsePeriod
public transient boolean SingleSource
public transient boolean HideSourceList
public Function()
public Function(IBaseChart c)
protected java.lang.Object readResolve()
public void dispose()
public static Function newInstance(java.lang.Class f) throws java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.InstantiationException
public double getPeriod()
public void setPeriod(double value)
public Series getSeries()
public void setSeries(Series value)
public PeriodStyle getPeriodStyle()
public void setPeriodStyle(PeriodStyle value)
public PeriodAlign getPeriodAlign()
function1.setPeriodAlign(Center);
// <-- by default is centered
public void setPeriodAlign(PeriodAlign value)
protected void addFunctionXY(boolean yMandatorySource, double tmpX, double tmpY)
protected void calculatePeriod(Series source, double tmpX, int firstIndex, int lastIndex)
public double calculate(Series source, int first, int last)
source
- Seriesfirst
- intlast
- intpublic double calculateMany(java.util.ArrayList sourceSeries, int valueIndex)
sourceSeries
- ArrayListvalueIndex
- intpublic java.lang.String getDescription()
public void addPoints(java.util.ArrayList source)
source
- ArrayListpublic void recalculate()
public void clear()