BlockReader data = getInput(INPUT_DATA);
if (data == null)
{
throw new InvalidActivityInputsException(1, INPUT_DATA);
}
ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
dataInput.setBlockReader(data);
inputs.add(dataInput);
// set up block reader for options input
BlockReader options = getInput(INPUT_OPTIONS);
TypedOptionalActivityInput optionsInput =
new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class, DEFAULT_OPTIONS);
optionsInput.setBlockReader(options);
inputs.add(optionsInput);
BlockReader outputFreq = getInput(INPUT_OUTPUT_FREQUENCY);
TypedOptionalActivityInput outputFreqInput =
new TypedOptionalActivityInput(INPUT_OUTPUT_FREQUENCY, Object.class, 100000);
outputFreqInput.setBlockReader(outputFreq);
inputs.add(outputFreqInput);
BlockReader algorithm = getInput(INPUT_ALGORITHM);
TypedOptionalActivityInput algorithmInput =
new TypedOptionalActivityInput(INPUT_ALGORITHM, Object.class, DEFAULT_ALGORITHM);
algorithmInput.setBlockReader(algorithm);
inputs.add(algorithmInput);
// set up block reader for indexes of nominal values columns
BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
TypedOptionalListActivityInput nomValIndexesInput = new TypedOptionalListActivityInput(INPUT_COLUMN_INDICES, Number.class);
if(nomValIndexesInput != null && indexes != null)
nomValIndexesInput.setBlockReader(indexes);
inputs.add(nomValIndexesInput);
// set up inputs for columns with nominal values
List<BlockReader> nomVals = (List<BlockReader>)getInputs(INPUT_NOMINAL_VALUES);
for (BlockReader reader : nomVals)
{
// can be either column index or column name
ActivityInput input = new TypedListActivityInput(INPUT_NOMINAL_VALUES, Object.class);
input.setBlockReader(reader);
inputs.add(input);
}
LOG.debug("InputSize: " + inputs.size());
return inputs.toArray(new ActivityInput[inputs.size()]);
}