Hi Jesper,<br>
<br>
<br>
<span style="color: rgb(255, 102, 0);">1. Hashtable outConne= <span style="color: rgb(255, 0, 0);">atomObject</span>.getOutConnections();</span><br style="color: rgb(255, 102, 0);">
<br style="color: rgb(255, 102, 0);">
<span style="color: rgb(255, 102, 0);">2. Vector list = (Vector)outConne.get(<span style="color: rgb(255, 0, 0);">atomName</span>);</span><br>
<br>
In the 1 statement, <span style="color: rgb(51, 102, 255);">atomObject is <span style="color: rgb(0, 0, 0);">the object</span> of type JBuilderAtom or JBuilderModel</span>. What exactly I am trying to do in the above two statements is
<br>
1. finding out the out connections (if any) for the JBuilderAtom or JBuilderModel.<br>
I hope this can be achieved thorough the first statement.<br>
2. Next is getting those connections from the hash table with the name of the above object.<br>
<br>
<br>
I hope cleared my problem.<br>
<br>
Regards<br>
Adi<br>
<br>
<br>
<br><br><div><span class="gmail_quote">On 10/24/06, <b class="gmail_sendername">Berthing Jesper</b> <<a href="mailto:f35594@danfoss.com">f35594@danfoss.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>Hi Adi,<br><br>It looks correct, if the atomName[i] is a stored as a key in the HashTable.<br>So if you say that it returns null, the it is not present in the HashTable.<br><br>Try: (I guess that atomName[i] is the name of your connections from the MetaModel)
<br><br>if(true == outConne.containsKey(atomName[i])<br>{<br> Vector list = (Vector)outConne.get(atomName[i]);<br>}<br>else<br>{<br> // Look for another connection<br>}<br><br>toString() function from the HashTable class is also a good way to visualize the content of the HashTable.
<br><br>\Jesper<br><br>-----Original Message-----<br>From: <a href="mailto:gme-users-bounces@list.isis.vanderbilt.edu">gme-users-bounces@list.isis.vanderbilt.edu</a> on behalf of Adi Mallikarjuna Reddy V<br>Sent: Mon 10/23/2006 6:39 PM
<br>To: A list for GME users to share thoughts and discuss bugs and fixes.<br>Subject: [gme-users] Re: Traversing model<br><br>Is anyone in the list know about the following problem.<br><br><br><br>1. Hashtable outConne= atomNames[i].getOutConnections();
<br><br>2. Vector list = (Vector)outConne.get(atomName[i]);<br>Are the above statements correct?<br>I am getting null in the 2 statement. Is it the right way to access the<br>hashtable list?<br><br>Regards<br>Adi<br><br>On 10/21/06, Adi Mallikarjuna Reddy V <
<a href="mailto:adimallikarjunareddy@gmail.com">adimallikarjunareddy@gmail.com</a>><br>wrote:<br>><br>> Hi all,<br>> I got API that I required to traverse the model. But I am facing some<br>> problems. When I tried accessing Connections (In and Out) of an Object
<br>> (Atom, Model), I am getting null as a result. I tried the following APIs<br>><br>> getOutConnections(String name) one which returns Vector<br>> getOutConnections() one which returns Hashtable<br>><br>
> this two functions I tried using the instance of (JBuilderAtom or<br>> JBuilderModel).<br>><br>> I would be helpful if you can help me in this regard.<br>><br>><br>> Regards<br>> Adi<br><br><br>_______________________________________________
<br>gme-users mailing list<br><a href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users@list.isis.vanderbilt.edu</a><br><a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
</a><br><br><br></blockquote></div><br>