quoggles.auxboxes.contains
Class Contains_Box

java.lang.Object
  |
  +--quoggles.boxes.Box
        |
        +--quoggles.auxboxes.contains.Contains_Box
All Implemented Interfaces:
IBox

public class Contains_Box
extends Box

Input: two objects (first will be a collection most times)

Output: boolean value indicating if the two inputs are equal or the first actually is a collection and contains the second (the collection is not implicitly flattened). If first input is null, the result will only be true if the second input is null as well.

For a definition of what is meant by "equal", see the javadoc of the execute method (basically, the equals method is used).


Field Summary
private  java.lang.Object obj1
           
private  java.lang.Object obj2
           
 
Fields inherited from class quoggles.boxes.Box
boxExecuted, iBoxGRep, inputs, outputs, parameters
 
Constructor Summary
Contains_Box()
           
 
Method Summary
 void execute()
          Two objects are equal if obj1.equals(obj2) holds.
 int[] getInputTypes()
          This implementation returns ONE element, the most general type.
 int getNumberOfInputs()
          Returns 2.
 int[] getOutputTypes()
          Override this method to specify more restricted types for the output(s) of the box.
 void setInputs(java.lang.Object[] inputs)
          Checks if the number of inputs is correct and sets the inputs.
 
Methods inherited from class quoggles.boxes.Box
areAllInputsNull, getClassName, getGraphicalRepresentation, getId, getNode, getNumberOfOutputs, getOutputAt, getOutputs, getParameters, hasBeenExecuted, ignoreBox, isGraphicalRepNull, isInputSet, isInputSetAt, needsQueryRunner, removeNullValues, reset, reset, setBoxNumber, setCurrentNodesTodo, setCurrentResult, setDefaultParameters, setIgnoreBox, setInputAt, setNode, setParameters, setQueryRunner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

obj1

private java.lang.Object obj1

obj2

private java.lang.Object obj2
Constructor Detail

Contains_Box

public Contains_Box()
Method Detail

execute

public void execute()
             throws QueryExecutionException
Two objects are equal if obj1.equals(obj2) holds.

This means that two Lists are equal only if they contain the same elements (tested via equals) in the same order.

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

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

setInputs

public void setInputs(java.lang.Object[] inputs)
               throws InvalidInputException
Description copied from class: Box
Checks if the number of inputs is correct and sets the inputs. Subclasses probably will want to override this method to avoid many casts necessary when working with the input array. They should however first call this method (via super.setInputs(inputs)) so that consistency checks are done and some flags are correctly set.

Specified by:
setInputs in interface IBox
Overrides:
setInputs in class Box
InvalidInputException
See Also:
IBox.setInputs(java.lang.Object[])

getNumberOfInputs

public int getNumberOfInputs()
Returns 2.

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