I am trying to initialize each of the following where the Graph Object comes from the JUNG graph package (Factory comes from org.apache.commons.collections15):
Factory<Graph<Integer, String>> graphFactory;
Factory<Integer> vertexFactory;
Factory<String> edgeFactory;
I need these three objects in the constructor of the BarabasiAlbertGenerator (click for JavaDoc) Object.
In my reading of the Factory Pattern, I see that it is used to pass off the instantiation of objects to subclasses. So, what I know is:
- There must be some class in the Jung Package that implements the Factory interface that can then instantiate the object I declare 'graphFactory'. Similarly for vertexFactory and edgeFactory
The question is (is what I am assuming correct as well) how do I instantiate these objects and which set of possible types could/would I use for instantiating each object?