[jgrapht-users] request for general edges
Brought to you by:
barak_naveh,
perfecthash
From: Hans-Martin A. <dr...@go...> - 2010-12-29 19:25:50
|
Folks, today I explored JGraphT. The design allows me to use any Vertex object that pleases me. I chose to define a class Vertex as public class Vertex<V> { private final V payload; public Vertex(V payload) { this.payload = payload; } public V getObject() { return payload; } @Override public String toString() { return payload.toString(); } } I would like to do the same for the edge. However, the design of JGraphT does not permit a design where I have full control over the edge. I consider this to be a design flaw. I should like to be able to use an edge that has a name, or in general a payload object. This could be achieved, if there were a method graph.addEdge(Edge edge) Edge would have to be an interface with two methods getSource() und getTarget(). Is there anything that stands in the way of such a design change? Why does JGraphT have to have control over the constructor of my edge? Thanks. Dr. Hans-Martin Adorf |