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 typeEP
- the edge property typeG
- 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 forMutableGraph
s.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description G
readModel(InputStream is)
Reads the contents from the given input stream and de-serializes it into a model instance.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.automatalib.serialization.ModelDeserializer
readModel, readModel, readModel
-
-
-
-
Constructor Detail
-
DOTGraphParser
public DOTGraphParser(Supplier<G> creator, Function<Map<String,String>,NP> nodeParser, Function<Map<String,String>,EP> edgeParser)
Parser for (directed)Graph
s with a custom graph instance and custom node and edge attributes.- Parameters:
creator
- a creator that is used to instantiate the returned graphnodeParser
- a node parser that extracts from a property map of a node the node propertyedgeParser
- an edge parser that extracts from a property map of an edge the edge property
-
-
Method Detail
-
readModel
public G readModel(InputStream is) throws IOException
Description copied from interface:ModelDeserializer
Reads the contents from the given input stream and de-serializes it into a model instance.Note: the input stream will not be closed.
- Specified by:
readModel
in interfaceModelDeserializer<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
-
-