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

java.lang.Object
  extended byuk.org.ogsadai.client.toolkit.activity.RequestComponent
      extended byuk.org.ogsadai.client.toolkit.activity.Activity
          extended byuk.org.ogsadai.client.toolkit.activity.transform.FrequencyDistributor

public class FrequencyDistributor
extends Activity

This activity distributes a sequence of numeric values into spaces that are defined by a sequence of numeric values. The activity has one input - a sequence of numeric values - and one output - a sequence of values representing the frequency distribution of the input values.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.lang.String mPointsValues
          The spaces over whish the input values will be distributed.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
FrequencyDistributor(ActivityOutput input, java.lang.String pointsValues)
          Constructor.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 int[] getDistribution()
           
 ActivityOutput getOutput()
          Gets the activity output - the frequency distribution.
 void setInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to be sampled.
 
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

mPointsValues

private java.lang.String mPointsValues
The spaces over whish the input values will be distributed.

Constructor Detail

FrequencyDistributor

public FrequencyDistributor(ActivityOutput input,
                            java.lang.String pointsValues)
Constructor.

Parameters:
input - Output from another activity which provides the data to be sampled.
pointsValues - Sequence of numeric values that define the spaces over which the input values will be distributed. This is a list of one or more integers separated by ,.
Throws:
java.lang.IllegalArgumentException - If input or pointsValues are null.
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 sampled.

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

getOutput

public ActivityOutput getOutput()
Gets the activity output - the frequency distribution.

Returns:
the activity output

getDistribution

public int[] getDistribution()
                      throws NoActivityOutputException,
                             DataFormatException
Returns:
int[] An array with the distribution values.
Throws:
NoActivityOutputException
DataFormatException

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