com.exponto.jstock.gui.chartinfo
Class Rule

java.lang.Object
  extended bycom.exponto.jstock.gui.chartinfo.Rule

public class Rule
extends java.lang.Object

The Rule class contains data for one rule. Each rule consist of a name and two logical subexpressions. The two subexpressions is always tied together with a logical AND, so both has to be true if the rule shall evalute to true. The second subexpression may be empty and is then considered to be true. The class is responible to collect any data it need to evalute it self.

Author:
ttranu

Constructor Summary
Rule()
           
Rule(java.lang.String name)
           
Rule(java.lang.String name, java.lang.String fInd, java.lang.String fOp, java.lang.Double fThr, java.lang.String sInd, java.lang.String sOp, java.lang.Double sThr)
           
 
Method Summary
 boolean evalute()
          Evaluates a rule with a given input parameter.
static java.lang.String[] getColumnNames()
           
 java.lang.String getFirstIndicator()
           
 java.lang.String getFirstOperator()
           
 java.lang.Double getFirstThreshold()
           
static java.lang.String[] getIndicators()
           
static java.lang.String[] getOperators()
           
 java.lang.String[] getRule()
           
 java.lang.String getRuleName()
           
 java.lang.String getSecondIndicator()
           
 java.lang.String getSecondOperator()
           
 java.lang.Double getSecondThreshold()
           
 void setFirstIndicator(java.lang.String firstIndicator)
           
 void setFirstOperator(java.lang.String firstOperator)
           
 void setFirstThreshold(java.lang.Double firstThreshold)
           
 void setRuleName(java.lang.String ruleName)
           
 void setSecondIndicator(java.lang.String secondIndicator)
           
 void setSecondOperator(java.lang.String secondOperator)
           
 void setSecondThreshold(java.lang.Double secondThreshold)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rule

public Rule()

Rule

public Rule(java.lang.String name)

Rule

public Rule(java.lang.String name,
            java.lang.String fInd,
            java.lang.String fOp,
            java.lang.Double fThr,
            java.lang.String sInd,
            java.lang.String sOp,
            java.lang.Double sThr)
Method Detail

evalute

public boolean evalute()
Evaluates a rule with a given input parameter. Note that the first subexpression is default set to false and the second is set to true. The if all or some of the parameters of the second subexpression are null, the subexpression isn't evaluated and the default is used.

Returns:
boolean true if the rule evalutes to true, false otherwise

getRule

public java.lang.String[] getRule()
Returns:
Returns the complete rule as a String[]

getColumnNames

public static java.lang.String[] getColumnNames()

getOperators

public static java.lang.String[] getOperators()

getIndicators

public static java.lang.String[] getIndicators()

getFirstIndicator

public java.lang.String getFirstIndicator()
Returns:
Returns the firstIndicator.

setFirstIndicator

public void setFirstIndicator(java.lang.String firstIndicator)
Parameters:
firstIndicator - The firstIndicator to set.

getFirstOperator

public java.lang.String getFirstOperator()
Returns:
Returns the firstOperator.

setFirstOperator

public void setFirstOperator(java.lang.String firstOperator)
Parameters:
firstOperator - The firstOperator to set.

getFirstThreshold

public java.lang.Double getFirstThreshold()
Returns:
Returns the firstThreshold.

setFirstThreshold

public void setFirstThreshold(java.lang.Double firstThreshold)
Parameters:
firstThreshold - The firstThreshold to set.

getRuleName

public java.lang.String getRuleName()
Returns:
Returns the ruleName.

setRuleName

public void setRuleName(java.lang.String ruleName)
Parameters:
ruleName - The ruleName to set.

getSecondIndicator

public java.lang.String getSecondIndicator()
Returns:
Returns the secondIndicator.

setSecondIndicator

public void setSecondIndicator(java.lang.String secondIndicator)
Parameters:
secondIndicator - The secondIndicator to set.

getSecondOperator

public java.lang.String getSecondOperator()
Returns:
Returns the secondOperator.

setSecondOperator

public void setSecondOperator(java.lang.String secondOperator)
Parameters:
secondOperator - The secondOperator to set.

getSecondThreshold

public java.lang.Double getSecondThreshold()
Returns:
Returns the secondThreshold.

setSecondThreshold

public void setSecondThreshold(java.lang.Double secondThreshold)
Parameters:
secondThreshold - The secondThreshold to set.


Copyright © 2004 Kaare Ranum