public interface ElementSink
Graph elements listeners are called each time an element of the graph (node or edge) is added or removed. It is also called for special events like "steps" that introduce the notion of time in graphs.
Modifier and Type | Method and Description |
---|---|
void |
edgeAdded(java.lang.String sourceId,
long timeId,
java.lang.String edgeId,
java.lang.String fromNodeId,
java.lang.String toNodeId,
boolean directed)
An edge was inserted in graph.
|
void |
edgeRemoved(java.lang.String sourceId,
long timeId,
java.lang.String edgeId)
An edge of graph was removed.The nodes the edge connects may already have
been removed from the graph.
|
void |
graphCleared(java.lang.String sourceId,
long timeId)
The whole graph was cleared.
|
void |
nodeAdded(java.lang.String sourceId,
long timeId,
java.lang.String nodeId)
A node was inserted in the given graph.
|
void |
nodeRemoved(java.lang.String sourceId,
long timeId,
java.lang.String nodeId)
A node was removed from the graph.
|
void |
stepBegins(java.lang.String sourceId,
long timeId,
double step)
Since dynamic graphs are based on discrete event modifications, the notion of
step is defined to simulate elapsed time between events.
|
void nodeAdded(java.lang.String sourceId, long timeId, java.lang.String nodeId)
sourceId
- Identifier of the graph where the node was added.nodeId
- Identifier of the added node.void nodeRemoved(java.lang.String sourceId, long timeId, java.lang.String nodeId)
sourceId
- Identifier of the graph where the node will be removed.nodeId
- Identifier of the removed node.void edgeAdded(java.lang.String sourceId, long timeId, java.lang.String edgeId, java.lang.String fromNodeId, java.lang.String toNodeId, boolean directed)
sourceId
- Identifier of the graph where the edge was added.edgeId
- Identifier of the added edge.fromNodeId
- Identifier of the first node of the edge.toNodeId
- Identifier of the second node of the edge.directed
- If true, the edge is directed.void edgeRemoved(java.lang.String sourceId, long timeId, java.lang.String edgeId)
sourceId
- The graph where the edge will be removed.edgeId
- The edge that will be removed.void graphCleared(java.lang.String sourceId, long timeId)
sourceId
- The graph cleared.void stepBegins(java.lang.String sourceId, long timeId, double step)
Since dynamic graphs are based on discrete event modifications, the notion of step is defined to simulate elapsed time between events. So a step is a event that occurs in the graph, it does not modify it but it gives a kind of timestamp that allow the tracking of the progress of the graph over the time.
This kind of event is useful for dynamic algorithms that listen to the dynamic graph and need to measure the time in the graph's evolution.
sourceId
- Identifier of the graph where the step starts.timeId
- A numerical value that may give a timestamp to track the evolution
of the graph over the time.