de.unihalle.informatik.Alida.workflows
Class ALDWorkflowNode

java.lang.Object
  extended by de.unihalle.informatik.Alida.workflows.ALDWorkflowNode

public class ALDWorkflowNode
extends java.lang.Object

This class represents a node in an Alida work flow. Essentially it holds an ALDAOperator object and edges connecting parameters of this operator.

Author:
posch

Nested Class Summary
static class ALDWorkflowNode.ALDWorkflowNodeState
           
 
Field Summary
(package private)  java.util.Vector<ALDWorkflowEdge> inEdges
          all incoming edges.
protected  boolean isInteriorShadowNode
          Is true it his node is used as an interior shadow (or substitute) for the node holding this work flow {see ALDWorkflow.
private  ALDOperator op
          The operator object associated with this node.
(package private)  java.util.Vector<ALDWorkflowEdge> outEdges
          outgoing edges.
private  ALDWorkflow parentWorkflow
          This is the enclosing work flow.
private  ALDWorkflowNode.ALDWorkflowNodeState state
          The state of the node
 
Constructor Summary
ALDWorkflowNode(ALDWorkflow parentWorkflow, ALDOperator op)
          Create a node
ALDWorkflowNode(ALDWorkflow parentWorkflow, ALDOperator op, boolean isInteriorShadowNode)
          Create a node
 
Method Summary
 java.util.Set<ALDWorkflowNode> getAncestors()
          Return all ancestors of this node.
 java.util.Set<ALDWorkflowNode> getChildren()
          Return all children nodes of this node.
 java.util.Set<ALDWorkflowNode> getDescendants()
          Return the nodeIds of all descendants of the given node.
 java.lang.Integer getId()
          Return the Id associated with this node.
protected  java.util.Vector<ALDWorkflowEdge> getInEdges()
          Returns all incoming edges.
 java.util.Collection<ALDWorkflowEdge> getInEdgesForParameter(java.lang.String parameterName)
          Return all incoming edges for this node which have their target at parameterName.
 java.util.Collection<java.lang.String> getMissingRequiredInputs()
          Returns the names of all required input parameters of the operator object associated with the node which are not linked and have a value of null
 ALDOperator getOperator()
          Returns the operator associated with this node.
protected  java.util.Vector<ALDWorkflowEdge> getOutEdges()
          Returns all outgoing edges.
 java.util.Collection<ALDWorkflowEdge> getOutEdgesForParameter(java.lang.String parameterName)
          Return outgoing edges for this node which have their source at parameterName.
 java.util.Set<ALDWorkflowNode> getParents()
          Return all parents of this node.
 ALDWorkflow getParentWorkflow()
           
 ALDWorkflowNode.ALDWorkflowNodeState getState()
          Returns the current state of this node
 boolean isConfigured()
          Checks if this node is configured.
 void print()
          Print information of this node to standard out.
(package private)  void resetParameter(java.lang.String parameterName)
          Reset the parameter parameterName in the operator associated to this node.
protected  void setParentWorkflow(ALDWorkflow parentWorkflow)
           
protected  void setState(ALDWorkflowNode.ALDWorkflowNodeState state)
          Sets the state of this node
 boolean stateGreaterEqual(ALDWorkflowNode.ALDWorkflowNodeState compareState)
          Return true if the state of this node is greater equal the compareState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inEdges

java.util.Vector<ALDWorkflowEdge> inEdges
all incoming edges.


isInteriorShadowNode

protected final boolean isInteriorShadowNode
Is true it his node is used as an interior shadow (or substitute) for the node holding this work flow {see ALDWorkflow.


op

private final ALDOperator op
The operator object associated with this node.


outEdges

java.util.Vector<ALDWorkflowEdge> outEdges
outgoing edges.


parentWorkflow

private ALDWorkflow parentWorkflow
This is the enclosing work flow.


state

private ALDWorkflowNode.ALDWorkflowNodeState state
The state of the node

Constructor Detail

ALDWorkflowNode

public ALDWorkflowNode(ALDWorkflow parentWorkflow,
                       ALDOperator op)
Create a node

Parameters:
parentWorkflow - TODO
op -
id -

ALDWorkflowNode

public ALDWorkflowNode(ALDWorkflow parentWorkflow,
                       ALDOperator op,
                       boolean isInteriorShadowNode)
Create a node

Parameters:
parentWorkflow - TODO
op -
id -
Method Detail

getAncestors

public java.util.Set<ALDWorkflowNode> getAncestors()
Return all ancestors of this node.

Returns:
all descendants

getChildren

public java.util.Set<ALDWorkflowNode> getChildren()
Return all children nodes of this node. Children are define to be nodes with at least one edge connecting a input parameter of this child node to the node considered. The interior shadow considered not to be a child of any node (inside this work flow).

Returns:
indices of all child nodes

getDescendants

public java.util.Set<ALDWorkflowNode> getDescendants()
Return the nodeIds of all descendants of the given node.

Parameters:
nodeId -
Returns:
nodeIds of all descendants

getId

public java.lang.Integer getId()
Return the Id associated with this node.

Returns:

getInEdges

protected java.util.Vector<ALDWorkflowEdge> getInEdges()
Returns all incoming edges.

Returns:

getInEdgesForParameter

public java.util.Collection<ALDWorkflowEdge> getInEdgesForParameter(java.lang.String parameterName)
Return all incoming edges for this node which have their target at parameterName.

Parameters:
parameterName -
Returns:
indices of all incoming edges which have their target at parameterName

getMissingRequiredInputs

public java.util.Collection<java.lang.String> getMissingRequiredInputs()
Returns the names of all required input parameters of the operator object associated with the node which are not linked and have a value of null

Returns:

getOperator

public ALDOperator getOperator()
Returns the operator associated with this node.

Returns:

getOutEdges

protected java.util.Vector<ALDWorkflowEdge> getOutEdges()
Returns all outgoing edges.

Returns:

getOutEdgesForParameter

public java.util.Collection<ALDWorkflowEdge> getOutEdgesForParameter(java.lang.String parameterName)
Return outgoing edges for this node which have their source at parameterName.

Parameters:
parameterName -
Returns:
indices of all outgoing edges which have their source at parameterName

getParents

public java.util.Set<ALDWorkflowNode> getParents()
Return all parents of this node. Parents are define to be nodes with at least one edge connecting a output parameter of this source node to the node considered. The interior shadow node is define to have no parents (inside this work flow).

Returns:
all parents

getParentWorkflow

public ALDWorkflow getParentWorkflow()
Returns:
the parentWorkflow

getState

public ALDWorkflowNode.ALDWorkflowNodeState getState()
Returns the current state of this node

Returns:

isConfigured

public boolean isConfigured()
Checks if this node is configured. A node is configured if all required input parameters have a non-null value in the operator object associated with the node or gave an incoming edge in the work flow.

Returns:

print

public void print()
Print information of this node to standard out.


resetParameter

void resetParameter(java.lang.String parameterName)
              throws ALDWorkflowException
Reset the parameter parameterName in the operator associated to this node. Currently this sets the parameters value to null.

Parameters:
parameterName -
Throws:
ALDWorkflowException - if the parameter does not exists

setParentWorkflow

protected void setParentWorkflow(ALDWorkflow parentWorkflow)
Parameters:
parentWorkflow - the parentWorkflow to set

setState

protected void setState(ALDWorkflowNode.ALDWorkflowNodeState state)
Sets the state of this node

Parameters:
state - New state

stateGreaterEqual

public boolean stateGreaterEqual(ALDWorkflowNode.ALDWorkflowNodeState compareState)
Return true if the state of this node is greater equal the compareState

Parameters:
compareState -
Returns: