Class DOTGraphParser<NP,EP,G extends MutableGraph<?,?,NP,EP>>

java.lang.Object
net.automatalib.serialization.dot.DOTGraphParser<NP,EP,G>
Type Parameters:
NP - the node property type
EP - the edge property type
G - the graph type
All Implemented Interfaces:
ModelDeserializer<G>

public class DOTGraphParser<NP,EP,G extends MutableGraph<?,?,NP,EP>> extends Object implements ModelDeserializer<G>
General-purpose DOT parser for MutableGraphs.
  • Constructor Details

    • DOTGraphParser

      public DOTGraphParser(Supplier<G> creator, Function<Map<String,String>,NP> nodeParser, Function<Map<String,String>,EP> edgeParser)
      Parser for (directed) Graphs with a custom graph instance and custom node and edge attributes.
      Parameters:
      creator - a creator that is used to instantiate the returned graph
      nodeParser - a node parser that extracts from a property map of a node the node property
      edgeParser - an edge parser that extracts from a property map of an edge the edge property
  • Method Details

    • readModel

      public G readModel(InputStream is) throws IOException, FormatException
      Description copied from interface: ModelDeserializer
      Reads the contents from the given input stream and de-serializes it into a model instance. If the format is a textual one, the input stream is typically interpreted in UTF-8.

      Note: the input stream will not be closed.

      Specified by:
      readModel in interface ModelDeserializer<NP>
      Parameters:
      is - the input stream to read data from
      Returns:
      the de-serialized model
      Throws:
      IOException - if an error occurred while reading from the stream
      FormatException - if the content of the stream was not in the expected format