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

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

public class RuntimeArgumentSequence
extends java.lang.Object

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

See Also:
CompositeTransformation,

A RuntimeArgumentSequence object represents a sequence of RuntimeArgument objects, i,e, run-time arguments. RuntimeArgument objects can be created using the createArgument method defined in this class. 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 and sequences outside a template transformation's execution, except when creating the arguments for a transformation's invocation (start the template transfomation's execution).


Constructor Summary
RuntimeArgumentSequence()
          Constructs a new RuntimeArgumentSequence without any RuntimeArgument objects
 
Method Summary
 RuntimeArgument createArgument(int position, java.lang.String value)
          Constructs a new RuntimeArgument and adds it to this RuntimeArgumentSequence.
 RuntimeArgument getArgumentAt(int position)
          Returns a particular RuntimeArgument in this RuntimeArgumentSequence.
 RuntimeArgument[] getArguments()
          Returns an array of all the RuntimeArguments in this RuntimeArgumentSequence.
static RuntimeArgumentSequence getRuntimeArgumentSequence(int sequenceId)
          Returns the reference to the RuntimeArgumentSequence with the given ID.
static RuntimeArgumentSequence[] getRuntimeArgumentSequences()
          Returns an array of all RuntimeArgumentSequence objects that have RuntimeArgument objects.
 int getSequenceId()
          Returns the sequence ID of this RuntimeArgumentSequence.
 void print()
           
 void remove()
          Removes this RuntimeArgumentSequence.
 void removeArgument(int position)
          Removes a particular argument from this RuntimeArgumentSequence.
static void removeRuntimeArgumentSequence(int sequenceId)
          Removes a RuntimeArgumentSequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeArgumentSequence

public RuntimeArgumentSequence()
Constructs a new RuntimeArgumentSequence without any RuntimeArgument objects

Method Detail

removeRuntimeArgumentSequence

public static void removeRuntimeArgumentSequence(int sequenceId)
                                          throws TemplateExecutionRepositoryException,
                                                 RepositoryAccessException
Removes a RuntimeArgumentSequence.

Parameters:
sequenceId - ID of the sequence of arguments to remove.
Throws:
TemplateExecutionRepositoryException - see TemplateExecutionRepository.removeArguments(int) and remove()
RepositoryAccessException - if the repositories cannot be accessed

remove

public void remove()
            throws TemplateExecutionRepositoryException,
                   RepositoryAccessException
Removes this RuntimeArgumentSequence.

Throws:
TemplateExecutionRepositoryException - see RuntimeArgument.remove()
RepositoryAccessException - if the repositories cannot be accessed

getRuntimeArgumentSequences

public static RuntimeArgumentSequence[] getRuntimeArgumentSequences()
                                                             throws RepositoryAccessException,
                                                                    AutoRepException
Returns an array of all RuntimeArgumentSequence objects that have RuntimeArgument objects. Returns null if no argument sequences exist in the TER.

Returns:
an array of all RuntimeArgumentSequence objects.
Throws:
RepositoryAccessException - if the repositories cannot be accessed
AutoRepException - if an illegal sequenceId is found

getRuntimeArgumentSequence

public static RuntimeArgumentSequence getRuntimeArgumentSequence(int sequenceId)
                                                          throws AutoRepException,
                                                                 RepositoryAccessException
Returns the reference to the RuntimeArgumentSequence with the given ID. Returns null of no records of the specified sequenceId exists in the TER.

Parameters:
sequenceId - ID of the argument sequence.
Returns:
the reference to the argument sequence with the given ID.
Throws:
AutoRepException - if sequenceId is illegal
RepositoryAccessException - if the repositories cannot be accessed

getSequenceId

public int getSequenceId()
Returns the sequence ID of this RuntimeArgumentSequence.


getArguments

public RuntimeArgument[] getArguments()
Returns an array of all the RuntimeArguments in this RuntimeArgumentSequence.

Returns:
an array of all the RuntimeArguments in this RuntimeArgumentSequence.

createArgument

public RuntimeArgument createArgument(int position,
                                      java.lang.String value)
                               throws TemplateExecutionRepositoryException,
                                      RepositoryAccessException
Constructs a new RuntimeArgument and adds it to this RuntimeArgumentSequence.

Parameters:
position - the position in the new argument sequence
value - value of this argument.
Returns:
reference to the new RuntimeArgument.
Throws:
TemplateExecutionRepositoryException - see RuntimeArgument.RuntimeArgument(int, String) and RuntimeArgument.RuntimeArgument(int, int, String)
RepositoryAccessException - if the repositories cannot be accessed

getArgumentAt

public RuntimeArgument getArgumentAt(int position)
                              throws AutoRepException
Returns a particular RuntimeArgument in this RuntimeArgumentSequence.

Parameters:
position - the position in the argument sequence.
Returns:
the RuntimeArgument specified by the given position
Throws:
AutoRepException - if the specified position doesn't exist in this RuntimeArgumentSequence
RepositoryAccessException - if the repositories cannot be accessed

removeArgument

public void removeArgument(int position)
                    throws TemplateExecutionRepositoryException,
                           AutoRepException,
                           RepositoryAccessException
Removes a particular argument from this RuntimeArgumentSequence.

Parameters:
position - the position to be removed from the argument sequence.
Throws:
AutoRepException - see getArgumentAt(int)
TemplateExecutionRepositoryException - see RuntimeArgument.remove()
RepositoryAccessException - if the repositories cannot be accessed

print

public void print()
           throws TemplateExecutionRepositoryException,
                  RepositoryAccessException
TemplateExecutionRepositoryException
RepositoryAccessException