public interface GraphFactory extends Serializable
| Class implementing the Graph interface | Corresponding class implementing the GraphFactory interface |
| GraphImpl | GraphImplFactory |
| DirectedGraphImpl | DirectedGraphImplFactory |
| DirectedAcylicGraphImpl | DirectedAcylicGraphImplFactory |
| WeightedGraphImpl | WeightedGraphImplFactory |
| TreeImpl | TreeImplFactory |
| BinaryTreeImpl | TreeImplFactory |
If you only want to replace the Vertex class being created from the factory, the easiest way is to extend the GraphFactory class for the corresponding Graph class that you are providing a factory for and just override the createVertex() method without overriding the createEdge() method.
Otherwise, you must ensure that the Edge being created via the createEdge() method is of the proper type as expected by the corresponding Graph class.
Implementation of this interface must also have a noarg constructor, in order for it to be properly serialized and deserialized from XML.
| Modifier and Type | Method and Description |
|---|---|
Edge |
createEdge(Vertex v1,
Vertex v2)
Factory method to create an Edge.
|
Vertex |
createVertex()
Factory method to create a Vertex.
|
Vertex createVertex()
Internally within OpenJGraph, this method is used in the following:
Copyright © 2019 JULIE Lab, Germany. All rights reserved.