Package org.esa.snap.core.gpf.graph
Class Graph
java.lang.Object
org.esa.snap.core.gpf.graph.Graph
Represents a directed acyclic graph (DAG) of
Nodes.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aNodeto the graphcom.thoughtworks.xstream.io.xml.xppdom.XppDomgetApplicationData(String appId) Returns the Application data for the given application ID or null, if for this id no application is available.Gets the graph's headergetId()Gets the graph's idgetNode(int index) Gets theNodeat the given index.intGets the number nodes contained by this graph.Node[]getNodes()Returns an array containing all nodes in this graph.Gets the graph's versionbooleanremoveNode(String id) Removes theNodewith the givenidfrom this graph if present.voidsetAppData(String id, com.thoughtworks.xstream.io.xml.xppdom.XppDom data) Sets the application data for the given ID
-
Field Details
-
CURRENT_VERSION
- See Also:
-
-
Constructor Details
-
Graph
Constructs an empty graph with the givenid.- Parameters:
id- the id of the graph
-
-
Method Details
-
getId
Gets the graph's id- Returns:
- the id of the graph
-
getVersion
Gets the graph's version- Returns:
- the version of the graph
-
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
Adds aNodeto the graph- Parameters:
node- a node- Throws:
IllegalArgumentException- if the id of the given node is already in use
-
removeNode
Removes theNodewith the givenidfrom this graph if present. -
getNode
Gets theNodeat the given index.- Parameters:
index- the index- Returns:
- the node at the given index
-
getNode
- Parameters:
id- the id of the Node to be removed- Returns:
trueif the graph contains aNodewith the givenid. Elsefalse.
-
getNodes
Returns an array containing all nodes in this graph.- Returns:
- an array of all nodes
-
getApplicationData
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
Sets the application data for the given ID- Parameters:
id- The application ID.data- The application data as XppDom.
-