Class DrawflowGraphFormat.GraphReader
- java.lang.Object
-
- de.iip_ecosphere.platform.configuration.DrawflowGraphFormat.GraphReader
-
- Enclosing class:
- DrawflowGraphFormat
private static class DrawflowGraphFormat.GraphReader extends java.lang.ObjectImplements a graph reader.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private GraphFactoryfactoryprivate java.util.Map<java.lang.String,IvmlGraphMapper.IvmlGraphNode>id2Nodesprivate java.util.Map<java.lang.String,IvmlGraphMapper.IvmlGraphEdge>ids2Edgesprivate DecisionVariableProvidervarProvider
-
Constructor Summary
Constructors Modifier Constructor Description privateGraphReader(GraphFactory factory, DecisionVariableProvider varProvider)Creates a graph reader instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.json.simple.JSONObjectoptional(org.json.simple.JSONObject base, org.json.simple.JSONObject optional)Returnsoptionalif this is an object with contents, elsebase.private IvmlGraphMapper.IvmlGraphread(java.lang.String graph)Reads a JSON representation and returns an IVML graph.private voidreadEdges(java.lang.Object id, org.json.simple.JSONObject node, boolean inputEdges)Reads the edges forid/node.
-
-
-
Field Detail
-
factory
private GraphFactory factory
-
varProvider
private DecisionVariableProvider varProvider
-
id2Nodes
private java.util.Map<java.lang.String,IvmlGraphMapper.IvmlGraphNode> id2Nodes
-
ids2Edges
private java.util.Map<java.lang.String,IvmlGraphMapper.IvmlGraphEdge> ids2Edges
-
-
Constructor Detail
-
GraphReader
private GraphReader(GraphFactory factory, DecisionVariableProvider varProvider)
Creates a graph reader instance.- Parameters:
factory- the graph factoryvarProvider- the variability provider
-
-
Method Detail
-
optional
private org.json.simple.JSONObject optional(org.json.simple.JSONObject base, org.json.simple.JSONObject optional)Returnsoptionalif this is an object with contents, elsebase.- Parameters:
base- the base object to be returned ifoptionalis no valid objectoptional- the optional object, may also be null- Returns:
baseoroptional
-
read
private IvmlGraphMapper.IvmlGraph read(java.lang.String graph) throws java.util.concurrent.ExecutionException
Reads a JSON representation and returns an IVML graph.- Parameters:
graph- the graph to read- Returns:
- the IVML graph representation
- Throws:
java.util.concurrent.ExecutionException- if parsinggraphfails
-
readEdges
private void readEdges(java.lang.Object id, org.json.simple.JSONObject node, boolean inputEdges)Reads the edges forid/node.- Parameters:
id- the node idnode- the nodeinputEdges- are we reading input or output edges
-
-