com.exponto.jstock.indicators
Class MAParameters

java.lang.Object
  |
  +--com.exponto.jstock.indicators.IndicatorParameters
        |
        +--com.exponto.jstock.indicators.MAParameters
All Implemented Interfaces:
IndicatorParametersInterface

public class MAParameters
extends IndicatorParameters

Contains Moving Average specific parameters used in computation of an indicator series. It may also be used by related indicators using the same kind of parameters. Parameter name (for propertiies file) may be specified in the Constructor.

Author:
kaare

Constructor Summary
MAParameters()
           
MAParameters(int days)
           
MAParameters(int days, java.lang.String propName, java.lang.String label, java.lang.String toolTipString)
           
 
Method Summary
 boolean drawThis()
          Checks if the parameters settings of this indicator indicates that the Indicator is activated (e.g.
 int getNumberOfDays()
           
 java.lang.String[] getParameterNames()
           
 int[] getParameters()
           
 javax.swing.JComponent[][] getUserInterface()
          Provides the Options menu with components to use for this indicator.
 void setNumberOfDays(int i)
           
 void setParameters(int[] parameters)
           
 void setParameters(int index, int value)
           
 void updateParameters()
          Used to update the parameters value within the IndicatorParameter class.
 
Methods inherited from class com.exponto.jstock.indicators.IndicatorParameters
getValidFrom, getValidTo, setValidFrom, setValidTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MAParameters

public MAParameters()

MAParameters

public MAParameters(int days)

MAParameters

public MAParameters(int days,
                    java.lang.String propName,
                    java.lang.String label,
                    java.lang.String toolTipString)
Method Detail

getParameters

public int[] getParameters()
Specified by:
getParameters in class IndicatorParameters

setParameters

public void setParameters(int[] parameters)
Specified by:
setParameters in class IndicatorParameters
Parameters:
parameters -

setParameters

public void setParameters(int index,
                          int value)
Specified by:
setParameters in class IndicatorParameters
Parameters:
index -
value -

getParameterNames

public java.lang.String[] getParameterNames()
Specified by:
getParameterNames in class IndicatorParameters

getNumberOfDays

public int getNumberOfDays()
Returns:
the number of days used in the Moving Average calculation

setNumberOfDays

public void setNumberOfDays(int i)
Parameters:
i - the number of days used in the Moving Average calculation

getUserInterface

public javax.swing.JComponent[][] getUserInterface()
Description copied from class: IndicatorParameters
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
Specified by:
getUserInterface in class IndicatorParameters
Returns:
an JComponent array with the components that shall be displayed

drawThis

public boolean drawThis()
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:
drawThis in interface IndicatorParametersInterface
Specified by:
drawThis in class IndicatorParameters
Returns:
true this indicator shall be drawn (based on the parameters setting). False otherwise

updateParameters

public void updateParameters()
Description copied from interface: IndicatorParametersInterface
Used to update the parameters value within the IndicatorParameter class.

Specified by:
updateParameters in interface IndicatorParametersInterface
Specified by:
updateParameters in class IndicatorParameters


Copyright © 2004 Kaare Ranum