|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface for boxes. Provides methods to set the input(s), execute the code of the box and get its output(s).
| Method Summary | |
void |
execute()
Executes the box, i.e. calculates the output from the input. |
IBoxRepresentation |
getGraphicalRepresentation()
If your subclass has any parameters, you will probably have to design your own representation and implement this method for example as follows:
if (iBoxGRep == null || ! |
java.lang.String |
getId()
Returns a unique id. |
int[] |
getInputTypes()
Implement this method to specify the types for the input(s) of the box. |
org.graffiti.graph.Node |
getNode()
Returns the node that holds this box. |
int |
getNumberOfInputs()
Returns the number of inputs this box expects. |
int |
getNumberOfOutputs()
Returns the number of outputs this box provides. |
java.lang.Object |
getOutputAt(int index)
Returns the ith output. |
java.lang.Object[] |
getOutputs()
Returns the output array of the box. |
int[] |
getOutputTypes()
Implement this method to specify restricted types for the output(s) of the box. |
org.graffiti.plugin.parameter.Parameter[] |
getParameters()
Returns the array of currently set parameters. |
boolean |
hasBeenExecuted()
Returns true iff the box's execute() method
has been called since the creation of the box or the last call to
reset. |
boolean |
ignoreBox()
Gets the value previously set by setIgnoreBox(boolean) or
returns false if not yet set. |
boolean |
isInputSet()
Returns true iff all inputs have been set. |
boolean |
isInputSetAt(int index)
Returns true iff the input at the given index has been set. |
boolean |
needsQueryRunner()
Should return true if the box needs the queryRunner field
to be set. |
void |
reset()
Reset the box: Inputs will not be set, ... |
void |
reset(int index)
States that the input at the given index is no longer valid. |
void |
setBoxNumber(int boxNumber)
Set the number of the box. |
void |
setCurrentNodesTodo(java.util.Stack nodesTodo)
Sets the stack of nodes that still have to be processed via a call to runQuery. |
void |
setCurrentResult(java.util.List res)
Sets the list (representing the result table) that the last call to runQuery returned. |
void |
setDefaultParameters()
Important only if the subclass has any parameters. |
void |
setIgnoreBox(boolean ignore)
Specifies whether or not a box should be ignored by any query processing (possibly because it has already been executed as part of a sub query). |
void |
setInputAt(java.lang.Object input,
int index)
Sets the input at the specified index. |
void |
setInputs(java.lang.Object[] inputs)
Checks if the number of inputs is correct and sets the inputs. |
void |
setNode(org.graffiti.graph.Node node)
Sets the node that holds this box. |
void |
setParameters(org.graffiti.plugin.parameter.Parameter[] pars,
boolean fromRep)
Sets the parameters of this box. |
void |
setQueryRunner(RunQuery qr)
Set the object that has a runQuery method
to be called for the execution of the predicate sub query.
|
| Method Detail |
public void setBoxNumber(int boxNumber)
boxNumber - a number identifying the boxpublic int[] getInputTypes()
getNumberOfInputs.
int array whose size gives the number of inputs.
The entries specify the type of the inputs. This uses constants defined
in quoggles.constants.ITypeConstants.ITypeConstantspublic int getNumberOfInputs()
public void setInputs(java.lang.Object[] inputs)
throws InvalidInputException
execute will no longer
throw an InputNotSetException.
inputs - the inputs of the box
InvalidInputException
public void setInputAt(java.lang.Object input,
int index)
throws InvalidInputException
input - the input to be set at the given indexindex - the index of the input to set
InvalidInputExceptionpublic boolean isInputSet()
true iff all inputs have been set.
true iff all inputs have been set.public boolean isInputSetAt(int index)
index - between zero and getNumberOfInputs()-1
public void execute()
throws QueryExecutionException
InputNotSetException - if the inputSet
flag indicates the no input has been set for this box.
maybe - other QueryExecutionExceptions.
QueryExecutionExceptionpublic boolean hasBeenExecuted()
true iff the box's execute() method
has been called since the creation of the box or the last call to
reset.
public int getNumberOfOutputs()
public int[] getOutputTypes()
getNumberOfOutputs.
int array whose size gives the number of
outputs.
The entries specify the type of the outputs. This uses constants defined
in quoggles.constants.ITypeConstants.ITypeConstants
public java.lang.Object[] getOutputs()
throws BoxNotExecutedException
execute method has not been called.
BoxNotExecutedException
public java.lang.Object getOutputAt(int index)
throws BoxNotExecutedException
ith output.
ith output of the box
BoxNotExecutedExceptionpublic void setDefaultParameters()
public void setParameters(org.graffiti.plugin.parameter.Parameter[] pars,
boolean fromRep)
Box does it) call
setParameters on the representation of this box. To avoid
updating several times, this is not done when the given flag
fromRep is true since then the call has originated from
the representation.
pars - the parameters to be setfromRep - true if called from the box's representationpublic org.graffiti.plugin.parameter.Parameter[] getParameters()
public java.lang.String getId()
String identifying the boxpublic IBoxRepresentation getGraphicalRepresentation()
if (iBoxGRep == null || !(iBoxGRep instanceof MYOWNBOX_Rep)) {
iBoxGRep = new MYOWNBOX_Rep(this);
}
return iBoxGRep;
public void reset()
public void reset(int index)
index - the index of the input that should be marked as invalidpublic void setIgnoreBox(boolean ignore)
ignore - true iff the box should not be executedpublic boolean ignoreBox()
setIgnoreBox(boolean) or
returns false if not yet set.
true if the box should be ignoredpublic boolean needsQueryRunner()
true if the box needs the queryRunner field
to be set.
RunQuery
interface should be passed to this boxpublic void setQueryRunner(RunQuery qr)
runQuery method
to be called for the execution of the predicate sub query.
Only used if needsQueryRunner() returns true.
qr - an object that has a runQuery(...) methodneedsQueryRunner()public void setCurrentResult(java.util.List res)
runQuery returned. Only boxes that run sub queries need
this information. They use that as the result to pass on to the sub
query executor.
res - the last result of a call to runQuery(...)public void setCurrentNodesTodo(java.util.Stack nodesTodo)
runQuery. Only boxes that run sub queries need
this information. They pass it on to the sub query executor.Used to prevent multiple execution of boxes that can be reached from a high level and is executed within a lower level (sub query).
nodesTodo - the stack of nodes that still need to be processedpublic void setNode(org.graffiti.graph.Node node)
node - the node that holds this box.public org.graffiti.graph.Node getNode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||