com.exponto.jstock.indicators
Class IndicatorParameters
java.lang.Object
com.exponto.jstock.indicators.IndicatorParameters
- All Implemented Interfaces:
- IndicatorParametersInterface
- Direct Known Subclasses:
- DummyParameters, MacdParameters, SingleParameterParameters
- public abstract class IndicatorParameters
- extends java.lang.Object
- implements IndicatorParametersInterface
Base class for indicator specific parameters used in computation of an
indicator series.
- Author:
- kaare
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
m_validFrom
protected Date m_validFrom
sm_validTo
protected Date sm_validTo
sm_delimiter
protected java.lang.String sm_delimiter
m_parameterValues
protected int[] m_parameterValues
m_compArray
protected javax.swing.JComponent[][] m_compArray
IndicatorParameters
public IndicatorParameters()
getParameters
public int[] getParameters()
setParameters
public void setParameters(int[] parameters)
- Parameters:
parameters
-
setParameters
public void setParameters(int index,
int value)
- Parameters:
index
- value
-
getParameterNames
public abstract java.lang.String[] getParameterNames()
indicatorEnabled
public abstract boolean indicatorEnabled()
- Description copied from interface:
IndicatorParametersInterface
- Checks if the parameters settings of this indicator indicates that the
Indicator is activated (e.g. number of days used in RSI calcultaion set
to a value larger than 0).
- Specified by:
indicatorEnabled
in interface IndicatorParametersInterface
- Returns:
- true if this indicator shall be drawn (based on the
parameters setting). False otherwise
getUserInterface
public abstract javax.swing.JComponent[][] getUserInterface()
- Provides the Options menu with components to use for this indicator.
The JComponents are responsible for notifying "their" indicator when
values are changed, and also update the properties files.
Note that the receiving class makes a few assumptions on the
content of the array.
- Specified by:
getUserInterface
in interface IndicatorParametersInterface
- Returns:
- an JComponent array with the components that shall be
displayed
updateParameters
public abstract void updateParameters()
- Description copied from interface:
IndicatorParametersInterface
- Used to ensure that indicators parameters are up to date before saving.
Typical implementation will read the parameters values from the user
interface (JComponent [][]) and set the indicators parameters.
- Specified by:
updateParameters
in interface IndicatorParametersInterface
setValidFrom
public void setValidFrom(Date date)
getValidFrom
public Date getValidFrom()
- Returns:
- the first date with valid data for the indicator
setValidTo
public void setValidTo(Date date)
getValidTo
public Date getValidTo()
- Returns:
- the last date with valid data for the indicator
equals
public boolean equals(java.lang.Object o)
hashCode
public int hashCode()
- Note: Reach MAXINT after about 7 - 10 parameters depending on the parameter
- Specified by:
hashCode
in interface IndicatorParametersInterface
toString
public java.lang.String toString()
Copyright © 2004 Kaare Ranum