de.unihalle.informatik.Alida.workflows
Class ALDWorkflowNode

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

public class ALDWorkflowNode
extends 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
 boolean isInteriorShadowNode
          Is true it his node is used as an interior shadow (or substitute) for the node holding this work flow {see ALDWorkflow.
 
Constructor Summary
ALDWorkflowNode(ALDWorkflow parentWorkflow, ALDOperator op)
          Create a node
ALDWorkflowNode(ALDWorkflow parentWorkflow, ALDOperator op, boolean isInteriorShadowNode)
          Create a node
 
Method Summary
 Set<ALDWorkflowNode> getAncestors()
          Return all ancestors of this node.
 Set<ALDWorkflowNode> getChildren()
          Return all children nodes of this node.
 Set<ALDWorkflowNode> getDescendants()
          Return the nodeIds of all descendants of the given node.
 Integer getId()
          Return the Id associated with this node.
protected  Vector<ALDWorkflowEdge> getInEdges()
          Returns all incoming edges.
 Collection<ALDWorkflowEdge> getInEdgesForParameter(String parameterName)
          Return all incoming edges for this node which have their target at parameterName.
 Collection<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.
 String getOperatorExecutionProgressDescr()
           
protected  Vector<ALDWorkflowEdge> getOutEdges()
          Returns all outgoing edges.
 Collection<ALDWorkflowEdge> getOutEdgesForParameter(String parameterName)
          Return outgoing edges for this node which have their source at parameterName.
 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.
protected  void setOperator(ALDOperator newOp)
          Sets the operator associated with this node.
 void setOperatorExecutionProgressDescr(String operatorExecutionProgressDescr)
           
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

isInteriorShadowNode

public 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.

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

getParentWorkflow

public ALDWorkflow getParentWorkflow()
Returns:
the parentWorkflow

setParentWorkflow

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

getOperator

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

Returns:

setOperator

protected void setOperator(ALDOperator newOp)
                    throws ALDWorkflowException
Sets the operator associated with this node. The new operator instance needs to be of the same class as the current operator instance.

Throws:
ALDWorkflowException - if the new operator instance is of wrong type

getState

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

Returns:

setState

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

Parameters:
state - New state

getId

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

Returns:

stateGreaterEqual

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

Parameters:
compareState -
Returns:

getInEdges

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

Returns:

getOutEdges

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

Returns:

getOperatorExecutionProgressDescr

public String getOperatorExecutionProgressDescr()
Returns:
the operatorExecutionProgressDescr

setOperatorExecutionProgressDescr

public void setOperatorExecutionProgressDescr(String operatorExecutionProgressDescr)
Parameters:
operatorExecutionProgressDescr - the operatorExecutionProgressDescr to set

getParents

public 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

getChildren

public 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 Set<ALDWorkflowNode> getDescendants()
Return the nodeIds of all descendants of the given node.

Parameters:
nodeId -
Returns:
nodeIds of all descendants

getAncestors

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

Returns:
all descendants

getInEdgesForParameter

public Collection<ALDWorkflowEdge> getInEdgesForParameter(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

getOutEdgesForParameter

public Collection<ALDWorkflowEdge> getOutEdgesForParameter(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

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:

getMissingRequiredInputs

public Collection<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:

print

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



Copyright © 2010–2014 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.