In general, toString() is mostly useful for debugging, though the sort() of NodeList (or, more accurately, the comapreto() of Node) also uses the toString() function to sort nodes (on ascending toString() value).
I am interested how to deal with this. I want Node to return the toString() from MMObjectNode, but I do want to have a readable (and concise, if possible) result.
So, what should toString() of MMObjectNode return? And should this or another value be used to sort nodes? take into accoutn here that, in the bridge, a NodeMAnager or RelationManager ALSO is a node. Ideally, Nodemanager.toString() should return something useful.
The possibilities I have thusfar are the following:
1. Return "node #number (type)" for normal nodes, or "node #number1,#number2,#number3 (clusternode)" for clusternodes. Other virtualnodes should provide their own toString() implementation following a similar format.
Note that this mwans Nodemanagers/relationmanagers give the nodenr of the typedef/reldef/typerel nodes.
2. Return the gui() of the node. For nodemanagers this would return the guiname of the buidler. Clusterbuidler should implement a useable gui() function.
This is the current bridge toString().
3. Return all fields in the node. This is pretty hard to read though. This is the current core toString().
4. Nothing. Just use Object.toString()
Maybe people have other ideas? I would like to discuss this before calling a vote.
-- Pierre van Rooden Mediapark, C 107 tel. +31 (0)35 6772815 "Never summon anything bigger than your head."
