Re: [jgrapht-users] request for general edges
Brought to you by:
barak_naveh,
perfecthash
From: Hans-Martin A. <dr...@go...> - 2010-12-29 19:59:45
|
Thanks for the quick reply. I had overlooked that method signature. That solves my problem. Very nice indeed! Regards Hans-Martin Adorf On Wed, Dec 29, 2010 at 8:51 PM, John Sichi <js...@gm...> wrote: > Such a method already exists. > > http://www.jgrapht.org/javadoc/org/jgrapht/Graph.html#addEdge(V<http://www.jgrapht.org/javadoc/org/jgrapht/Graph.html#addEdge%28V>, > V, E) > > JVS > > On Wed, Dec 29, 2010 at 11:25 AM, Hans-Martin Adorf > <dr...@go...> wrote: > > 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 > > > > > ------------------------------------------------------------------------------ > > Learn how Oracle Real Application Clusters (RAC) One Node allows > customers > > to consolidate database storage, standardize their database environment, > > and, > > should the need arise, upgrade to a full multi-node Oracle RAC database > > without downtime or disruption > > http://p.sf.net/sfu/oracle-sfdevnl > > _______________________________________________ > > jgrapht-users mailing list > > jgr...@li... > > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > > > > |