quoggles.stdboxes.output
Class BoolPredicateEnd_Box

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

public class BoolPredicateEnd_Box
extends Box

Input: anything

( Output: see quoggles.auxiliary.Util.interpretAsBoolean(Object) )


Field Summary
private  java.util.Set complexFilterBoxes
          A set of ComplexFilter_Boxes that are notified when this box calculates a true value.
private  org.graffiti.plugin.parameter.IntegerParameter outPosParam
           
 
Fields inherited from class quoggles.boxes.Box
boxExecuted, iBoxGRep, inputs, outputs, parameters
 
Constructor Summary
BoolPredicateEnd_Box()
          Constructs the box.
 
Method Summary
 void clearRegistered()
          Clears the list of registered ComplexFilter_Boxes.
 void execute()
          Evaluates the input to a boolean value.
 IBoxRepresentation getGraphicalRepresentation()
          This implementation returns a new instance of DefaultBoxRepresentation.
 int getNumberOfOutputs()
          Returns 0.
 java.lang.Object getOutputAt(int index)
          Needed to be overwritten since the default implementation would fail since this box has no (publicly visible) outputs.
 int[] getOutputTypes()
          Returns empty array.
 void registerComplexFilter(ComplexFilter_Box box)
          Registers a ComplexFilter_Box that will be informed when this box calculates a true value.
 void removeRegistered(ComplexFilter_Box cfb)
          Removes the given box from the set of registered ComplexFilter_Boxes.
 void setParameters(org.graffiti.plugin.parameter.Parameter[] pars, boolean fromRep)
          Sets the parameters and - if needed - sets them in the graphical representation.
 
Methods inherited from class quoggles.boxes.Box
areAllInputsNull, getClassName, getId, getInputTypes, getNode, getNumberOfInputs, getOutputs, getParameters, hasBeenExecuted, ignoreBox, isGraphicalRepNull, isInputSet, isInputSetAt, needsQueryRunner, removeNullValues, reset, reset, setBoxNumber, setCurrentNodesTodo, setCurrentResult, setDefaultParameters, setIgnoreBox, setInputAt, setInputs, setNode, setQueryRunner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outPosParam

private org.graffiti.plugin.parameter.IntegerParameter outPosParam

complexFilterBoxes

private java.util.Set complexFilterBoxes
A set of ComplexFilter_Boxes that are notified when this box calculates a true value.

Constructor Detail

BoolPredicateEnd_Box

public BoolPredicateEnd_Box()
Constructs the box.

Method Detail

registerComplexFilter

public void registerComplexFilter(ComplexFilter_Box box)
Registers a ComplexFilter_Box that will be informed when this box calculates a true value.

Parameters:
box - the box to be registered

execute

public void execute()
             throws QueryExecutionException
Evaluates the input to a boolean value. See interpretAsBoolean for a formal definition.

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

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()

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)

getNumberOfOutputs

public int getNumberOfOutputs()
Returns 0.

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

getOutputTypes

public int[] getOutputTypes()
Returns empty array.

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

getOutputAt

public java.lang.Object getOutputAt(int index)
                             throws BoxNotExecutedException
Needed to be overwritten since the default implementation would fail since this box has no (publicly visible) outputs.

Specified by:
getOutputAt in interface IBox
Overrides:
getOutputAt in class Box
Parameters:
index - the index of the required output (must be zero)
BoxNotExecutedException
See Also:
IBox.getOutputAt(int)

removeRegistered

public void removeRegistered(ComplexFilter_Box cfb)
Removes the given box from the set of registered ComplexFilter_Boxes.

Parameters:
cfb - the box that will be removed

clearRegistered

public void clearRegistered()
Clears the list of registered ComplexFilter_Boxes.