uk.org.ogsadai.activity.sql.parameters
Class ParameterList

java.lang.Object
  |
  +--uk.org.ogsadai.activity.sql.parameters.ParameterList

public class ParameterList
extends java.lang.Object

Class managing input to all the parameters of a parameterised SQL statement.

Author:
The OGSA-DAI Project Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  int mClosedStreams
          Number of these that take their inputs from streams (those are not ValueInputs and that are closed).
private  boolean mFinishedProcessing
          Have all parameters produced all their values (default false).
private  int mNumStreams
          Number of these that take their inputs from streams (those that are not ValueInputs).
private  ParameterInput[] mParameters
          Parameter list
 
Constructor Summary
ParameterList(int length)
          Constructs a new parameter list.
 
Method Summary
 boolean allStreamsClosed()
          Indicates whether all parameters that receive their inputs from streams are closed - all parameters have provided all their values.
 void countNumStreams()
          Count the number of parameters that receive their inputs from streams and store this value.
 int getLength()
          Gets the length of this parameter list.
 ParameterInput getParameter(int i)
          Gets the parameter at a specific position
 java.lang.Object getParameterObject(int i)
          Returns the next value of a specific parameter
 void initialise(ActivityContext context)
          Initialises the parameters in this list.
 void setParameter(int i, ParameterInput parameter)
          Sets a specific parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mParameters

private ParameterInput[] mParameters
Parameter list


mNumStreams

private int mNumStreams
Number of these that take their inputs from streams (those that are not ValueInputs).


mClosedStreams

private int mClosedStreams
Number of these that take their inputs from streams (those are not ValueInputs and that are closed).


mFinishedProcessing

private boolean mFinishedProcessing
Have all parameters produced all their values (default false).

Constructor Detail

ParameterList

public ParameterList(int length)
Constructs a new parameter list. Parameters are numbered from 1 to length.

Parameters:
length - Length of the parameter list
Method Detail

initialise

public void initialise(ActivityContext context)
                throws MissingParametersException,
                       ParameterSetupException
Initialises the parameters in this list.

Parameters:
context - Activity context
Throws:
MissingParametersException - If a parameter in the list is null.
ParameterSetupException - If there is a problem when initialising a parameter.

allStreamsClosed

public boolean allStreamsClosed()
                         throws MissingParametersException
Indicates whether all parameters that receive their inputs from streams are closed - all parameters have provided all their values.

Returns:
true if all parameters have provided all their values.
Throws:
MissingParametersException - If a stream-based parameter has not provided all its values but others have.

getParameter

public ParameterInput getParameter(int i)
Gets the parameter at a specific position

Parameters:
i - Position
Returns:
a parameter input

getParameterObject

public java.lang.Object getParameterObject(int i)
                                    throws ParameterAccessException
Returns the next value of a specific parameter

Parameters:
i - Position of the parameter in the list
Returns:
an object or null if the parameter input was closed.
Throws:
ParameterAccessException - If there was a problem encountered when accessing the values.

setParameter

public void setParameter(int i,
                         ParameterInput parameter)
Sets a specific parameter.

Parameters:
i - Position
parameter - Parameter

getLength

public int getLength()
Gets the length of this parameter list.

Returns:
length of the parameter list

countNumStreams

public void countNumStreams()
Count the number of parameters that receive their inputs from streams and store this value.