PDA

View Full Version : Will .getUID give me an app unique id for Data elements?


tspratt
01-20-2004, 08:54 AM
I am dynamically manipulating local data structures and need an application level unique id for nodes that I add.

I have discovered that datapointers inherit the getUID() method from LZNode.

Is this ID unique in my dynamic data set? If I use addNodeFromPointer(), will the copied nodes return unique id's?

And a related question occurs: If I know a data element's UID, can I reference IT directly by that ID? It would save me a lot of recursive searching, but it seems to good to be true.

antun
01-20-2004, 09:22 AM
No, datanodes won't have a unique ID. The getUID() method is so that you can use an LFC object as a hash key (which requires a string).

-Antun

tspratt
01-20-2004, 09:56 AM
Do you have any other suggestions for key generation?

I am considering GUIDs, but it does not appear that Laszlo gives me any way to generate a GUID locally, so they would have to come from the server.

Then there is always date+time+random ...

What IS the getUID() returning on a datapointer? It might be of sme use...