Hi Daniele,
as far as I know there is no explicit function to do this. The following code might help you:
Node targetNode = ...;
Node sourceNode = ...;
for(String key : sourceNode.getAttributeKeySet()){
targetNode.addAttribute(key, sourceNode.getAttribute(key));
}
node.clearAttributes();
All the best
Benjamin
....................................................................
Dipl.-Inform. Benjamin Klatt
Software Engineering (SE)
FZI Forschungszentrum Informatik
Haid-und-Neu-Str. 10–14
76131 Karlsruhe, Germany
Tel. +49 721 9654-690
Fax +49 721 9654-691
....................................................................
Forschungszentrum Informatik (FZI) an der Universität Karlsruhe
Stiftung des bürgerlichen Rechts
Stiftung Az: 14-0563.1 Regierungspräsidium Karlsruhe
Vorstand: Dipl. Wi.-Ing. Michael Flor, Prof. Dr. Ralf Reussner,
Prof. Dr. Rudi Studer, Prof. Dr.-Ing. J. Marius Zöllner
Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus
Von: daniele visaggio [mailto:visaggio.daniele AT gmail.com]
Gesendet: Samstag, 12. Januar 2013 14:19
An: graphstream-users AT litislab.fr; guilhelm savin
Betreff: Re: How to send a node's attribute to another node
Hi Guilhelm,
thanks for the prompt reply. Basically I need to move (something like cut 'n paste) an attribute from one node to another. Let's say nodeA has attribute1. I need to move it to nodeB. After the operation nodeA won't have attribute1 anymore and nodeB will have it. Maybe a method like "node.sendAttribute()" or something like this :-)
Sorry for the poor explanation in my previous mail.
Best Regards
2013/1/12 guilhelm savin <guilhelm.savin AT gmail.com>
Hi Daniele,
I am not sure to understand what you want to do.
The following should work :Node a, b;
b.setAttribute("attr1", a.getAttribute ("attr1"));Is that you want to do ?
Regards
GuilhelmLe 12 janv. 2013 09:58, "daniele visaggio" <visaggio.daniele AT gmail.com> a écrit :
Hi all,
each nodes inside my graph has various attributes. Every attribute consist of a string. I need a way to take a node's attribute and "transmit" it to another node.
Is there a specific method to do so? Sadly graphstream-project.org is down so I can't check the documentation.
Thank you in advance,
Daniele
Archives gérées par MHonArc 2.6.16.