Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26473
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: [Preferences]What is the use of .nodeExists? |
| Date | 2013-11-03 13:18 +0100 |
| Message-ID | <tozhemry7dj0.1ikhc8lu9em95.dlg@40tude.net> (permalink) |
| References | <527638d5$0$3642$426a74cc@news.free.fr> |
On Sun, 03 Nov 2013 12:51:46 +0100, Daniel Moyne wrote: > I do this to create a specific node. > myModulePreferences.node(myGedcomFile); > This will either create the node if it does not exists yet or initialize it > with existing data if it already exists. > I want to know in some cases if a particular node already exists. If I do : > Boolean flag=myModulePreferences.nodeExists(myGedcomName); > It returns always false until I do : > myModulePreferences.node(myGedcomFile); > Then here is ma question : > What is the use of nodeExists(myGedcomName) if you have to use it after node > creation and more generally how can I test whether I have already data > stored in Preferences associated with a particular file. You seem to randomly mix "myGedcomName" and "myGedcomFile". I'm not sure if that is intentional, but if it is, you of course can't check if you have a nome myGedcomFile by using nodeExists(myGedcomName) - that doesn't even make any sense. The use of nodeExists is to check if a node exists. Obviously, nodeExists will return false if the node does not exist, and obviously, if you want it to return true, you have to call if after you add the node. Your question is confusing and seems to lack some detail that you consider obvious and didn't include. You describe the normal and expected behaviour, and then ask "what the use of that" is, which makes no sense to me. The use of nodeExists is exactly the use you have described in the lines above. You can use it the way you do and the answer to your question "how can I test whether I have already data" is "with the code you provided above". More details seem to be needed, as that is likely not what you wanted to hear. Liebe Gruesse, Joerg -- Ich lese meine Emails nicht, replies to Email bleiben also leider ungelesen.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[Preferences]What is the use of .nodeExists? Daniel Moyne <daniel.moyne@free.fr> - 2013-11-03 12:51 +0100
Re: [Preferences]What is the use of .nodeExists? Joerg Meier <joergmmeier@arcor.de> - 2013-11-03 13:18 +0100
Re: [Preferences]What is the use of .nodeExists? Daniel Moyne <daniel.moyne@free.fr> - 2013-11-03 14:16 +0100
csiph-web