public interface Generator
extends org.graphstream.stream.Source
A graph generator is an object that can send graph events to create a new graph from an internal description. Some generators will create a static predefined graph, others will be able to continuously evolve Indeed some generators define an end to the generation process, others may continue endlessly.
Each generator, in addition of being a source of events, provide only three methods:
begin()
.
For static generators this often generate a whole graph, for dynamic
generators this only initialise a base graph.nextEvents()
.
This method will, as its name suggests, generate more dynamic
events making the graph evolve. You can call it (repeatedly) only
between a call to begin()
and to end()
. This
method returns a boolean that may indicate that no more events
can be generated.end()
. This method
must ALWAYS be called when finished with the generator.Modifier and Type | Method and Description |
---|---|
void |
begin()
Begin the graph generation.
|
void |
end()
End the graph generation by finalizing it.
|
boolean |
nextEvents()
Perform the next step in generating the graph.
|
void begin()
nextEvents()
method to add elements to the graph.boolean nextEvents()
void end()
nextEvents()
method returned false (or even if you stop before), this method must be
called to finish the graph.