Package org.graphstream.stream
Interface Replayable
- All Known Implementing Classes:
AbstractGraph,AdjacencyListGraph,DefaultGraph,MultiGraph,SingleGraph,Timeline
public interface Replayable
Defines sources that can be replayed. This is usefull when you are connecting
a sink to a source but you need to get informations about the current state
of the dynamic graph.
Replayable source = ... ; Replayable.Controller replay = source.getReplayController(); ... // source is building a graph ... Graph g = ... ; // // Replay the source to get the current state of the graph // replay.addSink(g); replay.replay();
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceReplayable.ControllerA controller used to replay a source. -
Method Summary
Modifier and Type Method Description Replayable.ControllergetReplayController()Get a controller to replay the graph.static voidreplay(Replayable source, Sink sink)Util method to replay a replayable source into a sink.static voidtryReplay(Source source, Sink sink)Same asreplay(Replayable, Sink)but the first parameter is just aSourceand it will be replayed only if the Replayable interface is implemented.
-
Method Details
-
getReplayController
Replayable.Controller getReplayController()Get a controller to replay the graph.- Returns:
- a new replay controller
-
replay
Util method to replay a replayable source into a sink.- Parameters:
source- a source implementing the Replayable interfacesink- sink which will receive the events produced by the replay
-
tryReplay
Same asreplay(Replayable, Sink)but the first parameter is just aSourceand it will be replayed only if the Replayable interface is implemented.- Parameters:
source- a sourcesink- sink which will receive the events produced by the replay
-