org.jgrapht.ext

## Class DOTImporter<V,E>

- java.lang.Object
- - org.jgrapht.ext.DOTImporter<V,E>

-     public class DOTImporter<V,E>
      extends Object

  Imports a graph from a DOT file.

  For a description of the format see http://en.wikipedia.org/wiki/DOT_language and http://www.graphviz.org/doc/info/lang.html

  state machine description (In dot format naturally):

       digraph G {
          1 [label="start" description="Entry point"];
          2 [label="header" description="Processing The header"];
          3 [label="next" description="work out what the type of the next node is"];
          4 [label="edge" description="process an edge entry"];
          5 [label="edge_quotes" description="process a section of an edge in quotes"];
          6 [label="node" description="process a node entry"];
          7 [label="node_quotes" description="process a section of a node in quotes"];
          8 [label="line_comment" description="process and ignore a line comment"];
          9 [label="block_comment" description="process and ignore a block comment"];
          10 [label="done" description="exit point"];
          1 -> 2;
          2 -> 3;
          3 -> 4;
          4 -> 3;
          4 -> 5;
          5 -> 4;
          3 -> 6;
          6 -> 3;
          6 -> 7;
          7 -> 6;
          3 -> 10;
          2 -> 8;
          8 -> 2;
          2 -> 9;
          9 -> 2;
          3 -> 8;
          8 -> 3;
          3 -> 9;
          9 -> 3;
          4 -> 8;
          8 -> 4;
          4 -> 9;
          9 -> 4;
          6 -> 8;
          8 -> 6;
          6 -> 9;
          9 -> 6;
       }

  Author:
    Wil Selwood

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DOTImporter(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider)` Constructs a new DOTImporter with the given providers
    `DOTImporter(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider, VertexUpdater<V> updater)` Constructs a new DOTImporter with the given providers

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `read(String input, AbstractBaseGraph<V,E> graph)` Read a dot formatted string and populate the provided graph.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DOTImporter

          public DOTImporter(VertexProvider<V> vertexProvider,
                     EdgeProvider<V,E> edgeProvider)

      Constructs a new DOTImporter with the given providers
      Parameters:
        `vertexProvider` - Provider to create a vertex
        `edgeProvider` - Provider to create an edge

    - #### DOTImporter

          public DOTImporter(VertexProvider<V> vertexProvider,
                     EdgeProvider<V,E> edgeProvider,
                     VertexUpdater<V> updater)

      Constructs a new DOTImporter with the given providers
      Parameters:
        `vertexProvider` - Provider to create a vertex
        `edgeProvider` - Provider to create an edge
        `updater` - Method used to update an existing Vertex

  - ### Method Detail

    - #### read

          public void read(String input,
                  AbstractBaseGraph<V,E> graph)
                    throws ImportException

      Read a dot formatted string and populate the provided graph.
      Parameters:
        `input` - the content of a dot file.
        `graph` - the graph to update.
      Throws:
        `ImportException` - if there is a problem parsing the file.

Copyright © 2016. All rights reserved.