Class DrawflowGraphFormat.GraphReader

  • Enclosing class:
    DrawflowGraphFormat

    private static class DrawflowGraphFormat.GraphReader
    extends java.lang.Object
    Implements a graph reader.
    Author:
    Holger Eichelberger, SSE
    • Constructor Detail

      • GraphReader

        private GraphReader​(GraphFactory factory,
                            DecisionVariableProvider varProvider)
        Creates a graph reader instance.
        Parameters:
        factory - the graph factory
        varProvider - the variability provider
    • Method Detail

      • optional

        private org.json.simple.JSONObject optional​(org.json.simple.JSONObject base,
                                                    org.json.simple.JSONObject optional)
        Returns optional if this is an object with contents, else base.
        Parameters:
        base - the base object to be returned if optional is no valid object
        optional - the optional object, may also be null
        Returns:
        base or optional
      • 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 parsing graph fails
      • readEdges

        private void readEdges​(java.lang.Object id,
                               org.json.simple.JSONObject node,
                               boolean inputEdges)
        Reads the edges for id/node.
        Parameters:
        id - the node id
        node - the node
        inputEdges - are we reading input or output edges