|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--quoggles.boxes.Box
|
+--quoggles.stdboxes.complexfilter.ComplexFilter_Box
Input: one or several objects
Output:
null if the input has been nulltrue.BoolPredicateEnd_Box is implicitly added. Otherwise, an error is
generated.
The output is a collection of input elements for which the predicate holds
(i.e. the sub query yields a true result).
If the resulting list contains only one element, this element is returned (not a one-element list).
| Field Summary | |
private java.util.Stack |
currentNodesTodo
The nodes that still have to be processed. |
private java.util.List |
currentResult
The current result table. |
private int |
currentTestCount
If this number is greater than 0, the currently tested object has passed the test (predicate yielded true for this). |
private org.graffiti.graph.Node |
firstPredNode
Node representing the first box of the predicate of this filter |
private java.util.Collection |
inputCol
The input collection |
private int |
nextInIndex
|
private org.graffiti.plugin.parameter.Parameter |
orderParam
|
private boolean |
predicateExists
Specifies whether or not a predicate exists |
private RunQuery |
queryRunner
|
private java.util.List |
resultRowNrs
|
private java.util.List |
resultRows
Holds additional output |
private java.lang.Object |
singleInput
Only set if input is not a collection |
| Fields inherited from class quoggles.boxes.Box |
boxExecuted, iBoxGRep, inputs, outputs, parameters |
| Constructor Summary | |
ComplexFilter_Box()
Default constructor. |
|
| Method Summary | |
private static void |
beforeException(org.graffiti.graph.Node n)
Is called before an exception is throws. |
static org.graffiti.util.Pair |
checkSinks(org.graffiti.graph.Node fstPredNode,
IBox thisBox)
Assures that there is exactly one BoolPredicateEnd_Box in
the sub query. |
void |
currentTestSucceded()
If a BoolPredicateEnd_Box finds out that the test succeded, it calls this method of all its registered complex filters. |
void |
execute()
See interpretAsBoolean for a definition of what it means
that a sub query evaluates to true. |
IBoxRepresentation |
getGraphicalRepresentation()
This implementation returns a new instance of DefaultBoxRepresentation.
|
int[] |
getInputTypes()
This implementation returns ONE element, the most general type. |
int |
getNumberOfOutputs()
Returns 2. |
int[] |
getOutputTypes()
Override this method to specify more restricted types for the output(s) of the box. |
java.util.List |
getResult()
An entry in the list is created for each IOutput_Box that
is found in the predicate query. |
java.util.List |
getResultRowNumbers()
An entry in the list is created for each IOutput_Box that
is found in the predicate query. |
boolean |
needsQueryRunner()
Returns false. |
void |
reset()
Should be called by all classes that override this method. |
void |
setCurrentNodesTodo(java.util.Stack nodesTodo)
Empty implementation. |
void |
setCurrentResult(java.util.List res)
Empty implementation. |
void |
setInputs(java.lang.Object[] inputs)
Checks if the number of inputs is correct and sets the inputs. |
void |
setNotExecuted()
|
void |
setQueryRunner(RunQuery qr)
Empty implementation. |
| Methods inherited from class quoggles.boxes.Box |
areAllInputsNull, getClassName, getId, getNode, getNumberOfInputs, getOutputAt, getOutputs, getParameters, hasBeenExecuted, ignoreBox, isGraphicalRepNull, isInputSet, isInputSetAt, removeNullValues, reset, setBoxNumber, setDefaultParameters, setIgnoreBox, setInputAt, setNode, setParameters |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.Collection inputCol
private java.lang.Object singleInput
private org.graffiti.graph.Node firstPredNode
private RunQuery queryRunner
private int nextInIndex
setnextinputIndex(int)private java.util.List resultRows
private java.util.List resultRowNrs
private boolean predicateExists
private int currentTestCount
private java.util.List currentResult
private java.util.Stack currentNodesTodo
private org.graffiti.plugin.parameter.Parameter orderParam
| Constructor Detail |
public ComplexFilter_Box()
| Method Detail |
public java.util.List getResult()
IOutput_Box that
is found in the predicate query.
public java.util.List getResultRowNumbers()
IOutput_Box that
is found in the predicate query. It is the number of the row where the
respective output should be put.
getResult()public boolean needsQueryRunner()
Boxfalse.
needsQueryRunner in interface IBoxneedsQueryRunner in class Boxquoggles.boxes.IBox#neeedsQueryRunner()public void setQueryRunner(RunQuery qr)
Box
setQueryRunner in interface IBoxsetQueryRunner in class BoxIBox.setQueryRunner(quoggles.auxiliary.RunQuery)public void currentTestSucceded()
public void setNotExecuted()
public void reset()
Box
reset in interface IBoxreset in class BoxIBox.reset()private static void beforeException(org.graffiti.graph.Node n)
n - the node that holds the BoolPredicateEnd_Box
public static org.graffiti.util.Pair checkSinks(org.graffiti.graph.Node fstPredNode,
IBox thisBox)
throws QueryExecutionException
BoolPredicateEnd_Box in
the sub query. The node containing this box is the first entry in the
Pair that is returned. The second entry indicates whether
or not a new boolean predicate end box has been added automatically.
fstPredNode - the node where the predicate startsthisBox - the box for which the search is started. Used to prevent
that the predicates of nested complex filter boxes are checked in this
call already.
QueryExecutionException
public void execute()
throws QueryExecutionException
interpretAsBoolean for a definition of what it means
that a sub query evaluates to true.
execute in interface IBoxexecute in class BoxQueryExecutionExceptionIBox.execute(),
quoggles.auxialiary.Util#interpretAsBoolean(Object)public void setCurrentResult(java.util.List res)
Box
setCurrentResult in interface IBoxsetCurrentResult in class BoxIBox.setCurrentResult(java.util.List)public void setCurrentNodesTodo(java.util.Stack nodesTodo)
Box
setCurrentNodesTodo in interface IBoxsetCurrentNodesTodo in class BoxIBox.setCurrentNodesTodo(java.util.Stack)public IBoxRepresentation getGraphicalRepresentation()
BoxDefaultBoxRepresentation.
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;
getGraphicalRepresentation in interface IBoxgetGraphicalRepresentation in class BoxIBox.getGraphicalRepresentation()public int[] getInputTypes()
BoxgetNumberOfInputs.
getInputTypes in interface IBoxgetInputTypes in class BoxIBox.getInputTypes()public int getNumberOfOutputs()
getNumberOfOutputs in interface IBoxgetNumberOfOutputs in class BoxIBox.getNumberOfOutputs()public int[] getOutputTypes()
BoxgetNumberOfOutputs.
This implementation returns the same as a call to
getInputTypes yields.
getOutputTypes in interface IBoxgetOutputTypes in class BoxIBox.getOutputTypes()
public void setInputs(java.lang.Object[] inputs)
throws InvalidInputException
Boxsuper.setInputs(inputs)) so that consistency checks are
done and some flags are correctly set.
setInputs in interface IBoxsetInputs in class BoxInvalidInputExceptionIBox.setInputs(java.lang.Object[])
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||