com.exponto.jstock.indicators
Class DummyParameters

java.lang.Object
  extended bycom.exponto.jstock.indicators.IndicatorParameters
      extended bycom.exponto.jstock.indicators.DummyParameters
All Implemented Interfaces:
IndicatorParametersInterface

public class DummyParameters
extends IndicatorParameters

Dummy IndicatorParameter for indicators without parameters

Author:
kaare

Field Summary
 
Fields inherited from class com.exponto.jstock.indicators.IndicatorParameters
m_compArray, m_parameterValues, m_validFrom, sm_delimiter, sm_validTo
 
Constructor Summary
DummyParameters()
           
DummyParameters(int days)
           
DummyParameters(int days, java.lang.String propName, java.lang.String label, java.lang.String toolTipString)
           
DummyParameters(java.lang.String s)
           
 
Method Summary
 int[] fromParameterString(java.lang.String s)
          Generates new parameter(s) from a string.
 int getNumberOfDays()
           
 java.lang.String[] getParameterNames()
           
 int[] getParameters()
           
 javax.swing.JComponent[][] getUserInterface()
          Provides the Options menu with components to use for this indicator.
 int hashCode()
          Note: Reach MAXINT after about 7 - 10 parameters depending on the parameter
 boolean indicatorEnabled()
          Checks if the parameters settings of this indicator indicates that the Indicator is activated (e.g.
 void setNumberOfDays(int i)
           
 void setParameters(int[] parameters)
           
 void setParameters(int index, int value)
           
 java.lang.String toParameterString()
          Used to generate a string of the parameter(s) of this instance.
 void updateParameters()
          Used to ensure that indicators parameters are up to date before saving.
 
Methods inherited from class com.exponto.jstock.indicators.IndicatorParameters
equals, getValidFrom, getValidTo, setValidFrom, setValidTo, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DummyParameters

public DummyParameters()

DummyParameters

public DummyParameters(int days)

DummyParameters

public DummyParameters(java.lang.String s)

DummyParameters

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

getParameters

public int[] getParameters()
Overrides:
getParameters in class IndicatorParameters

setParameters

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

setParameters

public void setParameters(int index,
                          int value)
Overrides:
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

indicatorEnabled

public 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
Specified by:
indicatorEnabled in class IndicatorParameters

updateParameters

public 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
Specified by:
updateParameters in class IndicatorParameters

toParameterString

public java.lang.String toParameterString()
Description copied from interface: IndicatorParametersInterface
Used to generate a string of the parameter(s) of this instance. May e.g. be used for persitent storing of the parameters

Returns:
the parameters of the class encoded as a string

fromParameterString

public int[] fromParameterString(java.lang.String s)
Description copied from interface: IndicatorParametersInterface
Generates new parameter(s) from a string. May be used to regenerate parameters stored in db. Also see above.

Parameters:
s - the parameters of the class encoded as a string
Returns:
int [] with the parameter values

hashCode

public int hashCode()
Description copied from class: IndicatorParameters
Note: Reach MAXINT after about 7 - 10 parameters depending on the parameter

Specified by:
hashCode in interface IndicatorParametersInterface
Overrides:
hashCode in class IndicatorParameters


Copyright © 2004 Kaare Ranum