Raptor.ProgramParser.Statements
Class If

java.lang.Object
  extended by Raptor.ProgramParser.Statements.Instruction
      extended by Raptor.ProgramParser.Statements.If
All Implemented Interfaces:
java.io.Serializable

public class If
extends Instruction

An if instruction.
Extends abstract Instruction class.

See Also:
Serialized Form

Constructor Summary
If(Formula pCondition, Statements pThenBranch, Statements pElseBranch)
          Constructs a new If instruction.
 
Method Summary
 java.lang.String clashes(PanSignature pSignature)
          Returns a String containing an Error character if this Formula clashes with the passed PanSignature, Otherwise it will return an Empty String ""
An If Statement clashes with a signature if any of its condition, if branch or else branch clash with the signature.
 java.lang.String display()
          Returns a String to display the if instruction.
 Formula getCondition()
          Returns the boolean condition of the if instruction.
 Statements getElse()
          Returns the code for the else part of the if instruction.
 Statements getThen()
          Returns the code for the then part of the if instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

If

public If(Formula pCondition,
          Statements pThenBranch,
          Statements pElseBranch)
Constructs a new If instruction.

Parameters:
pCondition - the boolean condition formula of the if instruction
pThenBranch - the code for the then part of the if statement
pElseBranch - the code for the else part of the if statement
Method Detail

getCondition

public Formula getCondition()
Returns the boolean condition of the if instruction.


getThen

public Statements getThen()
Returns the code for the then part of the if instruction.


getElse

public Statements getElse()
Returns the code for the else part of the if instruction.


display

public java.lang.String display()
Returns a String to display the if instruction.

Specified by:
display in class Instruction

clashes

public java.lang.String clashes(PanSignature pSignature)
Returns a String containing an Error character if this Formula clashes with the passed PanSignature, Otherwise it will return an Empty String ""
An If Statement clashes with a signature if any of its condition, if branch or else branch clash with the signature.

Specified by:
clashes in class Instruction
Parameters:
pSignature - PanSignature represents the PanSignature to be checked if this Formula clashes with.