Pandora
Class RuleController

java.lang.Object
  extended by Pandora.RuleController

public class RuleController
extends java.lang.Object

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


Constructor Summary
RuleController()
          Constructs a RuleController.
 
Method Summary
 void addFirstLine(ProofLine line)
          Takes the first selected line and stores it in currentLine.
 void addRule(java.lang.String rule)
          Creates a NDRuleController.
 boolean apply()
          First call adds the currentLine to the currentRule.
 void exitRule()
          Called when rule execution failed or the rule finished execution.
 boolean lineSelected(ProofLine line)
          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 rule)
Creates a NDRuleController.
Must be called after addFirstLine() so that currentLine exists.

Parameters:
rule - String representing the selected Rule

exitRule

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


addFirstLine

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

Parameters:
line - ProofLine which is the first line selected

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(ProofLine line)
                     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:
line - ProofLine representing the selected line
Throws:
java.lang.Exception