You can assign a label to each edge which need not be the edge object's toString() output (that's just one of the more popular options). See PluggableRendererContext for details.
Joshua
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-05-04
hi,
I am using the tostringLabeller() method for now.
I have added the time as a label and it is throwing an exception for the edges where the times are the same.
Is there a better way to do the same thing?
Can you share an example?
Thank you,
Gargi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(1) The edge objects must be unique (in the sense of having different hash codes and not comparing as equals with one another). Think of them as elements of a Set.
(2) There are several different ways to associate user data (such as labels) with graph elements (vertices and edges). Properties of the edge objects are just one way to do that. See http://code.google.com/p/jung/wiki/Manual#User_Data_and_Function for a discussion of this (note that you should be using Transformer instead of Function, but the rest of the discussion is accurate).
(3) If you do want to use properties of the edge object, the equals()/hashCode() methods need not be functions of the label property.
Joshua
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to put the time of an event between 2 edges. The time can differ or be the same for any 2 edges. How to do this?
Thanks,
Gargi
You can assign a label to each edge which need not be the edge object's toString() output (that's just one of the more popular options). See PluggableRendererContext for details.
Joshua
hi,
I am using the tostringLabeller() method for now.
I have added the time as a label and it is throwing an exception for the edges where the times are the same.
Is there a better way to do the same thing?
Can you share an example?
Thank you,
Gargi
Gargi:
(1) The edge objects must be unique (in the sense of having different hash codes and not comparing as equals with one another). Think of them as elements of a Set.
(2) There are several different ways to associate user data (such as labels) with graph elements (vertices and edges). Properties of the edge objects are just one way to do that. See http://code.google.com/p/jung/wiki/Manual#User_Data_and_Function for a discussion of this (note that you should be using Transformer instead of Function, but the rest of the discussion is accurate).
(3) If you do want to use properties of the edge object, the equals()/hashCode() methods need not be functions of the label property.
Joshua