Package org.esa.snap.core.gpf.graph
Class Graph
- java.lang.Object
-
- org.esa.snap.core.gpf.graph.Graph
-
-
Field Summary
Fields Modifier and Type Field Description static String
CURRENT_VERSION
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNode(Node node)
Adds aNode
to the graphcom.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 headerString
getId()
Gets the graph's idNode
getNode(int index)
Gets theNode
at the given index.Node
getNode(String id)
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 versionboolean
removeNode(String id)
Removes theNode
with the givenid
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
-
-
-
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 givenid
.- 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 aNode
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 theNode
with the givenid
from this graph if present.
-
getNode
public Node getNode(int index)
Gets theNode
at the given index.- Parameters:
index
- the index- Returns:
- the node at the given index
-
getNode
public Node getNode(String id)
- Parameters:
id
- the id of the Node to be removed- Returns:
true
if the graph contains aNode
with the givenid
. Elsefalse
.
-
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.
-
-