net.scheinerman.phoenix.interpreter
Class Condition

java.lang.Object
  extended by net.scheinerman.phoenix.interpreter.Condition

public class Condition
extends java.lang.Object

This class serves to encapsulate a condition in an if / else / else if block. This is used by the IfInterpreter class to determine what code to execute in an if block. The class has a condition, associated code, and a starting line number.

Since:
1.5
Version:
1.0
Author:
Jonah Scheinerman
See Also:
IfInterpreter}

Field Summary
private  java.lang.String code
          The code to be executed if this condition is met.
private  java.lang.String condition
          The condition to evaluate whether or not this condition should be executed.
private  int line
          The starting line of the code to be executed.
 
Constructor Summary
Condition(java.lang.String condition, java.lang.String code, int line)
          Instantiates a new condition, with the condition phrase, the associated code, and the starting line number.
 
Method Summary
 java.lang.String getCode()
           
 java.lang.String getCondition()
           
 int getLine()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

condition

private java.lang.String condition
The condition to evaluate whether or not this condition should be executed.


code

private java.lang.String code
The code to be executed if this condition is met.


line

private int line
The starting line of the code to be executed.

Constructor Detail

Condition

public Condition(java.lang.String condition,
                 java.lang.String code,
                 int line)
Instantiates a new condition, with the condition phrase, the associated code, and the starting line number.

Parameters:
condition - - The phrase of code determining whether or not this condition is true or false.
code - - The code to be executed if this condition is used.
line - - The starting line of the code to be executed.
Method Detail

getCondition

public java.lang.String getCondition()
Returns:
The condition to evaluate whether or not this condition should be executed.

getCode

public java.lang.String getCode()
Returns:
The code to be executed if this condition is met.

getLine

public int getLine()
Returns:
The starting line of the code to be executed.