org.shiwa.fgi.iwir
Class IfTask

java.lang.Object
  extended by org.shiwa.fgi.iwir.AbstractTask
      extended by org.shiwa.fgi.iwir.AbstractCompoundTask
          extended by org.shiwa.fgi.iwir.IfTask

public class IfTask
extends AbstractCompoundTask

The Class IfTask enables the conditional execution of the inner tasks.


Constructor Summary
IfTask(java.lang.String name)
          Instantiates a new if task.
IfTask(java.lang.String name, ConditionExpression condition)
          Instantiates a new if task with a given condition.
 
Method Summary
 void addTaskToElseBlock(AbstractTask task)
          Adds a additional task to the inner else block.
 void addTaskToThenBlock(AbstractTask task)
          Adds a additional task to the inner then block.
 boolean equals(java.lang.Object obj)
           
 java.util.List<AbstractDataPort> getAllInputPorts()
          Returns a list of all input ports (inputPort, loopPoort,...).
 java.util.List<AbstractDataPort> getAllOutputPorts()
          Returns a list of all output ports (outputPort, unionPort,...).
 java.util.List<AbstractTask> getChildren()
          Returns a shallow copy of the direct child tasks.
 ConditionExpression getCondition()
          Gets the condition of the task.
 java.util.List<AbstractTask> getElseTasks()
          Returns a shallow copy of the else tasks.
 java.util.List<AbstractTask> getThenTasks()
          Returns a shallow copy of the then tasks.
 int hashCode()
           
 void setCondition(ConditionExpression condition)
          Sets the condition of the task.
 
Methods inherited from class org.shiwa.fgi.iwir.AbstractCompoundTask
addLink, addLink, getControlLinks, getDataLinks, getLinks
 
Methods inherited from class org.shiwa.fgi.iwir.AbstractTask
addConstraint, addInputPort, addOutputPort, addProperty, getConstraints, getInputPorts, getName, getOutputPorts, getParentTask, getPort, getProperties, getUniqueId, isTopLevelTask, removeProperty, setPortValue, setPortValue, setPortValue, setPortValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfTask

public IfTask(java.lang.String name)
Instantiates a new if task.

Parameters:
name - the name of the if task

IfTask

public IfTask(java.lang.String name,
              ConditionExpression condition)
Instantiates a new if task with a given condition.

Parameters:
name - the name of the if task
condition - the condition of the if task
Method Detail

setCondition

public void setCondition(ConditionExpression condition)
Sets the condition of the task.

Parameters:
condition - the new condition of the task

getCondition

public ConditionExpression getCondition()
Gets the condition of the task.

Returns:
the condition of the task

addTaskToThenBlock

public void addTaskToThenBlock(AbstractTask task)
                        throws NotWellFormedException
Adds a additional task to the inner then block. Throws a NotWellFormedException if task already exist, for example.

Parameters:
task - the task to add to the then block
Throws:
NotWellFormedException - the not well formed exception

addTaskToElseBlock

public void addTaskToElseBlock(AbstractTask task)
                        throws NotWellFormedException
Adds a additional task to the inner else block. Throws a NotWellFormedException if task already exist, for example.

Parameters:
task - the task to add to the else block
Throws:
NotWellFormedException - the not well formed exception

getThenTasks

public java.util.List<AbstractTask> getThenTasks()
Returns a shallow copy of the then tasks. Returns an empty list if no then task exists.

Returns:
the tasks of the then block

getElseTasks

public java.util.List<AbstractTask> getElseTasks()
Returns a shallow copy of the else tasks. Returns an empty list if no else task exists.

Returns:
the tasks of the else block

getChildren

public java.util.List<AbstractTask> getChildren()
Description copied from class: AbstractTask
Returns a shallow copy of the direct child tasks. Returns an empty list if no children exist.

Overrides:
getChildren in class AbstractTask
Returns:
the children of the task

getAllInputPorts

public java.util.List<AbstractDataPort> getAllInputPorts()
Description copied from class: AbstractTask
Returns a list of all input ports (inputPort, loopPoort,...). For the loopCounter its ports (from,to,step) are added, if they exist.

Specified by:
getAllInputPorts in class AbstractTask
Returns:
the all input ports

getAllOutputPorts

public java.util.List<AbstractDataPort> getAllOutputPorts()
Description copied from class: AbstractTask
Returns a list of all output ports (outputPort, unionPort,...).

Specified by:
getAllOutputPorts in class AbstractTask
Returns:
the all input ports

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractCompoundTask

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractCompoundTask