- java.lang.Object
-
- org.jgrapht.nio.BaseEventDrivenImporter<V,E>
-
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- Direct Known Subclasses:
CSVEventDrivenImporter
,CSVImporter
,DIMACSEventDrivenImporter
,DIMACSImporter
,DOTEventDrivenImporter
,DOTImporter
,GmlEventDrivenImporter
,GmlImporter
,Graph6Sparse6EventDrivenImporter
,Graph6Sparse6Importer
,GraphMLEventDrivenImporter
,GraphMLImporter
,JSONEventDrivenImporter
,JSONImporter
,SimpleGEXFEventDrivenImporter
,SimpleGEXFImporter
,SimpleGraphMLEdgeListImporter
,SimpleGraphMLEventDrivenImporter
,SimpleGraphMLImporter
public abstract class BaseEventDrivenImporter<V,E> extends java.lang.Object
Base implementation for an importer which uses consumers to notify interested parties. Note that this importer does not compute anything, it simply calls the appropriate consumers to do the actual work.- Author:
- Dimitrios Michail
-
-
Constructor Summary
Constructors Constructor Description BaseEventDrivenImporter()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdgeAttributeConsumer(java.util.function.BiConsumer<Pair<E,java.lang.String>,Attribute> consumer)
Add an edge attribute consumer.void
addEdgeConsumer(java.util.function.Consumer<E> consumer)
Add an edge consumer.void
addEdgeCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Add an edge count consumer.void
addGraphAttributeConsumer(java.util.function.BiConsumer<java.lang.String,Attribute> consumer)
Add a graph attribute consumer.void
addImportEventConsumer(java.util.function.Consumer<ImportEvent> consumer)
Add an ImportEvent consumer.void
addVertexAttributeConsumer(java.util.function.BiConsumer<Pair<V,java.lang.String>,Attribute> consumer)
Add a vertex attribute consumer.void
addVertexConsumer(java.util.function.Consumer<V> consumer)
Add a vertex consumer.void
addVertexCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Add a vertex count consumer.protected void
notifyEdge(E e)
Notify for an edge.protected void
notifyEdgeAttribute(E e, java.lang.String key, Attribute value)
Notify for an edge attributeprotected void
notifyEdgeCount(java.lang.Integer edgeCount)
Notify for the edge count.protected void
notifyGraphAttribute(java.lang.String key, Attribute value)
Notify for a graph attributeprotected void
notifyImportEvent(ImportEvent importEvent)
Notify for an importer ImportEventprotected void
notifyVertex(V v)
Notify for a vertex.protected void
notifyVertexAttribute(V v, java.lang.String key, Attribute value)
Notify for a vertex attributeprotected void
notifyVertexCount(java.lang.Integer vertexCount)
Notify for the vertex count.void
removeEdgeAttributeConsumer(java.util.function.BiConsumer<Pair<E,java.lang.String>,Attribute> consumer)
Remove an edge attribute consumer.void
removeEdgeConsumer(java.util.function.Consumer<E> consumer)
Remove an edge consumer.void
removeEdgeCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Remove an edge count consumer.void
removeGraphAttributeConsumer(java.util.function.BiConsumer<java.lang.String,Attribute> consumer)
Remove a graph attribute consumer.void
removeImportEventConsumer(java.util.function.Consumer<ImportEvent> consumer)
Remove an ImportEvent consumer.void
removeVertexAttributeConsumer(java.util.function.BiConsumer<Pair<V,java.lang.String>,Attribute> consumer)
Remove a vertex attribute consumer.void
removeVertexConsumer(java.util.function.Consumer<V> consumer)
Remove a vertex consumer.void
removeVertexCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Remove a vertex count consumer.
-
-
-
Method Detail
-
addImportEventConsumer
public void addImportEventConsumer(java.util.function.Consumer<ImportEvent> consumer)
Add an ImportEvent consumer.- Parameters:
consumer
- the consumer
-
removeImportEventConsumer
public void removeImportEventConsumer(java.util.function.Consumer<ImportEvent> consumer)
Remove an ImportEvent consumer.- Parameters:
consumer
- the consumer
-
addVertexCountConsumer
public void addVertexCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Add a vertex count consumer.- Parameters:
consumer
- the consumer
-
removeVertexCountConsumer
public void removeVertexCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Remove a vertex count consumer.- Parameters:
consumer
- the consumer
-
addEdgeCountConsumer
public void addEdgeCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Add an edge count consumer.- Parameters:
consumer
- the consumer
-
removeEdgeCountConsumer
public void removeEdgeCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)
Remove an edge count consumer.- Parameters:
consumer
- the consumer
-
addVertexConsumer
public void addVertexConsumer(java.util.function.Consumer<V> consumer)
Add a vertex consumer.- Parameters:
consumer
- the consumer
-
removeVertexConsumer
public void removeVertexConsumer(java.util.function.Consumer<V> consumer)
Remove a vertex consumer.- Parameters:
consumer
- the consumer
-
addEdgeConsumer
public void addEdgeConsumer(java.util.function.Consumer<E> consumer)
Add an edge consumer.- Parameters:
consumer
- the consumer
-
removeEdgeConsumer
public void removeEdgeConsumer(java.util.function.Consumer<E> consumer)
Remove an edge consumer.- Parameters:
consumer
- the consumer
-
addGraphAttributeConsumer
public void addGraphAttributeConsumer(java.util.function.BiConsumer<java.lang.String,Attribute> consumer)
Add a graph attribute consumer.- Parameters:
consumer
- the consumer
-
removeGraphAttributeConsumer
public void removeGraphAttributeConsumer(java.util.function.BiConsumer<java.lang.String,Attribute> consumer)
Remove a graph attribute consumer.- Parameters:
consumer
- the consumer
-
addVertexAttributeConsumer
public void addVertexAttributeConsumer(java.util.function.BiConsumer<Pair<V,java.lang.String>,Attribute> consumer)
Add a vertex attribute consumer.- Parameters:
consumer
- the consumer
-
removeVertexAttributeConsumer
public void removeVertexAttributeConsumer(java.util.function.BiConsumer<Pair<V,java.lang.String>,Attribute> consumer)
Remove a vertex attribute consumer.- Parameters:
consumer
- the consumer
-
addEdgeAttributeConsumer
public void addEdgeAttributeConsumer(java.util.function.BiConsumer<Pair<E,java.lang.String>,Attribute> consumer)
Add an edge attribute consumer.- Parameters:
consumer
- the consumer
-
removeEdgeAttributeConsumer
public void removeEdgeAttributeConsumer(java.util.function.BiConsumer<Pair<E,java.lang.String>,Attribute> consumer)
Remove an edge attribute consumer.- Parameters:
consumer
- the consumer
-
notifyVertexCount
protected void notifyVertexCount(java.lang.Integer vertexCount)
Notify for the vertex count.- Parameters:
vertexCount
- the number of vertices in the graph
-
notifyEdgeCount
protected void notifyEdgeCount(java.lang.Integer edgeCount)
Notify for the edge count.- Parameters:
edgeCount
- the number of edges in the graph
-
notifyVertex
protected void notifyVertex(V v)
Notify for a vertex.- Parameters:
v
- the vertex
-
notifyEdge
protected void notifyEdge(E e)
Notify for an edge.- Parameters:
e
- the edge
-
notifyGraphAttribute
protected void notifyGraphAttribute(java.lang.String key, Attribute value)
Notify for a graph attribute- Parameters:
key
- the attribute keyvalue
- the attribute
-
notifyVertexAttribute
protected void notifyVertexAttribute(V v, java.lang.String key, Attribute value)
Notify for a vertex attribute- Parameters:
v
- the vertexkey
- the attribute keyvalue
- the attribute
-
notifyEdgeAttribute
protected void notifyEdgeAttribute(E e, java.lang.String key, Attribute value)
Notify for an edge attribute- Parameters:
e
- the edgekey
- the attribute keyvalue
- the attribute
-
notifyImportEvent
protected void notifyImportEvent(ImportEvent importEvent)
Notify for an importer ImportEvent- Parameters:
importEvent
- the ImportEvent
-
-