Class DOTMutableAutomatonParser<S,I,SP,TP,A extends MutableAutomaton<S,I,?,SP,TP>>
- java.lang.Object
-
- net.automatalib.serialization.dot.DOTMutableAutomatonParser<S,I,SP,TP,A>
-
- Type Parameters:
S
- automaton state typeI
- input symbol typeSP
- state property typeTP
- transition property typeA
- automaton type
- All Implemented Interfaces:
DOTInputModelDeserializer<S,I,A>
,InputModelDeserializer<I,A>
,ModelDeserializer<InputModelData<I,A>>
public class DOTMutableAutomatonParser<S,I,SP,TP,A extends MutableAutomaton<S,I,?,SP,TP>> extends Object implements DOTInputModelDeserializer<S,I,A>
General-purpose DOT parser forMutableAutomaton
s.
-
-
Constructor Summary
Constructors Constructor Description DOTMutableAutomatonParser(AutomatonCreator<A,I> creator, Function<Map<String,String>,SP> nodeParser, Function<Map<String,String>,Pair<I,TP>> edgeParser, Collection<String> initialNodeIds, boolean fakeInitialNodeIds)
Parser for arbitraryMutableAutomaton
s with a custom automaton instance, custom node and edge attributes and custom labels for the initial nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DOTInputModelData<S,I,A>
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.dot.DOTInputModelDeserializer
readModel, readModel, readModel
-
-
-
-
Constructor Detail
-
DOTMutableAutomatonParser
public DOTMutableAutomatonParser(AutomatonCreator<A,I> creator, Function<Map<String,String>,SP> nodeParser, Function<Map<String,String>,Pair<I,TP>> edgeParser, Collection<String> initialNodeIds, boolean fakeInitialNodeIds)
Parser for arbitraryMutableAutomaton
s with a custom automaton instance, custom node and edge attributes and custom labels for the initial nodes.- Parameters:
creator
- a creator that is used to instantiate the returned automatonnodeParser
- a node parser that extracts from a property map of a node the state propertyedgeParser
- an edge parser that extracts from a property map of an edge the input symbol and transition propertyinitialNodeIds
- the ids of the initial nodesfakeInitialNodeIds
- a flag indicating whether theinitialNodeIds
are artificial or not. Iftrue
, the nodes matching theinitialNodeIds
will not be added to the automaton. Instead, their direct successors will be initial states instead. This may be useful for instances where there are artificial nodes used to display in incoming arrow for the actual initial states. Iffalse
, the nodes matching theinitialNodeIds
will be used as initial nodes.
-
-
Method Detail
-
readModel
public DOTInputModelData<S,I,A> 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 interfaceDOTInputModelDeserializer<S,I,SP>
- Specified by:
readModel
in interfaceModelDeserializer<S>
- 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
-
-