[jgrapht-users] getVertex(Object o)
Brought to you by:
barak_naveh,
perfecthash
From: Claudio M. <cla...@gm...> - 2009-04-07 17:01:01
|
Hello to the list members. I write for a topic that looks kind of hot in here: the Graph.getVertex() method. I'm using a SimpleDirectedWeightedGraph ecl to represent words with my own WordNode class and their relationships (with a DefaultWeightedEdge). Each graph vertex (a word for me) has a payload for some statistics (i.e. the number of occurences in the document/corpus). While parsing the document ( or while the application is running ) i want to get access to the node to read its data. I've overidden the .equals() for my WordNode class, so that it actually checks the WordNode.getWord() - String, so the idea is to do a graph.getVertex(new WordNode("whatever")).getOccurences() without the need to hold all the vertexes in another datastructure (like a HashMap), or without surfing the expensive graph.vertexSet(). AFAIK, this is not possible in jgrapht. I don't actually want the getVertex() to work for reference-equality, but for my value-equality through the equals() "interface". Any suggestions? TIA Claudio Martella -- Claudio Martella cla...@gm... |