uk.org.ogsadai.client.toolkit.activities.block
Class RandomSplit

java.lang.Object
  extended by uk.org.ogsadai.client.toolkit.activity.BaseActivity
      extended by uk.org.ogsadai.client.toolkit.activities.block.RandomSplit
All Implemented Interfaces:
Activity, RequestAndStatusHandler

public class RandomSplit
extends BaseActivity

An activity that splits an input into N random partitions. The partitions are not necessarily of the same size. A random seed may be provided so that a particular partitioning can be reproduced.

Activity inputs:

Activity outputs:

Expected name of activity on server:

Activity input/output ordering:

Activity contracts: none.

Behaviour:

Author:
The OGSA-DAI Project Team.

Field Summary
static ActivityName DEFAULT_NAME
          Default activity name
 
Constructor Summary
RandomSplit()
          Constructs a new activity.
RandomSplit(ActivityName activityName)
          Constructs a new activity with a user-provided name.
 
Method Summary
 void addInput(boolean input)
          Adds a boolean to the input.
 void addInput(java.lang.Boolean input)
          Adds a Boolean to the input.
 void addInput(byte[] input)
          Adds a byte array to the input.
 void addInput(java.util.Calendar input)
          Adds a Time to the input.
 void addInput(char[] input)
          Adds a char array to the input.
 void addInput(java.util.Date input)
          Adds a Date to the input.
 void addInput(double input)
          Adds a double to the input.
 void addInput(java.lang.Double input)
          Adds a Double to the input.
 void addInput(float input)
          Adds a float to the input.
 void addInput(java.lang.Float input)
          Adds a Float to the input.
 void addInput(int input)
          Adds an int to the input.
 void addInput(java.lang.Integer input)
          Adds an Integer to the input.
 void addInput(long input)
          Adds a long to the input.
 void addInput(java.lang.Long input)
          Adds a Long to the input.
 void addInput(java.lang.String input)
          Adds a String to the input.
 void addListBeginToInput()
          Adds list start marker
 void addListEndToInput()
          Adds list end marker
 void addRandomSeed(long seed)
          Adds a random seed to configure the random generator.
 void connectDataInput(SingleActivityOutput output)
          Connects the data input to the given output.
 void connectRandomSeedInput(SingleActivityOutput output)
          Connects the data input to the given output.
protected  ActivityInput[] getInputs()
          Gets the inputs associated with the activity.
 SingleActivityOutput getOutput(int index)
          Returns the data output at the index.
protected  ActivityOutput[] getOutputs()
          Gets the outputs associated with the activity.
 void setNumberOfOutputs(int count)
          Sets number of outputs.
protected  void validateIOState()
          Validates the state of the activity inputs and outputs.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.BaseActivity
buildRequest, getActivityName, getConnectedOutputs, getErrorMessages, getInputDescriptors, getInstanceName, getRequestAndStatusHandler, getServer, getStatus, getWarnings, hasErrorMessages, hasWarnings, processRequestStatus, setActivityName, setServer, toString, validateState, writeToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final ActivityName DEFAULT_NAME
Default activity name

Constructor Detail

RandomSplit

public RandomSplit()
Constructs a new activity.


RandomSplit

public RandomSplit(ActivityName activityName)
Constructs a new activity with a user-provided name.

Parameters:
activityName -
Method Detail

getInputs

protected ActivityInput[] getInputs()
Description copied from class: BaseActivity
Gets the inputs associated with the activity. All the inputs including not operational optional inputs will be returned.

Specified by:
getInputs in class BaseActivity
Returns:
the inputs associated with the activity.

getOutputs

protected ActivityOutput[] getOutputs()
Description copied from class: BaseActivity
Gets the outputs associated with the activity. All the outputs including unconnected optional outputs will be returned.

Specified by:
getOutputs in class BaseActivity
Returns:
the outputs associated with the activity.

validateIOState

protected void validateIOState()
                        throws ActivityIOIllegalStateException
Description copied from class: BaseActivity
Validates the state of the activity inputs and outputs.

Specified by:
validateIOState in class BaseActivity
Throws:
ActivityIOIllegalStateException - if an activity input is not in a valid state.

setNumberOfOutputs

public void setNumberOfOutputs(int count)
Sets number of outputs. There must be at least 2 outputs.

Parameters:
count - number of data outputs

addInput

public void addInput(java.lang.String input)
Adds a String to the input.

Parameters:
input - String value to add to input.

addInput

public void addInput(char[] input)
Adds a char array to the input.

Parameters:
input - the input

addInput

public void addInput(byte[] input)
Adds a byte array to the input.

Parameters:
input - the input

addInput

public void addInput(java.lang.Float input)
Adds a Float to the input.

Parameters:
input - the input

addInput

public void addInput(float input)
Adds a float to the input.

Parameters:
input - the input

addInput

public void addInput(java.lang.Double input)
Adds a Double to the input.

Parameters:
input - the input

addInput

public void addInput(double input)
Adds a double to the input.

Parameters:
input - the input

addInput

public void addInput(java.lang.Integer input)
Adds an Integer to the input.

Parameters:
input - the input

addInput

public void addInput(int input)
Adds an int to the input.

Parameters:
input - the input

addInput

public void addInput(java.lang.Long input)
Adds a Long to the input.

Parameters:
input - the input

addInput

public void addInput(long input)
Adds a long to the input.

Parameters:
input - the input

addInput

public void addInput(java.lang.Boolean input)
Adds a Boolean to the input.

Parameters:
input - the input

addInput

public void addInput(boolean input)
Adds a boolean to the input.

Parameters:
input - the input

addInput

public void addInput(java.util.Date input)
Adds a Date to the input.

Parameters:
input - the input

addInput

public void addInput(java.util.Calendar input)
Adds a Time to the input.

Parameters:
input - the input

addListBeginToInput

public void addListBeginToInput()
Adds list start marker


addListEndToInput

public void addListEndToInput()
Adds list end marker


connectDataInput

public void connectDataInput(SingleActivityOutput output)
Connects the data input to the given output.

Parameters:
output -

addRandomSeed

public void addRandomSeed(long seed)
Adds a random seed to configure the random generator.

Parameters:
seed -

connectRandomSeedInput

public void connectRandomSeedInput(SingleActivityOutput output)
Connects the data input to the given output.

Parameters:
output -

getOutput

public SingleActivityOutput getOutput(int index)
Returns the data output at the index.

Parameters:
index - index of the output
Returns:
data output