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 for
MutableGraphs.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadModel(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, waitMethods inherited from interface net.automatalib.serialization.ModelDeserializer
readModel, readModel, readModel
-
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 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 Details
-
readModel
Description copied from interface:ModelDeserializerReads 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 inUTF-8.Note: the input stream will not be closed.
- Specified by:
readModelin 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 streamFormatException- if the content of the stream was not in the expected format
-