public class Operation
extends java.lang.Object
implements java.util.concurrent.Callable<double[]>
Operation
holds all the information necessary to load data
and perform a user defined action.
An Operation
is formed from a String
that supplies
all required information.
Such a String
must adhere to the following strict format:
tableSourcePath; columnName(s); OperationName(parameter(s), ); delay
.
The various parts are separated by the
operation settings separator
.
This path will be used by the file loader
.
tableSourcePath: the path of the Table
on which
the Operation
is to be performed.
columnName(s): the name(s) of the column(s) on which the
Operation
is to be performed.
Note that only a limited number of Feature
s require multiple
columns to operate on.
All other Operation
s work on a single column at a time, and to
perform such an Operation
on multiple columns, multiple
Operation
s should be created, one for each column.
When multiple columns are listed they should be separated by the
column list separator
.
OperationName(parameter(s), ...): the name of the
Operation
to perform.
It should correspond to the simple name
of a
Class
in either the kernel
or feature
package of the application.
Consult the default constructor for each Class
for the list of
expected parameters.
delay: the delay to take into account. Both positive and
negative integers are allowed, as well as 0
.
Separator
,
Table
,
FileLoader
,
Quickie
,
Class
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
angle_brackets_replacement |
static java.lang.String |
COLUMN_DELIMITER |
static java.lang.String |
comma_replacement |
static java.lang.String |
curly_brackets_replacement |
static java.lang.String |
DELIMITER |
static java.lang.String |
minus_replacement |
static java.lang.String |
point_replacement |
static java.lang.String |
round_brackets_replacement |
static java.lang.String |
square_brackets_replacement |
static java.lang.String |
whitespace_replacement |
Constructor and Description |
---|
Operation(java.lang.String theOperation)
Creates an
Operation from the input parameter. |
Modifier and Type | Method and Description |
---|---|
double[] |
call()
Returns the result for this
Operation . |
java.lang.String |
get(OperationTableModel.OperationTableHeader theColumn)
Returns the value of the
Operation corresponding to the
OperationTableHeader column parameter. |
java.lang.String |
getTablePath()
Returns the
String representation of the
Path of the Table on which the
Operation is to be performed. |
java.lang.String |
toColumnName()
Returns a short
String representation of the
Operation . |
public static final java.lang.String DELIMITER
public static final java.lang.String COLUMN_DELIMITER
public static java.lang.String round_brackets_replacement
public static java.lang.String square_brackets_replacement
public static java.lang.String curly_brackets_replacement
public static java.lang.String angle_brackets_replacement
public static java.lang.String point_replacement
public static java.lang.String comma_replacement
public static java.lang.String minus_replacement
public static java.lang.String whitespace_replacement
public java.lang.String getTablePath()
String
representation of the
Path
of the Table
on which the
Operation
is to be performed.String
representation of the
Path
.Table
,
FileLoader
public java.lang.String toColumnName()
String
representation of the
Operation
.
The short representation of an Operation
has most
special characters removed that could cause problems when interpreted
in external applications.
For example, comma and tab characters may cause problems in
spreadsheet and database applications.
See the various public static final String *_replacement
for which characters will be replaced by what.
String
representation of the
Operation
.public java.lang.String get(OperationTableModel.OperationTableHeader theColumn)
Operation
corresponding to the
OperationTableHeader
column parameter.theColumn
- The OperationTableHeader
column for
which to return the Operation
's value.String
value.OperationTableModel.OperationTableHeader
public double[] call() throws java.lang.Exception
Operation
.
The returned result is identical to the result obtained through a
direct invocation of the applyTo()
method of a
Kernel
or Feature
.
The execution of an Operation
can fail in many ways.
If no Class
can be found corresponding the
Operation
, the method will return null
.
If no Class
instance can be created for the
corresponding Operation
, due to a constructor error, the
method will return null
.
If the Table
on which to perform the
Operation
can not be loaded, the method will return
null
.
call
in interface java.util.concurrent.Callable<double[]>
java.lang.Exception
Table
,
AbstractKernel.applyTo(double[], int)