public abstract class SimpleAction extends Action
Modifier and Type | Field and Description |
---|---|
private String |
name |
protected Param[] |
params |
private Object[] |
paramValues |
Constructor and Description |
---|
SimpleAction(String name,
Param... params) |
Modifier and Type | Method and Description |
---|---|
protected Object[] |
bindParamValues(Object... values)
Computes the values of all parameters to this action taking into account the default values if
the specified values are missing (null) or the list of specified values is shorter than the list
of defined parameters.
|
String |
getName()
The name of the action should generally be an entry in the ontology subsumed
by the action type.
|
protected Object |
getParamValue(int index) |
protected Object[] |
setParamValues(Object... values)
Utility method to be used by subclasses to return a list of parameters that are guaranteed to
conform to the cardinality and type constraints of the parameter list.
|
compareTo, equals, execute, getDefaultIO, getIO, setDefaultIO, setIO, toString
private String name
protected Param[] params
private Object[] paramValues
protected Object getParamValue(int index)
protected Object[] setParamValues(Object... values) throws IllegalOperationException, ClassCastException
If you are considering using this method, you might consider using bindParamValues(Object...)
instead, as it has the same functionality, but also fills in the default values for you
automatically.
values
- The values corresponding to the type definition with the same ordinality.IllegalOperationException
- if the list of values is longer than expected (short is OK)ClassCastException
- if one or more of the parameters do not conform to the type in specification.bindParamValues(Object...)
protected Object[] bindParamValues(Object... values) throws IllegalOperationException, ClassCastException
setParamValues(Object...)
to check the type
constraints of the parameters.values
- IllegalOperationException
ClassCastException
setParamValues(Object...)