ides.api.plugin.operation
Interface Operation

All Known Subinterfaces:
FilterOperation

public interface Operation

Interface for DES operations.

Author:
Lenko Grigorov, Chris Dragert

Method Summary
 java.lang.String getDescription()
          Description of the operation.
 java.lang.String[] getDescriptionOfInputs()
          User-readable and understandable description for each input argument.
 java.lang.String[] getDescriptionOfOutputs()
          User-readable and understandable description for each output argument.
 java.lang.String getName()
          Name of the operation.
 int getNumberOfInputs()
          Number of inputs for the operation.
 int getNumberOfOutputs()
          Number of outputs from the operation.
 java.lang.Class<?>[] getTypeOfInputs()
          Class types of the inputs.
 java.lang.Class<?>[] getTypeOfOutputs()
          Class types of the outputs.
 java.util.List<java.lang.String> getWarnings()
          When an operation is performed, it may generate warnings.
 java.lang.Object[] perform(java.lang.Object[] inputs)
          Perform the operation.
 

Method Detail

getName

java.lang.String getName()
Name of the operation. The same string will be used to index and identify the operation as well as for display purposes.

Returns:
the name of the operation

getDescription

java.lang.String getDescription()
Description of the operation. This should be approximately one sentence (i.e. 10-20 words in length) that describes the operation

Returns:
the description of the operation

getNumberOfInputs

int getNumberOfInputs()
Number of inputs for the operation. If it can handle an unbounded number of inputs, return -1.

Returns:
number of inputs for the operation; -1 if unbounded

getTypeOfInputs

java.lang.Class<?>[] getTypeOfInputs()
Class types of the inputs. If the inputs are unbounded, the last supplied class type will be assumed for all inputs with a higher index. E.g., if { Boolean,FSAModel are supplied, the first input will be Boolean and all remaining inputs are assumed to be of type FSAModel. This type extension is applied only when the number of inputs is unbounded (i.e., when getNumberOfInputs() returns -1).

Whenever possible, please use the general interfaces from the package model.* (such as FSAModel) instead of specific implementations.

Returns:
class types of the inputs
See Also:
getNumberOfInputs(), getDescriptionOfInputs()

getDescriptionOfInputs

java.lang.String[] getDescriptionOfInputs()
User-readable and understandable description for each input argument. If the inputs are unbounded, the last supplied description will be assumed for all inputs with a higher index. E.g., if {"String 1", "String 2" are supplied, the first input will be described to the user as "String 1" and all remaining inputs will be described as "String 2". This type extension is applied only when the number of inputs is unbounded (i.e., when getNumberOfInputs() returns -1).

Returns:
user-readable descriptions of the inputs
See Also:
getNumberOfInputs()

getNumberOfOutputs

int getNumberOfOutputs()
Number of outputs from the operation.

"Macro" operations, which do not have a defined number of outputs should return -1.

Returns:
number of outputs from the operation

getTypeOfOutputs

java.lang.Class<?>[] getTypeOfOutputs()
Class types of the outputs. Each type in the array should match the type of the corresponding output in the array returned by the operation.

Whenever possible, please use the general interfaces from the package model.* (such as FSAModel) instead of specific implementations.

"Macro" operations (where getNumberOfOutputs() returns -1) need not specify the type of outputs.

Returns:
class types of the inputs
See Also:
getNumberOfOutputs(), getDescriptionOfOutputs()

getDescriptionOfOutputs

java.lang.String[] getDescriptionOfOutputs()
User-readable and understandable description for each output argument. Each description in the array should describe the corresponding output in the array returned by the operation.

"Macro" operations (where getNumberOfOutputs() returns -1) have to provide descriptions for all outputs after the number of outputs is known (e.g., after performing the operation).

Returns:
user-readable descriptions of the outputs
See Also:
getNumberOfOutputs()

perform

java.lang.Object[] perform(java.lang.Object[] inputs)
Perform the operation.

Parameters:
inputs - inputs to the operation (must conform to the types described in getTypeOfInputs())
Returns:
outputs of the operation (must conform to the types described in getTypeOfOutputs())

getWarnings

java.util.List<java.lang.String> getWarnings()
When an operation is performed, it may generate warnings. This method gets those warnings

Returns:
warnings generated by the operation