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

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

public class RuntimeArgument
extends java.lang.Object

The class to create run-time (during a template composite transformation's execution) arguments

See Also:
RuntimeArgumentSequence,

A RuntimeArgument object represents a run-time argument, i.e. an argument created during a template composite transformation's execution. RuntimeArgument objects belong to a RuntimeArgumentSequence and can be created through the sequence object. Run-time arguments have specific values and don't refer to other arguments.

This class shouldn't be used directly, since there is no reason to create run-time arguments outside a template transformation's execution, except when creating the arguments for a transformation's invocation (start the template transfomation's execution).


Constructor Summary
protected RuntimeArgument(int sequenceId, int position, java.lang.String value)
          Constructs a new RuntimeArgument storing the specified value.
protected RuntimeArgument(int position, java.lang.String value)
          Constructs a new RuntimeArgument storing the specified value and creates a new sequence of arguments.
 
Method Summary
protected static java.util.ArrayList getArgumentsForSequence(int sequenceId)
          Returns all RuntimeArgument objects of the specified sequence of arguments.
 int getPosition()
          Returns the position of this RuntimeArgument.
 int getSequenceId()
          Returns the sequence identifier of this RuntimeArgument.
 java.lang.String getValue()
          Returns this RuntimeArgument's value field.
 void print()
           
protected  void remove()
          Removes this RuntimeArgument from the TER.
 void setValue(java.lang.String value)
          Sets the value of this RuntimeArgument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeArgument

protected RuntimeArgument(int sequenceId,
                          int position,
                          java.lang.String value)
                   throws TemplateExecutionRepositoryException,
                          RepositoryAccessException
Constructs a new RuntimeArgument storing the specified value.

Parameters:
sequenceId - ID of the argument sequence this argument belongs to
position - the position of this RuntimeArgument in the sequence
value - value of the RuntimeArgument
Throws:
TemplateExecutionRepositoryException - see TemplateExecutionRepository.createArgument(int, int, String)
RepositoryAccessException - if the repositories cannot be accessed

RuntimeArgument

protected RuntimeArgument(int position,
                          java.lang.String value)
                   throws TemplateExecutionRepositoryException,
                          RepositoryAccessException
Constructs a new RuntimeArgument storing the specified value and creates a new sequence of arguments.

Parameters:
position - the position of this RuntimeArgument in the sequence
value - value of the RuntimeArgument
Throws:
TemplateExecutionRepositoryException - see TemplateExecutionRepository.createFirstArgument(int, String)
RepositoryAccessException - if the repositories cannot be accessed
Method Detail

getValue

public java.lang.String getValue()
                          throws TemplateExecutionRepositoryException,
                                 RepositoryAccessException
Returns this RuntimeArgument's value field.

Throws:
TemplateExecutionRepositoryException - see TemplateExecutionRepository.getArgumentsValue(int, int)
RepositoryAccessException - if the repositories cannot be accessed

setValue

public void setValue(java.lang.String value)
              throws TemplateExecutionRepositoryException,
                     RepositoryAccessException
Sets the value of this RuntimeArgument.

Parameters:
value - the value of this RuntimeArgument
Throws:
TemplateExecutionRepositoryException - see TemplateExecutionRepository.setArgumentsValue(int, int, String) and
RepositoryAccessException - if the repositories cannot be accessed

remove

protected void remove()
               throws TemplateExecutionRepositoryException,
                      RepositoryAccessException
Removes this RuntimeArgument from the TER.

Throws:
TemplateExecutionRepositoryException - see TemplateExecutionRepository.removeArgument(int, int)
RepositoryAccessException - if the repositories cannot be accessed

getSequenceId

public int getSequenceId()
Returns the sequence identifier of this RuntimeArgument.

Returns:
sequenceId of this RuntimeArgument.

getPosition

public int getPosition()
Returns the position of this RuntimeArgument.

Returns:
position of this RuntimeArgument.

print

public void print()
           throws TemplateExecutionRepositoryException,
                  RepositoryAccessException
TemplateExecutionRepositoryException
RepositoryAccessException

getArgumentsForSequence

protected static java.util.ArrayList getArgumentsForSequence(int sequenceId)
                                                      throws RepositoryAccessException
Returns all RuntimeArgument objects of the specified sequence of arguments. Returns null if no arguments exists in the TTR for the specified sequence of arguments.

Parameters:
sequenceId - ID of sequence of arguments that the RuntimeArgument objects will belong to
Returns:
an ArrayList of RuntimeArgument objects
Throws:
RepositoryAccessException - if the repositories cannot be accessed