java.lang.Object
org.jgrapht.nio.BaseEventDrivenImporter<String,Pair<String,String>>
org.jgrapht.nio.dot.DOTEventDrivenImporter
- All Implemented Interfaces:
EventDrivenImporter<String,
Pair<String, String>>
public class DOTEventDrivenImporter
extends BaseEventDrivenImporter<String,Pair<String,String>>
implements EventDrivenImporter<String,Pair<String,String>>
Import a graph from a DOT file.
For a description of the format see http://en.wikipedia.org/wiki/DOT_language and http://www.graphviz.org/doc/info/lang.html
The importer notifies interested parties using consumers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default key used for the graph ID.private boolean
private boolean
private final org.apache.commons.text.translate.CharSequenceTranslator
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new importer.DOTEventDrivenImporter
(boolean notifyVertexAttributesOutOfOrder, boolean notifyEdgeAttributesOutOfOrder) Constructs a new importer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
importInput
(Reader in) Import a graphprivate static String
unescapeHtmlString
(String input) Unescape an HTML string DOT identifier.private String
unescapeId
(String input) Unescape a string DOT identifier.Methods inherited from class org.jgrapht.nio.BaseEventDrivenImporter
addEdgeAttributeConsumer, addEdgeConsumer, addEdgeCountConsumer, addEdgeWithAttributesConsumer, addGraphAttributeConsumer, addImportEventConsumer, addVertexAttributeConsumer, addVertexConsumer, addVertexCountConsumer, addVertexWithAttributesConsumer, notifyEdge, notifyEdgeAttribute, notifyEdgeCount, notifyEdgeWithAttributes, notifyGraphAttribute, notifyImportEvent, notifyVertex, notifyVertexAttribute, notifyVertexCount, notifyVertexWithAttributes, removeEdgeAttributeConsumer, removeEdgeConsumer, removeEdgeCountConsumer, removeEdgeWithAttributesConsumer, removeGraphAttributeConsumer, removeImportEventConsumer, removeVertexAttributeConsumer, removeVertexConsumer, removeVertexCountConsumer, removeVertexWithAttributesConsumer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jgrapht.nio.EventDrivenImporter
addEdgeAttributeConsumer, addEdgeConsumer, addEdgeCountConsumer, addEdgeWithAttributesConsumer, addGraphAttributeConsumer, addImportEventConsumer, addVertexAttributeConsumer, addVertexConsumer, addVertexCountConsumer, addVertexWithAttributesConsumer, importInput, importInput, removeEdgeAttributeConsumer, removeEdgeConsumer, removeEdgeCountConsumer, removeEdgeWithAttributesConsumer, removeGraphAttributeConsumer, removeImportEventConsumer, removeVertexAttributeConsumer, removeVertexConsumer, removeVertexCountConsumer, removeVertexWithAttributesConsumer
-
Field Details
-
DEFAULT_GRAPH_ID_KEY
Default key used for the graph ID.- See Also:
-
unescapeId
private final org.apache.commons.text.translate.CharSequenceTranslator unescapeId -
notifyVertexAttributesOutOfOrder
private boolean notifyVertexAttributesOutOfOrder -
notifyEdgeAttributesOutOfOrder
private boolean notifyEdgeAttributesOutOfOrder
-
-
Constructor Details
-
DOTEventDrivenImporter
public DOTEventDrivenImporter()Constructs a new importer. -
DOTEventDrivenImporter
public DOTEventDrivenImporter(boolean notifyVertexAttributesOutOfOrder, boolean notifyEdgeAttributesOutOfOrder) Constructs a new importer.- Parameters:
notifyVertexAttributesOutOfOrder
- whether to notify for vertex attributes out-of-order even if they appear together in the inputnotifyEdgeAttributesOutOfOrder
- whether to notify for edge attributes out-of-order even if they appear together in the input
-
-
Method Details
-
importInput
Description copied from interface:EventDrivenImporter
Import a graph- Specified by:
importInput
in interfaceEventDrivenImporter<String,
Pair<String, String>> - Parameters:
in
- the input reader- Throws:
ImportException
- in case any error occurs, such as I/O or parse error
-
unescapeId
Unescape a string DOT identifier.- Parameters:
input
- the input- Returns:
- the unescaped output
-
unescapeHtmlString
Unescape an HTML string DOT identifier.- Parameters:
input
- the input- Returns:
- the unescaped output
-