org.grinvin.generators.graphs

Class GraphGeneratorInstanceManager


public class GraphGeneratorInstanceManager
extends java.lang.Object

Manages the mapping between Graph generator instances and their identifiers.

Method Summary

GraphGeneratorInstance
createInstance(GraphGenerator generator)
Create and register an instance from the given generator with its current parameters.
GraphGeneratorInstance
getGraphGeneratorInstance(String id)
Get the GraphGeneratorInstance with the given id.
static GraphGeneratorInstanceManager
getInstance()
Get the singleton instance of this class

Method Details

createInstance

public GraphGeneratorInstance createInstance(GraphGenerator generator)
            throws FactoryException
Create and register an instance from the given generator with its current parameters.
Returns:
the generator instance, unless a generator instance with the same id was already available in cache

getGraphGeneratorInstance

public GraphGeneratorInstance getGraphGeneratorInstance(String id)
            throws UnknownGraphGeneratorInstanceException
Get the GraphGeneratorInstance with the given id. If necessary, the instance is created anew.

getInstance

public static GraphGeneratorInstanceManager getInstance()
Get the singleton instance of this class
Returns:
the single shared instance of this class