![]() |
The Java Developers Almanac 1.4 |
|
e406. Determining If a Preference Node Contains a Specific KeyYou cannot savenull as a preference value. Therefore, if you
retrieve a value using a default value of null, and null is
returned, you can assume that the key is not present.
// Returns true if node contains the specified key; false otherwise.
public static boolean contains(Preferences node, String key) {
return node.get(key, null) != null;
}
e407. Determining If a Preference Node Contains a Specific Value e408. Removing a Preference from a Preference Node e409. Getting and Setting Java Type Values in a Preference e410. Getting the Maximum Size of a Preference Key and Value
© 2002 Addison-Wesley. |