uk.ac.ic.doc.automed.reps
Class StatementExecution

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.reps.StatementExecution

public class StatementExecution
extends java.lang.Object

The class used to define a template transformation's program.

See Also:

A StatementExecution object is used to define the statement that is going to be invoked during a template transformation's execution at a specific time in the execution (program counter) and the sequence of arguments that is going to be used for the statement's invocation. StatementExecution objects can be created through a CompositeTransformation object.


Constructor Summary
protected StatementExecution(int transId, int pc, Statement stmnt, TemplateArgumentSequence args)
          Constructs a new StatementExecution.
 
Method Summary
 TemplateArgumentSequence getArgumentSequence()
          Returns the TemplateArgumentSequence of this StatementExecution.
 int getPc()
          Returns the program counter of this StatementExecution.
 Statement getStatement()
          Returns the Statement of this StatementExecution.
protected static java.util.ArrayList getStatementExecutionsForTransformation(int transId)
          Returns all the StatementExecution objects of the specified composite transformation.
 int getTransId()
          Returns the transformation identifier of the composite transformation this StatementExecution belongs to.
 void print()
           
protected  void remove()
          Removes this StatementExecution from the TTR.
 void setArgumentSequence(TemplateArgumentSequence args)
          Sets the TemplateArgumentSequence of this StatementExecution
 void setStatement(Statement stmnt)
          Sets the Statement of this StatementExecution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementExecution

protected StatementExecution(int transId,
                             int pc,
                             Statement stmnt,
                             TemplateArgumentSequence args)
                      throws TemplateTransformationRepositoryException,
                             RepositoryAccessException
Constructs a new StatementExecution.

Parameters:
transId - ID of the composite transformation this StatementExecution belongs to.
pc - the program counter in the transformation's program that this StatementExecution will take place.
stmnt - the Statement that is going to be executed
args - the arguments that are going to be used for the statement's execution
Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.createCompositeTransformationProgram(int, int, int, int)
RepositoryAccessException - if the repositories cannot be accessed
Method Detail

getStatement

public Statement getStatement()
                       throws TemplateTransformationRepositoryException,
                              TemplateTransformationSyntaxRepositoryException,
                              RepositoryAccessException
Returns the Statement of this StatementExecution.

Returns:
the Statement of this StatementExecution.
Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.getCompositeTransformationProgramStId(int, int)
TemplateTransformationSyntaxRepositoryException - see TemplateTransformationSyntaxRepository.getStatementName(int)
RepositoryAccessException - if the repositories cannot be accessed

getArgumentSequence

public TemplateArgumentSequence getArgumentSequence()
                                             throws TemplateTransformationRepositoryException,
                                                    RepositoryAccessException
Returns the TemplateArgumentSequence of this StatementExecution. Returns null if a sequence hasn't been defined for this StatementExecution.

Returns:
the TemplateArgumentSequence of this StatementExecution.
Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.getCompositeTransformationProgramArgId(int, int)
RepositoryAccessException - if the repositories cannot be accessed

setStatement

public void setStatement(Statement stmnt)
                  throws TemplateTransformationRepositoryException,
                         RepositoryAccessException
Sets the Statement of this StatementExecution.

Parameters:
stmnt - the new Statement of this StatementExecution object
Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.setCompositeTransformationProgramStId(int, int, int)
RepositoryAccessException - if the repositories cannot be accessed

setArgumentSequence

public void setArgumentSequence(TemplateArgumentSequence args)
                         throws TemplateTransformationRepositoryException,
                                RepositoryAccessException
Sets the TemplateArgumentSequence of this StatementExecution

Parameters:
args - the new TemplateArgumentSequence of this StatementExecution
Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.setCompositeTransformationProgramArgId(int, int, int)
RepositoryAccessException - if the repositories cannot be accessed

remove

protected void remove()
               throws TemplateTransformationRepositoryException,
                      RepositoryAccessException
Removes this StatementExecution from the TTR.

Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.removeCompositeTransformationProgram(int, int)
RepositoryAccessException - if the repositories cannot be accessed

getTransId

public int getTransId()
Returns the transformation identifier of the composite transformation this StatementExecution belongs to.

Returns:
transId of this StatementExecution.

getPc

public int getPc()
Returns the program counter of this StatementExecution.

Returns:
program counter of this StatementExecution.

getStatementExecutionsForTransformation

protected static java.util.ArrayList getStatementExecutionsForTransformation(int transId)
                                                                      throws TemplateTransformationRepositoryException,
                                                                             RepositoryAccessException
Returns all the StatementExecution objects of the specified composite transformation. Return null if no program exists in the TTR for the specified composite transformation

Parameters:
transId - ID of composite transformation that the StatementExecution objects will belong to
Returns:
an ArrayList of StatementExecution objects
Throws:
TemplateTransformationRepositoryException - see TemplateTransformationRepository.getCompositeTransformationProgramPcList(int)
RepositoryAccessException - if the repositories cannot be accessed

print

public void print()
           throws TemplateTransformationRepositoryException,
                  TemplateTransformationSyntaxRepositoryException,
                  AutoRepException,
                  RepositoryAccessException
TemplateTransformationRepositoryException
TemplateTransformationSyntaxRepositoryException
AutoRepException
RepositoryAccessException