Raptor
Class RuleController

java.lang.Object
  extended by Raptor.RuleController

public class RuleController
extends java.lang.Object

Calls the correct RuleController when a first line and a rule have been selected.


Constructor Summary
RuleController()
          Constructs a RuleController.
 
Method Summary
 void addFirstLine(ProofItem pLine)
          Takes the first selected line and stores it in currentLine.
 void addRule(java.lang.String pRule)
          Determines whether to create a RAPRuleController or a NDRuleController.
 boolean apply()
          First call adds the currentLine to the currentRule.
 void exitRule()
          Called when rule execution failed or the rule finished execution.
 ProofItem getFirstLine()
          Returns the first selected line
 boolean lineSelected(ProofItem pItem)
          Gives the newly selected lines to the Rule as the extra input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleController

public RuleController()
Constructs a RuleController.

Method Detail

addRule

public void addRule(java.lang.String pRule)
             throws java.lang.Exception
Determines whether to create a RAPRuleController or a NDRuleController.
Must be called after addFirstLine() so that currentLine exists.

Parameters:
pRule - String representing the selected Rule
Throws:
java.lang.Exception

exitRule

public void exitRule()
Called when rule execution failed or the rule finished execution.


addFirstLine

public void addFirstLine(ProofItem pLine)
Takes the first selected line and stores it in currentLine.

Parameters:
pLine - ProofItem which is the first line selected

getFirstLine

public ProofItem getFirstLine()
Returns the first selected line


apply

public boolean apply()
              throws java.lang.Exception
First call adds the currentLine to the currentRule.
Next calls will execute the Rule apply() code once all of the expected input has been received.

When all input has been received:
correctLines() makes sure input lines have been correctly identified.
check() makes sure that the all of the input lines are correct for the rule.
apply() applies the rule.

Returns true if more input lines are expected.

Throws:
java.lang.Exception

lineSelected

public boolean lineSelected(ProofItem pItem)
                     throws java.lang.Exception
Gives the newly selected lines to the Rule as the extra input.
Returns true if more input lines are expected.

Parameters:
pItem - ProofItem representing the selected line
Throws:
java.lang.Exception