uk.org.ogsadai.client.toolkit.activity.transform
Class CSVProjection

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.transform.CSVProjection

public class CSVProjection
extends Activity

This is activty performs a projection of CSV values based on a column index.

The activity has one input - the CSV values - and one output the projected values.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  int mColumnNo
          Column to project
private  java.lang.String mDelimiter
          The delimiter separating the CSV values.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
CSVProjection(ActivityOutput input, int columnNo)
          Constructor.
CSVProjection(ActivityOutput input, int columnNo, java.lang.String delimiter)
          Constructor.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getOutput()
          Gets the activity output - the projected CSV values.
 void setInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to be aggregated.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getDataService, getName, getSession, setDataService, setSession
 
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

mColumnNo

private int mColumnNo
Column to project


mDelimiter

private java.lang.String mDelimiter
The delimiter separating the CSV values. The default is a comma ,.

Constructor Detail

CSVProjection

public CSVProjection(ActivityOutput input,
                     int columnNo)
Constructor. The default delimiter - a comma , - is assumed to separate the CSV values.

setInput should be called to set the activity that provides input to this activity.

Parameters:
input - Output from another activity that will provide input to this activity.
Throws:
java.lang.IllegalArgumentException - If input is null or columnNo is <= 0.

CSVProjection

public CSVProjection(ActivityOutput input,
                     int columnNo,
                     java.lang.String delimiter)
Constructor. The default delimiter - a comma , - is assumed to separate the CSV values.

setInput should be called to set the activity that provides input to this activity.

Parameters:
input - Output from another activity that will provide input to this activity.
Throws:
java.lang.IllegalArgumentException - If input or delimiter is null or columNo is < 0.
Method Detail

setInput

public final void setInput(ActivityOutput input)
Sets the input of this activity to be the output from another activity that will provide the data to be aggregated.

Parameters:
input - Output from another activity.
Throws:
java.lang.IllegalArgumentException - If input is null.

getOutput

public ActivityOutput getOutput()
Gets the activity output - the projected CSV values.

Returns:
the activity output

generateXML

protected java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class Activity
Returns:
the XML for the activity