Package org.graphstream.stream
Class GraphReplay
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.stream.GraphReplay
- All Implemented Interfaces:
Source
public class GraphReplay extends SourceBase implements Source
A simple source of graph events that takes an existing graph and creates a
flow of events by enumerating all nodes, edges and attributes of the graph.
The only method of this class is replay(Graph) that takes a graph as
argument and :
- First exports all graph attributes as attribute-addition events.
- Then exports all nodes as node-creation events.
- For each node exports all the node attributes as attribute-addition events.
- Then exports all edges ad edge-creation events.
- For each edge exports all the edge attribute as attribute-addition events.
Note that this is a source, not a pipe. This means that it has its own identifier and is a producer of "new" events. Also note that is does not export the dynamics of the graph, only its structure at the present time (the evolution of the graph is not stored in the graph, to produce a dynamic flow of events of the evolution of a graph you have to register the sinks in the graph itself just after its creation).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase
SourceBase.ElementType -
Constructor Summary
Constructors Constructor Description GraphReplay(String id) -
Method Summary
Methods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBeginsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
-
Constructor Details
-
Method Details
-
replay
Echo each element and attribute of the graph to the registered sinks.- Parameters:
graph- The graph to export.
-