|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.toolkit.activity.RequestComponent | +--uk.org.ogsadai.client.toolkit.activity.Activity | +--uk.org.ogsadai.client.toolkit.activity.transform.RandomSample
This activity performs random sampling of a sequence of values it receives as input and delivers these as output. The random sample is selected according to the fraction parameter. A seed can also optionally be provided.
The activity has one input - the values to be sampled - and one output - the sampled values.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private double |
mFraction
Fraction according to which the random sample will be generated |
private boolean |
mIs_seed
Has a seed value been provided? |
private long |
mSeed
Seed value |
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
|
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
|
Constructor Summary | |
RandomSample(ActivityOutput input,
double fraction)
Constructor. |
|
RandomSample(ActivityOutput input,
double fraction,
long seed)
Constructor. |
Method Summary | |
protected java.lang.String |
generateXML()
Generates the XML representing the activity. |
ActivityOutput |
getOutput()
Gets the activity output - the sampled 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 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 |
private static final java.lang.String COPYRIGHT_NOTICE
private double mFraction
private long mSeed
private boolean mIs_seed
Constructor Detail |
public RandomSample(ActivityOutput input, double fraction)
input
- Output from another activity which provides the data to be
sampled.fraction
- Fraction according to which the random sample will be
generated.
java.lang.IllegalArgumentException
- If input
is null
.public RandomSample(ActivityOutput input, double fraction, long seed)
input
- Output from another activity which provides the data to be
sampled.fraction
- Fraction according to which the random sample will be
generated.seed
- Seed value for the random sampling.
java.lang.IllegalArgumentException
- If input
is null
.Method Detail |
public final void setInput(ActivityOutput input)
input
- Output from another activity.
java.lang.IllegalArgumentException
- If input
is null
.public ActivityOutput getOutput()
protected java.lang.String generateXML()
RequestComponent
generateXML
in class Activity
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |