public final class DOTParsers extends Object
Modifier and Type | Field and Description |
---|---|
static Function<Map<String,String>,String> |
DEFAULT_EDGE_PARSER
|
static Function<Map<String,String>,Boolean> |
DEFAULT_FSA_NODE_PARSER
Node property parser that returns
true if a node's "shape " attribute is specified
and equals "doublecircle ". |
static Function<Map<String,String>,Pair<String,String>> |
DEFAULT_MEALY_EDGE_PARSER
Edge input parser that expects an edge's "
label " attribute to be of the form <input>/<property> . |
static Function<Map<String,String>,String> |
DEFAULT_MOORE_NODE_PARSER
Node property parser that expects a node's "
label " attribute to be of the form <id>/<property> . |
static Function<Map<String,String>,String> |
DEFAULT_NODE_PARSER
|
Modifier and Type | Method and Description |
---|---|
static InputModelDeserializer<String,CompactDFA<String>> |
dfa()
Default parser for
DFA s serialized by AutomataLib. |
static <I> InputModelDeserializer<I,CompactDFA<I>> |
dfa(Function<Map<String,String>,Boolean> nodeParser,
Function<Map<String,String>,I> edgeParser)
Parser for
DFA s with custom node and edge attributes. |
static <I,A extends MutableFSA<?,I>> |
fsa(AutomatonCreator<A,I> creator,
Function<Map<String,String>,Boolean> nodeParser,
Function<Map<String,String>,I> edgeParser)
Parser for
FiniteStateAcceptor s with a custom automaton instance and custom node and edge attributes. |
static <I,A extends MutableFSA<?,I>> |
fsa(AutomatonCreator<A,I> creator,
Function<Map<String,String>,Boolean> nodeParser,
Function<Map<String,String>,I> edgeParser,
Collection<String> initialNodeIds)
Parser for
FiniteStateAcceptor s with a custom automaton instance, custom node and edge attributes and
custom labels for the initial nodes. |
static <I,A extends MutableFSA<?,I>> |
fsa(AutomatonCreator<A,I> creator,
Function<Map<String,String>,Boolean> nodeParser,
Function<Map<String,String>,I> edgeParser,
Collection<String> initialNodeIds,
boolean fakeInitialNodeIds)
Parser for
FiniteStateAcceptor s with a custom automaton instance, custom node and edge attributes, custom
labels for initial nodes and a flag whether or not the initial nodes are artificial. |
static ModelDeserializer<CompactGraph<String,String>> |
graph()
Default parser for (directed)
Graph s serialized by AutomataLib. |
static <NP,EP> ModelDeserializer<CompactGraph<NP,EP>> |
graph(Function<Map<String,String>,NP> nodeParser,
Function<Map<String,String>,EP> edgeParser)
Parser for (directed)
Graph s with custom node and edge attributes. |
static <NP,EP,G extends MutableGraph<?,?,NP,EP>> |
graph(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. |
static InputModelDeserializer<String,CompactMealy<String,String>> |
mealy()
Default parser for
MealyMachine s serialized by AutomataLib. |
static <I,O,A extends MutableMealyMachine<?,I,?,O>> |
mealy(AutomatonCreator<A,I> creator,
Function<Map<String,String>,Pair<I,O>> edgeParser)
Parser for
MealyMachine s with a custom automaton instance and custom edge attributes. |
static <I,O,A extends MutableMealyMachine<?,I,?,O>> |
mealy(AutomatonCreator<A,I> creator,
Function<Map<String,String>,Pair<I,O>> edgeParser,
String initialNodeId)
Parser for
MealyMachine s with a custom automaton instance, custom edge attributes and a custom label for
the initial node. |
static <I,O,A extends MutableMealyMachine<?,I,?,O>> |
mealy(AutomatonCreator<A,I> creator,
Function<Map<String,String>,Pair<I,O>> edgeParser,
String initialNodeId,
boolean fakeInitialNodeId)
Parser for
MealyMachine s with a custom automaton instance, custom edge attributes and a custom label for
the initial node and a flag whether or not the initial nodes are artificial. |
static <I,O> InputModelDeserializer<I,CompactMealy<I,O>> |
mealy(Function<Map<String,String>,Pair<I,O>> edgeParser)
Parser for
MealyMachine s with custom edge attributes. |
static InputModelDeserializer<String,CompactMoore<String,String>> |
moore()
Default parser for
MooreMachine s serialized by AutomataLib. |
static <I,O,A extends MutableMooreMachine<?,I,?,O>> |
moore(AutomatonCreator<A,I> creator,
Function<Map<String,String>,O> nodeParser,
Function<Map<String,String>,I> edgeParser)
Parser for
MooreMachine s with a custom automaton instance and custom node and edge attributes. |
static <I,O,A extends MutableMooreMachine<?,I,?,O>> |
moore(AutomatonCreator<A,I> creator,
Function<Map<String,String>,O> nodeParser,
Function<Map<String,String>,I> edgeParser,
String initialNodeId)
Parser for
MooreMachine s with a custom automaton instance, custom node and edge attributes and a custom
label for the initial node. |
static <I,O,A extends MutableMooreMachine<?,I,?,O>> |
moore(AutomatonCreator<A,I> creator,
Function<Map<String,String>,O> nodeParser,
Function<Map<String,String>,I> edgeParser,
String initialNodeId,
boolean fakeInitialNodeId)
Parser for
MooreMachine s with a custom automaton instance, custom node and edge attributes, a custom
label for the initial node and a flag whether or not the initial node is artificial. |
static <I,O> InputModelDeserializer<I,CompactMoore<I,O>> |
moore(Function<Map<String,String>,O> nodeParser,
Function<Map<String,String>,I> edgeParser)
Parser for
MooreMachine s with custom node and edge attributes. |
static InputModelDeserializer<String,CompactNFA<String>> |
nfa()
Default parser for
NFA s serialized by AutomataLib. |
static <I> InputModelDeserializer<I,CompactNFA<I>> |
nfa(Function<Map<String,String>,Boolean> nodeParser,
Function<Map<String,String>,I> edgeParser)
Parser for
NFA s with custom node and edge attributes. |
public static final Function<Map<String,String>,Boolean> DEFAULT_FSA_NODE_PARSER
true
if a node's "shape
" attribute is specified
and equals "doublecircle
". Returns false
otherwise.public static final Function<Map<String,String>,String> DEFAULT_MOORE_NODE_PARSER
label
" attribute to be of the form <id>/<property>
. Returns the string representation of <property>
as-is. Returns null
if the
attribute does not exist or does not match the expected format.public static InputModelDeserializer<String,CompactDFA<String>> dfa()
DFA
s serialized by AutomataLib.
Invokes dfa(Function, Function)
with DEFAULT_FSA_NODE_PARSER
as nodeParser
and DEFAULT_EDGE_PARSER
as edgeParser
.
InputModelDeserializer
for CompactDFA
s.public static <I> InputModelDeserializer<I,CompactDFA<I>> dfa(Function<Map<String,String>,Boolean> nodeParser, Function<Map<String,String>,I> edgeParser)
DFA
s with custom node and edge attributes.
Invokes fsa(AutomatonCreator, Function, Function)
with CompactDFA.Creator
as creator
.
I
- the input symbol typenodeParser
- a node parser that decides for a property map of a node whether it is accepting or notedgeParser
- an edge parser that extracts from a property map of an edge the input symbolInputModelDeserializer
for CompactDFA
s.public static InputModelDeserializer<String,CompactNFA<String>> nfa()
NFA
s serialized by AutomataLib.
Invokes nfa(Function, Function)
with DEFAULT_FSA_NODE_PARSER
as nodeParser
and DEFAULT_EDGE_PARSER
as edgeParser
.
InputModelDeserializer
for CompactNFA
s.public static <I> InputModelDeserializer<I,CompactNFA<I>> nfa(Function<Map<String,String>,Boolean> nodeParser, Function<Map<String,String>,I> edgeParser)
NFA
s with custom node and edge attributes.
Invokes fsa(AutomatonCreator, Function, Function)
with CompactNFA.Creator
as creator
.
I
- the input symbol typenodeParser
- a node parser that decides for a property map of a node whether it is accepting or notedgeParser
- an edge parser that extracts from a property map of an edge the input symbolInputModelDeserializer
for CompactNFA
s.public static <I,A extends MutableFSA<?,I>> InputModelDeserializer<I,A> fsa(AutomatonCreator<A,I> creator, Function<Map<String,String>,Boolean> nodeParser, Function<Map<String,String>,I> edgeParser)
FiniteStateAcceptor
s with a custom automaton instance and custom node and edge attributes.
Invokes fsa(AutomatonCreator, Function, Function, Collection)
with AutomataLib's default initial state
label "__start0
" as initialNodeLabels
.
I
- the input symbol typeA
- the type of the returned automatoncreator
- a creator that is used to instantiate the returned automatonnodeParser
- a node parser that decides for a property map of a node whether it is accepting or notedgeParser
- an edge parser that extracts from a property map of an edge the input symbolInputModelDeserializer
for A
s.public static <I,A extends MutableFSA<?,I>> InputModelDeserializer<I,A> fsa(AutomatonCreator<A,I> creator, Function<Map<String,String>,Boolean> nodeParser, Function<Map<String,String>,I> edgeParser, Collection<String> initialNodeIds)
FiniteStateAcceptor
s with a custom automaton instance, custom node and edge attributes and
custom labels for the initial nodes.
Invokes fsa(AutomatonCreator, Function, Function, Collection, boolean)
with true
as fakeInitialNodeLabels
.
I
- the input symbol typeA
- the type of the returned automatoncreator
- a creator that is used to instantiate the returned automatonnodeParser
- a node parser that decides for a property map of a node whether it is accepting or notedgeParser
- an edge parser that extracts from a property map of an edge the input symbolinitialNodeIds
- the ids of the initial nodesInputModelDeserializer
for A
s.public static <I,A extends MutableFSA<?,I>> InputModelDeserializer<I,A> fsa(AutomatonCreator<A,I> creator, Function<Map<String,String>,Boolean> nodeParser, Function<Map<String,String>,I> edgeParser, Collection<String> initialNodeIds, boolean fakeInitialNodeIds)
FiniteStateAcceptor
s with a custom automaton instance, custom node and edge attributes, custom
labels for initial nodes and a flag whether or not the initial nodes are artificial.I
- the input symbol typeA
- the type of the returned automatoncreator
- a creator that is used to instantiate the returned automatonnodeParser
- a node parser that decides for a property map of a node whether it is accepting or notedgeParser
- an edge parser that extracts from a property map of an edge the input symbolinitialNodeIds
- the ids of the initial nodesfakeInitialNodeIds
- a flag indicating whether or not the initialNodeIds
are artificial or not. If true
, the
nodes matching the initialNodeIds
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. If false
, the nodes
matching the initialNodeIds
will be used as initial nodes.InputModelDeserializer
for A
s.public static InputModelDeserializer<String,CompactMealy<String,String>> mealy()
MealyMachine
s serialized by AutomataLib.
Invokes mealy(Function)
with DEFAULT_MEALY_EDGE_PARSER
as edgeParser
.
InputModelDeserializer
for CompactMealy
s.public static <I,O> InputModelDeserializer<I,CompactMealy<I,O>> mealy(Function<Map<String,String>,Pair<I,O>> edgeParser)
MealyMachine
s with custom edge attributes.
Invokes mealy(AutomatonCreator, Function)
with CompactMealy.Creator
as creator
.
I
- the input symbol typeO
- the output symbol typeedgeParser
- an edge parser that extracts from a property map of an edge the input symbol and transition propertyInputModelDeserializer
for CompactMealy
s.public static <I,O,A extends MutableMealyMachine<?,I,?,O>> InputModelDeserializer<I,A> mealy(AutomatonCreator<A,I> creator, Function<Map<String,String>,Pair<I,O>> edgeParser)
MealyMachine
s with a custom automaton instance and custom edge attributes.
Invokes mealy(AutomatonCreator, Function, String)
with AutomataLib's default initial state label "__start0
" as initialNodeLabel
.
I
- the input symbol typeO
- the output symbol typeA
- the type of the returned automatoncreator
- a creator that is used to instantiate the returned automatonedgeParser
- an edge parser that extracts from a property map of an edge the input symbol and transition propertyInputModelDeserializer
for A
s.public static <I,O,A extends MutableMealyMachine<?,I,?,O>> InputModelDeserializer<I,A> mealy(AutomatonCreator<A,I> creator, Function<Map<String,String>,Pair<I,O>> edgeParser, String initialNodeId)
MealyMachine
s with a custom automaton instance, custom edge attributes and a custom label for
the initial node.
Invokes fsa(AutomatonCreator, Function, Function, Collection, boolean)
with true
as fakeInitialNodeLabels
.
I
- the input symbol typeO
- the output symbol typeA
- the type of the returned automatoncreator
- a creator that is used to instantiate the returned automatonedgeParser
- an edge parser that extracts from a property map of an edge the input symbol and transition propertyinitialNodeId
- the id of the initial nodeInputModelDeserializer
for A
s.public static <I,O,A extends MutableMealyMachine<?,I,?,O>> InputModelDeserializer<I,A> mealy(AutomatonCreator<A,I> creator, Function<Map<String,String>,Pair<I,O>> edgeParser, String initialNodeId, boolean fakeInitialNodeId)
MealyMachine
s with a custom automaton instance, custom edge attributes and a custom label for
the initial node and a flag whether or not the initial nodes are artificial.I
- the input symbol typeO
- the output symbol typeA
- the type of the returned automatoncreator
- a creator that is used to instantiate the returned automatonedgeParser
- an edge parser that extracts from a property map of an edge the input symbol and transition propertyinitialNodeId
- the id of the initial nodefakeInitialNodeId
- a flag indicating whether or not the initialNodeId
are artificial or not. If true
, the
nodes matching the initialNodeId
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. If false
, the nodes
matching the initialNodeId
will be used as initial nodes.InputModelDeserializer
for A
s.public static InputModelDeserializer<String,CompactMoore<String,String>> moore()
MooreMachine
s serialized by AutomataLib.
Invokes moore(Function, Function)
with DEFAULT_MOORE_NODE_PARSER
as nodeParser
and
DEFAULT_EDGE_PARSER
as edgeParser
.
InputModelDeserializer
for CompactMoore
s.public static <I,O> InputModelDeserializer<I,CompactMoore<I,O>> moore(Function<Map<String,String>,O> nodeParser, Function<Map<String,String>,I> edgeParser)
MooreMachine
s with custom node and edge attributes.
Invokes moore(AutomatonCreator, Function, Function)
with CompactMoore.Creator
as creator
.
I
- the input symbol typeO
- the output symbol typenodeParser
- 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 symbolInputModelDeserializer
for CompactMoore
s.public static <I,O,A extends MutableMooreMachine<?,I,?,O>> InputModelDeserializer<I,A> moore(AutomatonCreator<A,I> creator, Function<Map<String,String>,O> nodeParser, Function<Map<String,String>,I> edgeParser)
MooreMachine
s with a custom automaton instance and custom node and edge attributes.
Invokes moore(AutomatonCreator, Function, Function, String)
with AutomataLib's default initial state
label "__start0
" as initialNodeLabel
.
I
- the input symbol typeO
- the output symbol typeA
- the type of the returned automatoncreator
- 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 symbolInputModelDeserializer
for A
s.public static <I,O,A extends MutableMooreMachine<?,I,?,O>> InputModelDeserializer<I,A> moore(AutomatonCreator<A,I> creator, Function<Map<String,String>,O> nodeParser, Function<Map<String,String>,I> edgeParser, String initialNodeId)
MooreMachine
s with a custom automaton instance, custom node and edge attributes and a custom
label for the initial node.
Invokes moore(AutomatonCreator, Function, Function, String, boolean)
with true
as fakeInitialNodeLabel
.
I
- the input symbol typeO
- the output symbol typeA
- the type of the returned automatoncreator
- 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 symbolinitialNodeId
- the id of the initial nodeInputModelDeserializer
for A
s.public static <I,O,A extends MutableMooreMachine<?,I,?,O>> InputModelDeserializer<I,A> moore(AutomatonCreator<A,I> creator, Function<Map<String,String>,O> nodeParser, Function<Map<String,String>,I> edgeParser, String initialNodeId, boolean fakeInitialNodeId)
MooreMachine
s with a custom automaton instance, custom node and edge attributes, a custom
label for the initial node and a flag whether or not the initial node is artificial.I
- the input symbol typeO
- the output symbol typeA
- the type of the returned automatoncreator
- 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 symbolinitialNodeId
- the id of the initial nodefakeInitialNodeId
- a flag indicating whether or not the initialNodeId
are artificial or not. If true
, the
nodes matching the initialNodeId
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. If false
, the nodes
matching the initialNodeId
will be used as initial nodes.InputModelDeserializer
for A
s.public static ModelDeserializer<CompactGraph<String,String>> graph()
Graph
s serialized by AutomataLib.
Invokes graph(Function, Function)
with DEFAULT_NODE_PARSER
as nodeParser
and DEFAULT_EDGE_PARSER
as edgeParser
.
ModelDeserializer
for CompactGraph
s.public static <NP,EP> ModelDeserializer<CompactGraph<NP,EP>> graph(Function<Map<String,String>,NP> nodeParser, Function<Map<String,String>,EP> edgeParser)
Graph
s with custom node and edge attributes.
Invokes graph(Supplier, Function, Function)
with CompactGraph.CompactGraph()
as creator
.
NP
- the node property typeEP
- the edge property typenodeParser
- 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 propertyModelDeserializer
for CompactGraph
s.public static <NP,EP,G extends MutableGraph<?,?,NP,EP>> ModelDeserializer<G> graph(Supplier<G> creator, Function<Map<String,String>,NP> nodeParser, Function<Map<String,String>,EP> edgeParser)
Graph
s with a custom graph instance and custom node and edge attributes.NP
- the node property typeEP
- the edge property typeG
- the graph typecreator
- 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 propertyModelDeserializer
for G
s.Copyright © 2020. All rights reserved.