Class GraphmlGraph


  • public class GraphmlGraph
    extends GraphStreamWrapper
    A graph that can be dumped into compound GraphML format.
    • Constructor Detail

      • GraphmlGraph

        public GraphmlGraph​(java.lang.String title)
        Builds a graph.
        Parameters:
        title - the title of the graph, if any
    • Method Detail

      • getTitle

        public java.lang.String getTitle()
        Yields the title of the graph.
        Returns:
        the title
      • addNode

        public void addNode​(SerializableNode node,
                            boolean entry,
                            boolean exit,
                            SerializableValue label)
        Adds a node to the graph. The label of node will be composed by joining node.toString() ( Object.toString()) with labelGenerator.apply(node) (Function.apply(Object)) through a new line.
        Parameters:
        node - the source node
        entry - whether or not this edge is an entrypoint of the graph
        exit - whether or not this edge is an exitpoint of the graph
        label - the additional label that can be added to each node as a subnode
      • markSubNode

        public void markSubNode​(SerializableNode node,
                                SerializableNode inner)
        Takes note that inner is a subnode of node instead of a proper node of the graph. This removes inner from the graph, and adds a new subgraph to node containing inner.
        Parameters:
        node - the parent node
        inner - the subnode
      • addEdge

        public void addEdge​(SerializableEdge edge)
        Adds an edge to the graph.
        Parameters:
        edge - the source edge
      • dump

        public void dump​(java.io.Writer writer)
                  throws java.io.IOException
        Description copied from class: GraphStreamWrapper
        Dumps this graph through the given Writer.
        Specified by:
        dump in class GraphStreamWrapper
        Parameters:
        writer - the writer to use for dumping the graph
        Throws:
        java.io.IOException - if an I/O error occurs while writing
      • dump

        public void dump​(java.io.Writer writer,
                         boolean format)
                  throws java.io.IOException
        This method provides the actual implementation for dump(Writer), optionally avoiding the xml formatting (i.e. new lines and indentations).
        Parameters:
        writer - the writer to use for dumping the graph
        format - whether or not the output should be formatted
        Throws:
        java.io.IOException - if an I/O error occurs while writing