quoggles.stdboxes.subquery
Class SubQuery_Box

java.lang.Object
  |
  +--quoggles.boxes.Box
        |
        +--quoggles.stdboxes.subquery.SubQuery_Box
All Implemented Interfaces:
IBox

public class SubQuery_Box
extends Box

Input: depends on the loaded sub query

Output: depends on the loaded sub query

Allows specification of a file that contains a saved query. The box then represents this whole loaded query. Parameters of the query cannot be changed.


Field Summary
private  java.util.List currentResult
          The current result table.
(package private)  org.graffiti.plugin.parameter.StringParameter fileNameParam
           
(package private)  org.graffiti.plugin.parameter.ObjectParameter graphParam
           
private  java.util.List inputBoxAndNumber
          A list of Pairs (of boxes that need inputs and the index where the box needs the input).
private  int[] inputTypes
           
private  java.util.List outputBoxAndNumber
          A list of Pairs (of boxes that yield outputs and the index where the box's output is).
private  int[] outputTypes
           
private  RunQuery queryRunner
           
private  org.graffiti.graph.Graph subQueryGraph
          Graüh holding the sub query
 
Fields inherited from class quoggles.boxes.Box
boxExecuted, iBoxGRep, inputs, outputs, parameters
 
Constructor Summary
SubQuery_Box()
          Constructs the box.
 
Method Summary
 void execute()
          Should be overridden and called first by subclasses.
 IBoxRepresentation getGraphicalRepresentation()
          This implementation returns a new instance of DefaultBoxRepresentation.
 int[] getInputTypes()
          This implementation returns ONE element, the most general type.
 int[] getOutputTypes()
          Override this method to specify more restricted types for the output(s) of the box.
 boolean needsQueryRunner()
          Returns true.
 void setCurrentResult(java.util.List res)
          Empty implementation.
 void setParameters(org.graffiti.plugin.parameter.Parameter[] pars, boolean fromRep)
          Sets the parameters and - if needed - sets them in the graphical representation.
 void setQueryRunner(RunQuery qr)
          Empty implementation.
 
Methods inherited from class quoggles.boxes.Box
areAllInputsNull, getClassName, getId, getNode, getNumberOfInputs, getNumberOfOutputs, getOutputAt, getOutputs, getParameters, hasBeenExecuted, ignoreBox, isGraphicalRepNull, isInputSet, isInputSetAt, removeNullValues, reset, reset, setBoxNumber, setCurrentNodesTodo, setDefaultParameters, setIgnoreBox, setInputAt, setInputs, setNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileNameParam

org.graffiti.plugin.parameter.StringParameter fileNameParam

graphParam

org.graffiti.plugin.parameter.ObjectParameter graphParam

inputTypes

private int[] inputTypes

outputTypes

private int[] outputTypes

subQueryGraph

private org.graffiti.graph.Graph subQueryGraph
Graüh holding the sub query


inputBoxAndNumber

private java.util.List inputBoxAndNumber
A list of Pairs (of boxes that need inputs and the index where the box needs the input).


outputBoxAndNumber

private java.util.List outputBoxAndNumber
A list of Pairs (of boxes that yield outputs and the index where the box's output is).


queryRunner

private RunQuery queryRunner

currentResult

private java.util.List currentResult
The current result table.

Constructor Detail

SubQuery_Box

public SubQuery_Box()
Constructs the box.

Method Detail

execute

public void execute()
             throws QueryExecutionException
Description copied from class: Box
Should be overridden and called first by subclasses. Throws InputNotSetException if the inputSet flag indicates the no input has been set for this box. May throw other QueryExecutionExceptions. The implementation of this abstract sets the output to be equal to the input.

Specified by:
execute in interface IBox
Overrides:
execute in class Box
QueryExecutionException
See Also:
IBox.execute()

setParameters

public void setParameters(org.graffiti.plugin.parameter.Parameter[] pars,
                          boolean fromRep)
Description copied from class: Box
Sets the parameters and - if needed - sets them in the graphical representation. Subclasses need not override this method. Just assign your parameters to the protected field parameters.

Specified by:
setParameters in interface IBox
Overrides:
setParameters in class Box
See Also:
IBox.setParameters(org.graffiti.plugin.parameter.Parameter[], boolean)

getGraphicalRepresentation

public IBoxRepresentation getGraphicalRepresentation()
Description copied from class: Box
This implementation returns a new instance of DefaultBoxRepresentation. If your subclass has any parameters, you will probably have to design your own representation and override this method for example as follows: if (iBoxGRep == null || !(iBoxGRep instanceof MYOWNBOX_Rep)) { iBoxGRep = new MYOWNBOX_Rep(this); } return iBoxGRep;

Specified by:
getGraphicalRepresentation in interface IBox
Overrides:
getGraphicalRepresentation in class Box
See Also:
IBox.getGraphicalRepresentation()

getInputTypes

public int[] getInputTypes()
Description copied from class: Box
This implementation returns ONE element, the most general type. Override this method to specify more restricted types for the input(s) of the box. The size of the returned array must be consistent with the return value of getNumberOfInputs.

Specified by:
getInputTypes in interface IBox
Overrides:
getInputTypes in class Box
See Also:
IBox.getInputTypes()

getOutputTypes

public int[] getOutputTypes()
Description copied from class: Box
Override this method to specify more restricted types for the output(s) of the box. The size of the returned array must be consistent with the return value of getNumberOfOutputs. This implementation returns the same as a call to getInputTypes yields.

Specified by:
getOutputTypes in interface IBox
Overrides:
getOutputTypes in class Box
See Also:
IBox.getOutputTypes()

needsQueryRunner

public boolean needsQueryRunner()
Returns true.

Specified by:
needsQueryRunner in interface IBox
Overrides:
needsQueryRunner in class Box
See Also:
quoggles.boxes.IBox#neeedsQueryRunner()

setQueryRunner

public void setQueryRunner(RunQuery qr)
Description copied from class: Box
Empty implementation.

Specified by:
setQueryRunner in interface IBox
Overrides:
setQueryRunner in class Box
See Also:
IBox.setQueryRunner(quoggles.auxiliary.RunQuery)

setCurrentResult

public void setCurrentResult(java.util.List res)
Description copied from class: Box
Empty implementation.

Specified by:
setCurrentResult in interface IBox
Overrides:
setCurrentResult in class Box
See Also:
IBox.setCurrentResult(java.util.List)