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
Modifier and Type Method Description voidaddEdgeAttributeConsumer(java.util.function.BiConsumer<Pair<E,java.lang.String>,Attribute> consumer)Add an edge attribute consumer.voidaddEdgeConsumer(java.util.function.Consumer<E> consumer)Add an edge consumer.voidaddEdgeCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)Add an edge count consumer.voidaddEdgeWithAttributesConsumer(java.util.function.BiConsumer<E,java.util.Map<java.lang.String,Attribute>> consumer)Add an edge with attributes consumer.voidaddGraphAttributeConsumer(java.util.function.BiConsumer<java.lang.String,Attribute> consumer)Add a graph attribute consumer.voidaddImportEventConsumer(java.util.function.Consumer<ImportEvent> consumer)Add an ImportEvent consumer.voidaddVertexAttributeConsumer(java.util.function.BiConsumer<Pair<V,java.lang.String>,Attribute> consumer)Add a vertex attribute consumer.voidaddVertexConsumer(java.util.function.Consumer<V> consumer)Add a vertex consumer.voidaddVertexCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)Add a vertex count consumer.voidaddVertexWithAttributesConsumer(java.util.function.BiConsumer<V,java.util.Map<java.lang.String,Attribute>> consumer)Add a vertex with attributes consumer.protected voidnotifyEdge(E e)Notify for an edge.protected voidnotifyEdgeAttribute(E e, java.lang.String key, Attribute value)Notify for an edge attributeprotected voidnotifyEdgeCount(java.lang.Integer edgeCount)Notify for the edge count.protected voidnotifyEdgeWithAttributes(E e, java.util.Map<java.lang.String,Attribute> attrs)Notify for an edge with attributes.protected voidnotifyGraphAttribute(java.lang.String key, Attribute value)Notify for a graph attributeprotected voidnotifyImportEvent(ImportEvent importEvent)Notify for an importer ImportEventprotected voidnotifyVertex(V v)Notify for a vertex.protected voidnotifyVertexAttribute(V v, java.lang.String key, Attribute value)Notify for a vertex attributeprotected voidnotifyVertexCount(java.lang.Integer vertexCount)Notify for the vertex count.protected voidnotifyVertexWithAttributes(V v, java.util.Map<java.lang.String,Attribute> attrs)Notify for a vertex with attributes.voidremoveEdgeAttributeConsumer(java.util.function.BiConsumer<Pair<E,java.lang.String>,Attribute> consumer)Remove an edge attribute consumer.voidremoveEdgeConsumer(java.util.function.Consumer<E> consumer)Remove an edge consumer.voidremoveEdgeCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)Remove an edge count consumer.voidremoveEdgeWithAttributesConsumer(java.util.function.BiConsumer<E,java.util.Map<java.lang.String,Attribute>> consumer)Remove an edge with attributes consumervoidremoveGraphAttributeConsumer(java.util.function.BiConsumer<java.lang.String,Attribute> consumer)Remove a graph attribute consumer.voidremoveImportEventConsumer(java.util.function.Consumer<ImportEvent> consumer)Remove an ImportEvent consumer.voidremoveVertexAttributeConsumer(java.util.function.BiConsumer<Pair<V,java.lang.String>,Attribute> consumer)Remove a vertex attribute consumer.voidremoveVertexConsumer(java.util.function.Consumer<V> consumer)Remove a vertex consumer.voidremoveVertexCountConsumer(java.util.function.Consumer<java.lang.Integer> consumer)Remove a vertex count consumer.voidremoveVertexWithAttributesConsumer(java.util.function.BiConsumer<V,java.util.Map<java.lang.String,Attribute>> consumer)Remove a vertex with attributes consumer
-
Constructor Details
-
BaseEventDrivenImporter
public BaseEventDrivenImporter()Constructor
-
-
Method Details
-
addImportEventConsumer
Add an ImportEvent consumer.- Parameters:
consumer- the consumer
-
removeImportEventConsumer
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
Add a vertex consumer.- Parameters:
consumer- the consumer
-
removeVertexConsumer
Remove a vertex consumer.- Parameters:
consumer- the consumer
-
addEdgeConsumer
Add an edge consumer.- Parameters:
consumer- the consumer
-
removeEdgeConsumer
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
-
addVertexWithAttributesConsumer
public void addVertexWithAttributesConsumer(java.util.function.BiConsumer<V,java.util.Map<java.lang.String,Attribute>> consumer)Add a vertex with attributes consumer.- Parameters:
consumer- the consumer
-
removeVertexWithAttributesConsumer
public void removeVertexWithAttributesConsumer(java.util.function.BiConsumer<V,java.util.Map<java.lang.String,Attribute>> consumer)Remove a vertex with attributes 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
-
addEdgeWithAttributesConsumer
public void addEdgeWithAttributesConsumer(java.util.function.BiConsumer<E,java.util.Map<java.lang.String,Attribute>> consumer)Add an edge with attributes consumer.- Parameters:
consumer- the consumer
-
removeEdgeWithAttributesConsumer
public void removeEdgeWithAttributesConsumer(java.util.function.BiConsumer<E,java.util.Map<java.lang.String,Attribute>> consumer)Remove an edge with attributes 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
Notify for a vertex.- Parameters:
v- the vertex
-
notifyVertexWithAttributes
Notify for a vertex with attributes.- Parameters:
v- the vertexattrs- the attributes
-
notifyEdge
Notify for an edge.- Parameters:
e- the edge
-
notifyEdgeWithAttributes
Notify for an edge with attributes.- Parameters:
e- the edgeattrs- the attributes
-
notifyGraphAttribute
Notify for a graph attribute- Parameters:
key- the attribute keyvalue- the attribute
-
notifyVertexAttribute
Notify for a vertex attribute- Parameters:
v- the vertexkey- the attribute keyvalue- the attribute
-
notifyEdgeAttribute
Notify for an edge attribute- Parameters:
e- the edgekey- the attribute keyvalue- the attribute
-
notifyImportEvent
Notify for an importer ImportEvent- Parameters:
importEvent- the ImportEvent
-