Re: [jgrapht-developers] EdgeNameProvider
Brought to you by:
barak_naveh,
perfecthash
From: John V. S. <js...@gm...> - 2007-03-08 08:44:17
|
Trevor Harmon wrote: > I use the VertexNameProvider classes a lot, and I recently had a need > to provide names for the edges in my graph, too. I was surprised to > find that there don't seem to be any EdgeNameProvider classes. Is > there some technical reason for this, or is it simply that nobody's > gotten around to writing name provider code for edges? The latter. > I assume it's the latter case, so I plan to write one myself and > submit it to the JGraphT project. For the design, I'm thinking there > will be an interface called EdgeNameProvider and two implementing > classes, IntegerEdgeNameProvider and StringEdgeNameProvider. Sound > about right? Right. The getEdgeName method in the interface should only take (E edge), with no info about the source and target. If someone needs to derive the edge name based on the source/target, they can do that in their implementation of the interface by giving their constructor a reference to a specific graph and calling to that graph to get the source and target from getEdgeName. JVS |