org.esa.beam.framework.gpf.graph
Class Graph

java.lang.Object
  extended by org.esa.beam.framework.gpf.graph.Graph

public class Graph
extends Object

Represents a directed acyclic graph (DAG) of Nodes.

Author:
Maximilian Aulinger, Norman Fomferra, Ralf Quast

Field Summary
static String CURRENT_VERSION
           
 
Constructor Summary
Graph(String id)
          Constructs an empty graph with the given id.
 
Method Summary
 void addNode(Node node)
          Adds a Node to the graph
 com.thoughtworks.xstream.io.xml.xppdom.XppDom getApplicationData(String appId)
          Returns the Application data for the given application ID or null, if for this id no application is available.
 Header getHeader()
          Gets the graph's header
 String getId()
          Gets the graph's id
 Node getNode(int index)
          Gets the Node at the given index.
 Node getNode(String id)
          Returns the Node with the given id or null if the graph contains no respective Node.
 int getNodeCount()
          Gets the number nodes contained by this graph.
 Node[] getNodes()
          Returns an array containing all nodes in this graph.
 String getVersion()
          Gets the graph's version
 boolean removeNode(String id)
          Removes the Node with the given id from this graph if present.
 void setAppData(String id, com.thoughtworks.xstream.io.xml.xppdom.XppDom data)
          Sets the application data for the given ID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_VERSION

public static final String CURRENT_VERSION
See Also:
Constant Field Values
Constructor Detail

Graph

public Graph(String id)
Constructs an empty graph with the given id.

Parameters:
id - the id of the graph
Method Detail

getId

public String getId()
Gets the graph's id

Returns:
the id of the graph

getVersion

public String getVersion()
Gets the graph's version

Returns:
the version of the graph

getHeader

public Header getHeader()
Gets the graph's header

Returns:
the header of the graph

getNodeCount

public int getNodeCount()
Gets the number nodes contained by this graph.

Returns:
the number nodes

addNode

public void addNode(Node node)
Adds a Node to the graph

Parameters:
node - a node
Throws:
IllegalArgumentException - if the id of the given node is already in use

removeNode

public boolean removeNode(String id)
Removes the Node with the given id from this graph if present.

Parameters:
id - the id of the Node to be removed
Returns:
true if the graph contains a Node with the given id. Else false.

getNode

public Node getNode(int index)
Gets the Node at the given index.

Parameters:
index - the index
Returns:
the node at the given index

getNode

public Node getNode(String id)
Returns the Node with the given id or null if the graph contains no respective Node.

Parameters:
id - the id of the Node to be removed
Returns:
true if the graph contains a Node with the given id. Else false.

getNodes

public Node[] getNodes()
Returns an array containing all nodes in this graph.

Returns:
an array of all nodes

getApplicationData

public com.thoughtworks.xstream.io.xml.xppdom.XppDom getApplicationData(String appId)
Returns the Application data for the given application ID or null, if for this id no application is available.

Parameters:
appId - the application ID
Returns:
the application data as an XppDom

setAppData

public void setAppData(String id,
                       com.thoughtworks.xstream.io.xml.xppdom.XppDom data)
Sets the application data for the given ID

Parameters:
id - The application ID.
data - The application data as XppDom.


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.