java.util.prefs
Class AbstractPreferences

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.prefs.Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences 
      extended by java.util.prefs.AbstractPreferences

public abstract class AbstractPreferences
extends Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences

This class provides a skeletal implementation of the Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences class, greatly easing the task of implementing it.

This class is for Preferences implementers only. Normal users of the Preferences facility should have no need to consult this documentation. The Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences documentation should suffice.

Implementors must override the nine abstract service-provider interface (SPI) methods: getSpi(String) sample code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) , putSpi(String,String) sample code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) , removeSpi(String) sample code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) , childSpi(String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) , removeNodeSpi() sample code for java.util.prefs.AbstractPreferences.removeNodeSpi() definition code for java.util.prefs.AbstractPreferences.removeNodeSpi() , keysSpi() sample code for java.util.prefs.AbstractPreferences.keysSpi() definition code for java.util.prefs.AbstractPreferences.keysSpi() , childrenNamesSpi() sample code for java.util.prefs.AbstractPreferences.childrenNamesSpi() definition code for java.util.prefs.AbstractPreferences.childrenNamesSpi() , syncSpi() sample code for java.util.prefs.AbstractPreferences.syncSpi() definition code for java.util.prefs.AbstractPreferences.syncSpi() and flushSpi() sample code for java.util.prefs.AbstractPreferences.flushSpi() definition code for java.util.prefs.AbstractPreferences.flushSpi() . All of the concrete methods specify precisely how they are implemented atop these SPI methods. The implementor may, at his discretion, override one or more of the concrete methods if the default implementation is unsatisfactory for any reason, such as performance.

The SPI methods fall into three groups concerning exception behavior. The getSpi method should never throw exceptions, but it doesn't really matter, as any exception thrown by this method will be intercepted by get(String,String) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) , which will return the specified default value to the caller. The removeNodeSpi, keysSpi, childrenNamesSpi, syncSpi and flushSpi methods are specified to throw BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException , and the implementation is required to throw this checked exception if it is unable to perform the operation. The exception propagates outward, causing the corresponding API method to fail.

The remaining SPI methods putSpi(String,String) sample code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) , removeSpi(String) sample code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) and childSpi(String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) have more complicated exception behavior. They are not specified to throw BackingStoreException, as they can generally obey their contracts even if the backing store is unavailable. This is true because they return no information and their effects are not required to become permanent until a subsequent call to {Preferences#flush()} or {Preferences#sync()}. Generally speaking, these SPI methods should not throw exceptions. In some implementations, there may be circumstances under which these calls cannot even enqueue the requested operation for later processing. Even under these circumstances it is generally better to simply ignore the invocation and return, rather than throwing an exception. Under these circumstances, however, all subsequent invocations of flush() and sync should return false, as returning true would imply that all previous operations had successfully been made permanent.

There is one circumstance under which putSpi, removeSpi and childSpi should throw an exception: if the caller lacks sufficient privileges on the underlying operating system to perform the requested operation. This will, for instance, occur on most systems if a non-privileged user attempts to modify system preferences. (The required privileges will vary from implementation to implementation. On some implementations, they are the right to modify the contents of some directory in the file system; on others they are the right to modify contents of some key in a registry.) Under any of these circumstances, it would generally be undesirable to let the program continue executing as if these operations would become permanent at a later time. While implementations are not required to throw an exception under these circumstances, they are encouraged to do so. A SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException would be appropriate.

Most of the SPI methods require the implementation to read or write information at a preferences node. The implementor should beware of the fact that another VM may have concurrently deleted this node from the backing store. It is the implementation's responsibility to recreate the node if it has been deleted.

Implementation note: In Sun's default Preferences implementations, the user's identity is inherited from the underlying operating system and does not change for the lifetime of the virtual machine. It is recognized that server-side Preferences implementations may have the user identity change from request to request, implicitly passed to Preferences methods via the use of a static ThreadLocal sample code for java.lang.ThreadLocal definition code for java.lang.ThreadLocal instance. Authors of such implementations are strongly encouraged to determine the user at the time preferences are accessed (for example by the get(String,String) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) or put(String,String) sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) method) rather than permanently associating a user with each Preferences instance. The latter behavior conflicts with normal Preferences usage and would lead to great confusion.

Since:
1.4
See Also:
Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences

Field Summary
protected  Object sample code for java.lang.Object definition code for java.lang.Object lock sample code for java.util.prefs.AbstractPreferences.lock definition code for java.util.prefs.AbstractPreferences.lock
          An object whose monitor is used to lock this node.
protected  boolean newNode sample code for java.util.prefs.AbstractPreferences.newNode definition code for java.util.prefs.AbstractPreferences.newNode
          This field should be true if this node did not exist in the backing store prior to the creation of this object.
 
Fields inherited from class java.util.prefs.Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
MAX_KEY_LENGTH sample code for java.util.prefs.Preferences.MAX_KEY_LENGTH definition code for java.util.prefs.Preferences.MAX_KEY_LENGTH , MAX_NAME_LENGTH sample code for java.util.prefs.Preferences.MAX_NAME_LENGTH definition code for java.util.prefs.Preferences.MAX_NAME_LENGTH , MAX_VALUE_LENGTH sample code for java.util.prefs.Preferences.MAX_VALUE_LENGTH definition code for java.util.prefs.Preferences.MAX_VALUE_LENGTH
 
Constructor Summary
protected AbstractPreferences sample code for java.util.prefs.AbstractPreferences.AbstractPreferences(java.util.prefs.AbstractPreferences, java.lang.String) definition code for java.util.prefs.AbstractPreferences.AbstractPreferences(java.util.prefs.AbstractPreferences, java.lang.String) (AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences  parent, String sample code for java.lang.String definition code for java.lang.String  name)
          Creates a preference node with the specified parent and the specified name relative to its parent.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String absolutePath sample code for java.util.prefs.AbstractPreferences.absolutePath() definition code for java.util.prefs.AbstractPreferences.absolutePath() ()
          Implements the absolutePath method as per the specification in Preferences.absolutePath() sample code for java.util.prefs.Preferences.absolutePath() definition code for java.util.prefs.Preferences.absolutePath() .
 void addNodeChangeListener sample code for java.util.prefs.AbstractPreferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.AbstractPreferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) (NodeChangeListener sample code for java.util.prefs.NodeChangeListener definition code for java.util.prefs.NodeChangeListener  ncl)
          Registers the specified listener to receive node change events for this node.
 void addPreferenceChangeListener sample code for java.util.prefs.AbstractPreferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.AbstractPreferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) (PreferenceChangeListener sample code for java.util.prefs.PreferenceChangeListener definition code for java.util.prefs.PreferenceChangeListener  pcl)
          Registers the specified listener to receive preference change events for this preference node.
protected  AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences [] cachedChildren sample code for java.util.prefs.AbstractPreferences.cachedChildren() definition code for java.util.prefs.AbstractPreferences.cachedChildren() ()
          Returns all known unremoved children of this node.
 String sample code for java.lang.String definition code for java.lang.String [] childrenNames sample code for java.util.prefs.AbstractPreferences.childrenNames() definition code for java.util.prefs.AbstractPreferences.childrenNames() ()
          Implements the children method as per the specification in Preferences.childrenNames() sample code for java.util.prefs.Preferences.childrenNames() definition code for java.util.prefs.Preferences.childrenNames() .
protected abstract  String sample code for java.lang.String definition code for java.lang.String [] childrenNamesSpi sample code for java.util.prefs.AbstractPreferences.childrenNamesSpi() definition code for java.util.prefs.AbstractPreferences.childrenNamesSpi() ()
          Returns the names of the children of this preference node.
protected abstract  AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences childSpi sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Returns the named child of this preference node, creating it if it does not already exist.
 void clear sample code for java.util.prefs.AbstractPreferences.clear() definition code for java.util.prefs.AbstractPreferences.clear() ()
          Implements the clear method as per the specification in Preferences.clear() sample code for java.util.prefs.Preferences.clear() definition code for java.util.prefs.Preferences.clear() .
 void exportNode sample code for java.util.prefs.AbstractPreferences.exportNode(java.io.OutputStream) definition code for java.util.prefs.AbstractPreferences.exportNode(java.io.OutputStream) (OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  os)
          Implements the exportNode method as per the specification in Preferences.exportNode(OutputStream) sample code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) .
 void exportSubtree sample code for java.util.prefs.AbstractPreferences.exportSubtree(java.io.OutputStream) definition code for java.util.prefs.AbstractPreferences.exportSubtree(java.io.OutputStream) (OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  os)
          Implements the exportSubtree method as per the specification in Preferences.exportSubtree(OutputStream) sample code for java.util.prefs.Preferences.exportSubtree(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportSubtree(java.io.OutputStream) .
 void flush sample code for java.util.prefs.AbstractPreferences.flush() definition code for java.util.prefs.AbstractPreferences.flush() ()
          Implements the flush method as per the specification in Preferences.flush() sample code for java.util.prefs.Preferences.flush() definition code for java.util.prefs.Preferences.flush() .
protected abstract  void flushSpi sample code for java.util.prefs.AbstractPreferences.flushSpi() definition code for java.util.prefs.AbstractPreferences.flushSpi() ()
          This method is invoked with this node locked.
 String sample code for java.lang.String definition code for java.lang.String get sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key, String sample code for java.lang.String definition code for java.lang.String  def)
          Implements the get method as per the specification in Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) .
 boolean getBoolean sample code for java.util.prefs.AbstractPreferences.getBoolean(java.lang.String, boolean) definition code for java.util.prefs.AbstractPreferences.getBoolean(java.lang.String, boolean) (String sample code for java.lang.String definition code for java.lang.String  key, boolean def)
          Implements the getBoolean method as per the specification in Preferences.getBoolean(String,boolean) sample code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) .
 byte[] getByteArray sample code for java.util.prefs.AbstractPreferences.getByteArray(java.lang.String, byte[]) definition code for java.util.prefs.AbstractPreferences.getByteArray(java.lang.String, byte[]) (String sample code for java.lang.String definition code for java.lang.String  key, byte[] def)
          Implements the getByteArray method as per the specification in Preferences.getByteArray(String,byte[]) sample code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) .
protected  AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences getChild sample code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  nodeName)
          Returns the named child if it exists, or null if it does not.
 double getDouble sample code for java.util.prefs.AbstractPreferences.getDouble(java.lang.String, double) definition code for java.util.prefs.AbstractPreferences.getDouble(java.lang.String, double) (String sample code for java.lang.String definition code for java.lang.String  key, double def)
          Implements the getDouble method as per the specification in Preferences.getDouble(String,double) sample code for java.util.prefs.Preferences.getDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.getDouble(java.lang.String, double) .
 float getFloat sample code for java.util.prefs.AbstractPreferences.getFloat(java.lang.String, float) definition code for java.util.prefs.AbstractPreferences.getFloat(java.lang.String, float) (String sample code for java.lang.String definition code for java.lang.String  key, float def)
          Implements the getFloat method as per the specification in Preferences.getFloat(String,float) sample code for java.util.prefs.Preferences.getFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.getFloat(java.lang.String, float) .
 int getInt sample code for java.util.prefs.AbstractPreferences.getInt(java.lang.String, int) definition code for java.util.prefs.AbstractPreferences.getInt(java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  key, int def)
          Implements the getInt method as per the specification in Preferences.getInt(String,int) sample code for java.util.prefs.Preferences.getInt(java.lang.String, int) definition code for java.util.prefs.Preferences.getInt(java.lang.String, int) .
 long getLong sample code for java.util.prefs.AbstractPreferences.getLong(java.lang.String, long) definition code for java.util.prefs.AbstractPreferences.getLong(java.lang.String, long) (String sample code for java.lang.String definition code for java.lang.String  key, long def)
          Implements the getLong method as per the specification in Preferences.getLong(String,long) sample code for java.util.prefs.Preferences.getLong(java.lang.String, long) definition code for java.util.prefs.Preferences.getLong(java.lang.String, long) .
protected abstract  String sample code for java.lang.String definition code for java.lang.String getSpi sample code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key)
          Return the value associated with the specified key at this preference node, or null if there is no association for this key, or the association cannot be determined at this time.
protected  boolean isRemoved sample code for java.util.prefs.AbstractPreferences.isRemoved() definition code for java.util.prefs.AbstractPreferences.isRemoved() ()
          Returns true iff this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
 boolean isUserNode sample code for java.util.prefs.AbstractPreferences.isUserNode() definition code for java.util.prefs.AbstractPreferences.isUserNode() ()
          Implements the isUserNode method as per the specification in Preferences.isUserNode() sample code for java.util.prefs.Preferences.isUserNode() definition code for java.util.prefs.Preferences.isUserNode() .
 String sample code for java.lang.String definition code for java.lang.String [] keys sample code for java.util.prefs.AbstractPreferences.keys() definition code for java.util.prefs.AbstractPreferences.keys() ()
          Implements the keys method as per the specification in Preferences.keys() sample code for java.util.prefs.Preferences.keys() definition code for java.util.prefs.Preferences.keys() .
protected abstract  String sample code for java.lang.String definition code for java.lang.String [] keysSpi sample code for java.util.prefs.AbstractPreferences.keysSpi() definition code for java.util.prefs.AbstractPreferences.keysSpi() ()
          Returns all of the keys that have an associated value in this preference node.
 String sample code for java.lang.String definition code for java.lang.String name sample code for java.util.prefs.AbstractPreferences.name() definition code for java.util.prefs.AbstractPreferences.name() ()
          Implements the name method as per the specification in Preferences.name() sample code for java.util.prefs.Preferences.name() definition code for java.util.prefs.Preferences.name() .
 Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences node sample code for java.util.prefs.AbstractPreferences.node(java.lang.String) definition code for java.util.prefs.AbstractPreferences.node(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  path)
          Implements the node method as per the specification in Preferences.node(String) sample code for java.util.prefs.Preferences.node(java.lang.String) definition code for java.util.prefs.Preferences.node(java.lang.String) .
 boolean nodeExists sample code for java.util.prefs.AbstractPreferences.nodeExists(java.lang.String) definition code for java.util.prefs.AbstractPreferences.nodeExists(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  path)
          Implements the nodeExists method as per the specification in Preferences.nodeExists(String) sample code for java.util.prefs.Preferences.nodeExists(java.lang.String) definition code for java.util.prefs.Preferences.nodeExists(java.lang.String) .
 Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences parent sample code for java.util.prefs.AbstractPreferences.parent() definition code for java.util.prefs.AbstractPreferences.parent() ()
          Implements the parent method as per the specification in Preferences.parent() sample code for java.util.prefs.Preferences.parent() definition code for java.util.prefs.Preferences.parent() .
 void put sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key, String sample code for java.lang.String definition code for java.lang.String  value)
          Implements the put method as per the specification in Preferences.put(String,String) sample code for java.util.prefs.Preferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.put(java.lang.String, java.lang.String) .
 void putBoolean sample code for java.util.prefs.AbstractPreferences.putBoolean(java.lang.String, boolean) definition code for java.util.prefs.AbstractPreferences.putBoolean(java.lang.String, boolean) (String sample code for java.lang.String definition code for java.lang.String  key, boolean value)
          Implements the putBoolean method as per the specification in Preferences.putBoolean(String,boolean) sample code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) .
 void putByteArray sample code for java.util.prefs.AbstractPreferences.putByteArray(java.lang.String, byte[]) definition code for java.util.prefs.AbstractPreferences.putByteArray(java.lang.String, byte[]) (String sample code for java.lang.String definition code for java.lang.String  key, byte[] value)
          Implements the putByteArray method as per the specification in Preferences.putByteArray(String,byte[]) sample code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) .
 void putDouble sample code for java.util.prefs.AbstractPreferences.putDouble(java.lang.String, double) definition code for java.util.prefs.AbstractPreferences.putDouble(java.lang.String, double) (String sample code for java.lang.String definition code for java.lang.String  key, double value)
          Implements the putDouble method as per the specification in Preferences.putDouble(String,double) sample code for java.util.prefs.Preferences.putDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.putDouble(java.lang.String, double) .
 void putFloat sample code for java.util.prefs.AbstractPreferences.putFloat(java.lang.String, float) definition code for java.util.prefs.AbstractPreferences.putFloat(java.lang.String, float) (String sample code for java.lang.String definition code for java.lang.String  key, float value)
          Implements the putFloat method as per the specification in Preferences.putFloat(String,float) sample code for java.util.prefs.Preferences.putFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.putFloat(java.lang.String, float) .
 void putInt sample code for java.util.prefs.AbstractPreferences.putInt(java.lang.String, int) definition code for java.util.prefs.AbstractPreferences.putInt(java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  key, int value)
          Implements the putInt method as per the specification in Preferences.putInt(String,int) sample code for java.util.prefs.Preferences.putInt(java.lang.String, int) definition code for java.util.prefs.Preferences.putInt(java.lang.String, int) .
 void putLong sample code for java.util.prefs.AbstractPreferences.putLong(java.lang.String, long) definition code for java.util.prefs.AbstractPreferences.putLong(java.lang.String, long) (String sample code for java.lang.String definition code for java.lang.String  key, long value)
          Implements the putLong method as per the specification in Preferences.putLong(String,long) sample code for java.util.prefs.Preferences.putLong(java.lang.String, long) definition code for java.util.prefs.Preferences.putLong(java.lang.String, long) .
protected abstract  void putSpi sample code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key, String sample code for java.lang.String definition code for java.lang.String  value)
          Put the given key-value association into this preference node.
 void remove sample code for java.util.prefs.AbstractPreferences.remove(java.lang.String) definition code for java.util.prefs.AbstractPreferences.remove(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key)
          Implements the remove(String) method as per the specification in Preferences.remove(String) sample code for java.util.prefs.Preferences.remove(java.lang.String) definition code for java.util.prefs.Preferences.remove(java.lang.String) .
 void removeNode sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() ()
          Implements the removeNode() method as per the specification in Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() .
 void removeNodeChangeListener sample code for java.util.prefs.AbstractPreferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.AbstractPreferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) (NodeChangeListener sample code for java.util.prefs.NodeChangeListener definition code for java.util.prefs.NodeChangeListener  ncl)
          Removes the specified NodeChangeListener, so it no longer receives change events.
protected abstract  void removeNodeSpi sample code for java.util.prefs.AbstractPreferences.removeNodeSpi() definition code for java.util.prefs.AbstractPreferences.removeNodeSpi() ()
          Removes this preference node, invalidating it and any preferences that it contains.
 void removePreferenceChangeListener sample code for java.util.prefs.AbstractPreferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.AbstractPreferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) (PreferenceChangeListener sample code for java.util.prefs.PreferenceChangeListener definition code for java.util.prefs.PreferenceChangeListener  pcl)
          Removes the specified preference change listener, so it no longer receives preference change events.
protected abstract  void removeSpi sample code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key)
          Remove the association (if any) for the specified key at this preference node.
 void sync sample code for java.util.prefs.AbstractPreferences.sync() definition code for java.util.prefs.AbstractPreferences.sync() ()
          Implements the sync method as per the specification in Preferences.sync() sample code for java.util.prefs.Preferences.sync() definition code for java.util.prefs.Preferences.sync() .
protected abstract  void syncSpi sample code for java.util.prefs.AbstractPreferences.syncSpi() definition code for java.util.prefs.AbstractPreferences.syncSpi() ()
          This method is invoked with this node locked.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.util.prefs.AbstractPreferences.toString() definition code for java.util.prefs.AbstractPreferences.toString() ()
          Returns the absolute path name of this preferences node.
 
Methods inherited from class java.util.prefs.Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
importPreferences sample code for java.util.prefs.Preferences.importPreferences(java.io.InputStream) definition code for java.util.prefs.Preferences.importPreferences(java.io.InputStream) , systemNodeForPackage sample code for java.util.prefs.Preferences.systemNodeForPackage(java.lang.Class) definition code for java.util.prefs.Preferences.systemNodeForPackage(java.lang.Class) , systemRoot sample code for java.util.prefs.Preferences.systemRoot() definition code for java.util.prefs.Preferences.systemRoot() , userNodeForPackage sample code for java.util.prefs.Preferences.userNodeForPackage(java.lang.Class) definition code for java.util.prefs.Preferences.userNodeForPackage(java.lang.Class) , userRoot sample code for java.util.prefs.Preferences.userRoot() definition code for java.util.prefs.Preferences.userRoot()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

newNode sample code for java.util.prefs.AbstractPreferences.newNode

protected boolean newNode
This field should be true if this node did not exist in the backing store prior to the creation of this object. The field is initialized to false, but may be set to true by a subclass constructor (and should not be modified thereafter). This field indicates whether a node change event should be fired when creation is complete.


lock sample code for java.util.prefs.AbstractPreferences.lock

protected final Object sample code for java.lang.Object definition code for java.lang.Object  lock
An object whose monitor is used to lock this node. This object is used in preference to the node itself to reduce the likelihood of intentional or unintentional denial of service due to a locked node. To avoid deadlock, a node is never locked by a thread that holds a lock on a descendant of that node.

Constructor Detail

AbstractPreferences sample code for java.util.prefs.AbstractPreferences(java.util.prefs.AbstractPreferences, java.lang.String) definition code for java.util.prefs.AbstractPreferences(java.util.prefs.AbstractPreferences, java.lang.String)

protected AbstractPreferences(AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences  parent,
                              String sample code for java.lang.String definition code for java.lang.String  name)
Creates a preference node with the specified parent and the specified name relative to its parent.

Parameters:
parent - the parent of this preference node, or null if this is the root.
name - the name of this preference node, relative to its parent, or "" if this is the root.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if name contains a slash ('/'), or parent is null and name isn't "".
Method Detail

put sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String)

public void put(String sample code for java.lang.String definition code for java.lang.String  key,
                String sample code for java.lang.String definition code for java.lang.String  value)
Implements the put method as per the specification in Preferences.put(String,String) sample code for java.util.prefs.Preferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.put(java.lang.String, java.lang.String) .

This implementation checks that the key and value are legal, obtains this preference node's lock, checks that the node has not been removed, invokes putSpi(String,String) sample code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) , and if there are any preference change listeners, enqueues a notification event for processing by the event dispatch thread.

Specified by:
put sample code for java.util.prefs.Preferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.put(java.lang.String, java.lang.String) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key or value is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH or if value.length exceeds MAX_VALUE_LENGTH.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.

get sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String)

public String sample code for java.lang.String definition code for java.lang.String  get(String sample code for java.lang.String definition code for java.lang.String  key,
                  String sample code for java.lang.String definition code for java.lang.String  def)
Implements the get method as per the specification in Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) .

This implementation first checks to see if key is null throwing a NullPointerException if this is the case. Then it obtains this preference node's lock, checks that the node has not been removed, invokes getSpi(String) sample code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) , and returns the result, unless the getSpi invocation returns null or throws an exception, in which case this invocation returns def.

Specified by:
get sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned.
def - the value to be returned in the event that this preference node has no value associated with key.
Returns:
the value associated with key, or def if no value is associated with key.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null. (A null default is permitted.)

remove sample code for java.util.prefs.AbstractPreferences.remove(java.lang.String) definition code for java.util.prefs.AbstractPreferences.remove(java.lang.String)

public void remove(String sample code for java.lang.String definition code for java.lang.String  key)
Implements the remove(String) method as per the specification in Preferences.remove(String) sample code for java.util.prefs.Preferences.remove(java.lang.String) definition code for java.util.prefs.Preferences.remove(java.lang.String) .

This implementation obtains this preference node's lock, checks that the node has not been removed, invokes removeSpi(String) sample code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) and if there are any preference change listeners, enqueues a notification event for processing by the event dispatch thread.

Specified by:
remove sample code for java.util.prefs.Preferences.remove(java.lang.String) definition code for java.util.prefs.Preferences.remove(java.lang.String) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose mapping is to be removed from the preference node.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.

clear sample code for java.util.prefs.AbstractPreferences.clear() definition code for java.util.prefs.AbstractPreferences.clear()

public void clear()
           throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the clear method as per the specification in Preferences.clear() sample code for java.util.prefs.Preferences.clear() definition code for java.util.prefs.Preferences.clear() .

This implementation obtains this preference node's lock, invokes keys() sample code for java.util.prefs.AbstractPreferences.keys() definition code for java.util.prefs.AbstractPreferences.keys() to obtain an array of keys, and iterates over the array invoking remove(String) sample code for java.util.prefs.AbstractPreferences.remove(java.lang.String) definition code for java.util.prefs.AbstractPreferences.remove(java.lang.String) on each key.

Specified by:
clear sample code for java.util.prefs.Preferences.clear() definition code for java.util.prefs.Preferences.clear() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode()

putInt sample code for java.util.prefs.AbstractPreferences.putInt(java.lang.String, int) definition code for java.util.prefs.AbstractPreferences.putInt(java.lang.String, int)

public void putInt(String sample code for java.lang.String definition code for java.lang.String  key,
                   int value)
Implements the putInt method as per the specification in Preferences.putInt(String,int) sample code for java.util.prefs.Preferences.putInt(java.lang.String, int) definition code for java.util.prefs.Preferences.putInt(java.lang.String, int) .

This implementation translates value to a string with Integer.toString(int) sample code for java.lang.Integer.toString(int) definition code for java.lang.Integer.toString(int) and invokes put(String,String) sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) on the result.

Specified by:
putInt sample code for java.util.prefs.Preferences.putInt(java.lang.String, int) definition code for java.util.prefs.Preferences.putInt(java.lang.String, int) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.getInt(String,int) sample code for java.util.prefs.Preferences.getInt(java.lang.String, int) definition code for java.util.prefs.Preferences.getInt(java.lang.String, int)

getInt sample code for java.util.prefs.AbstractPreferences.getInt(java.lang.String, int) definition code for java.util.prefs.AbstractPreferences.getInt(java.lang.String, int)

public int getInt(String sample code for java.lang.String definition code for java.lang.String  key,
                  int def)
Implements the getInt method as per the specification in Preferences.getInt(String,int) sample code for java.util.prefs.Preferences.getInt(java.lang.String, int) definition code for java.util.prefs.Preferences.getInt(java.lang.String, int) .

This implementation invokes get(key, null) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) . If the return value is non-null, the implementation attempts to translate it to an int with Integer.parseInt(String) sample code for java.lang.Integer.parseInt(java.lang.String) definition code for java.lang.Integer.parseInt(java.lang.String) . If the attempt succeeds, the return value is returned by this method. Otherwise, def is returned.

Specified by:
getInt sample code for java.util.prefs.Preferences.getInt(java.lang.String, int) definition code for java.util.prefs.Preferences.getInt(java.lang.String, int) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned as an int.
def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as an int.
Returns:
the int value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as an int.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
See Also:
Preferences.putInt(String,int) sample code for java.util.prefs.Preferences.putInt(java.lang.String, int) definition code for java.util.prefs.Preferences.putInt(java.lang.String, int) , Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String)

putLong sample code for java.util.prefs.AbstractPreferences.putLong(java.lang.String, long) definition code for java.util.prefs.AbstractPreferences.putLong(java.lang.String, long)

public void putLong(String sample code for java.lang.String definition code for java.lang.String  key,
                    long value)
Implements the putLong method as per the specification in Preferences.putLong(String,long) sample code for java.util.prefs.Preferences.putLong(java.lang.String, long) definition code for java.util.prefs.Preferences.putLong(java.lang.String, long) .

This implementation translates value to a string with Long.toString(long) sample code for java.lang.Long.toString(long) definition code for java.lang.Long.toString(long) and invokes put(String,String) sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) on the result.

Specified by:
putLong sample code for java.util.prefs.Preferences.putLong(java.lang.String, long) definition code for java.util.prefs.Preferences.putLong(java.lang.String, long) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.getLong(String,long) sample code for java.util.prefs.Preferences.getLong(java.lang.String, long) definition code for java.util.prefs.Preferences.getLong(java.lang.String, long)

getLong sample code for java.util.prefs.AbstractPreferences.getLong(java.lang.String, long) definition code for java.util.prefs.AbstractPreferences.getLong(java.lang.String, long)

public long getLong(String sample code for java.lang.String definition code for java.lang.String  key,
                    long def)
Implements the getLong method as per the specification in Preferences.getLong(String,long) sample code for java.util.prefs.Preferences.getLong(java.lang.String, long) definition code for java.util.prefs.Preferences.getLong(java.lang.String, long) .

This implementation invokes get(key, null) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) . If the return value is non-null, the implementation attempts to translate it to a long with Long.parseLong(String) sample code for java.lang.Long.parseLong(java.lang.String) definition code for java.lang.Long.parseLong(java.lang.String) . If the attempt succeeds, the return value is returned by this method. Otherwise, def is returned.

Specified by:
getLong sample code for java.util.prefs.Preferences.getLong(java.lang.String, long) definition code for java.util.prefs.Preferences.getLong(java.lang.String, long) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned as a long.
def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a long.
Returns:
the long value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a long.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
See Also:
Preferences.putLong(String,long) sample code for java.util.prefs.Preferences.putLong(java.lang.String, long) definition code for java.util.prefs.Preferences.putLong(java.lang.String, long) , Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String)

putBoolean sample code for java.util.prefs.AbstractPreferences.putBoolean(java.lang.String, boolean) definition code for java.util.prefs.AbstractPreferences.putBoolean(java.lang.String, boolean)

public void putBoolean(String sample code for java.lang.String definition code for java.lang.String  key,
                       boolean value)
Implements the putBoolean method as per the specification in Preferences.putBoolean(String,boolean) sample code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) .

This implementation translates value to a string with String.valueOf(boolean) sample code for java.lang.String.valueOf(boolean) definition code for java.lang.String.valueOf(boolean) and invokes put(String,String) sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) on the result.

Specified by:
putBoolean sample code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.getBoolean(String,boolean) sample code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) , Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String)

getBoolean sample code for java.util.prefs.AbstractPreferences.getBoolean(java.lang.String, boolean) definition code for java.util.prefs.AbstractPreferences.getBoolean(java.lang.String, boolean)

public boolean getBoolean(String sample code for java.lang.String definition code for java.lang.String  key,
                          boolean def)
Implements the getBoolean method as per the specification in Preferences.getBoolean(String,boolean) sample code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) .

This implementation invokes get(key, null) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) . If the return value is non-null, it is compared with "true" using String.equalsIgnoreCase(String) sample code for java.lang.String.equalsIgnoreCase(java.lang.String) definition code for java.lang.String.equalsIgnoreCase(java.lang.String) . If the comparison returns true, this invocation returns true. Otherwise, the original return value is compared with "false", again using String.equalsIgnoreCase(String) sample code for java.lang.String.equalsIgnoreCase(java.lang.String) definition code for java.lang.String.equalsIgnoreCase(java.lang.String) . If the comparison returns true, this invocation returns false. Otherwise, this invocation returns def.

Specified by:
getBoolean sample code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.getBoolean(java.lang.String, boolean) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned as a boolean.
def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a boolean.
Returns:
the boolean value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a boolean.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
See Also:
Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) , Preferences.putBoolean(String,boolean) sample code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean) definition code for java.util.prefs.Preferences.putBoolean(java.lang.String, boolean)

putFloat sample code for java.util.prefs.AbstractPreferences.putFloat(java.lang.String, float) definition code for java.util.prefs.AbstractPreferences.putFloat(java.lang.String, float)

public void putFloat(String sample code for java.lang.String definition code for java.lang.String  key,
                     float value)
Implements the putFloat method as per the specification in Preferences.putFloat(String,float) sample code for java.util.prefs.Preferences.putFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.putFloat(java.lang.String, float) .

This implementation translates value to a string with Float.toString(float) sample code for java.lang.Float.toString(float) definition code for java.lang.Float.toString(float) and invokes put(String,String) sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) on the result.

Specified by:
putFloat sample code for java.util.prefs.Preferences.putFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.putFloat(java.lang.String, float) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.getFloat(String,float) sample code for java.util.prefs.Preferences.getFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.getFloat(java.lang.String, float)

getFloat sample code for java.util.prefs.AbstractPreferences.getFloat(java.lang.String, float) definition code for java.util.prefs.AbstractPreferences.getFloat(java.lang.String, float)

public float getFloat(String sample code for java.lang.String definition code for java.lang.String  key,
                      float def)
Implements the getFloat method as per the specification in Preferences.getFloat(String,float) sample code for java.util.prefs.Preferences.getFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.getFloat(java.lang.String, float) .

This implementation invokes get(key, null) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) . If the return value is non-null, the implementation attempts to translate it to an float with Float.parseFloat(String) sample code for java.lang.Float.parseFloat(java.lang.String) definition code for java.lang.Float.parseFloat(java.lang.String) . If the attempt succeeds, the return value is returned by this method. Otherwise, def is returned.

Specified by:
getFloat sample code for java.util.prefs.Preferences.getFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.getFloat(java.lang.String, float) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned as a float.
def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a float.
Returns:
the float value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a float.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
See Also:
Preferences.putFloat(String,float) sample code for java.util.prefs.Preferences.putFloat(java.lang.String, float) definition code for java.util.prefs.Preferences.putFloat(java.lang.String, float) , Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String)

putDouble sample code for java.util.prefs.AbstractPreferences.putDouble(java.lang.String, double) definition code for java.util.prefs.AbstractPreferences.putDouble(java.lang.String, double)

public void putDouble(String sample code for java.lang.String definition code for java.lang.String  key,
                      double value)
Implements the putDouble method as per the specification in Preferences.putDouble(String,double) sample code for java.util.prefs.Preferences.putDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.putDouble(java.lang.String, double) .

This implementation translates value to a string with Double.toString(double) sample code for java.lang.Double.toString(double) definition code for java.lang.Double.toString(double) and invokes put(String,String) sample code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.put(java.lang.String, java.lang.String) on the result.

Specified by:
putDouble sample code for java.util.prefs.Preferences.putDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.putDouble(java.lang.String, double) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.getDouble(String,double) sample code for java.util.prefs.Preferences.getDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.getDouble(java.lang.String, double)

getDouble sample code for java.util.prefs.AbstractPreferences.getDouble(java.lang.String, double) definition code for java.util.prefs.AbstractPreferences.getDouble(java.lang.String, double)

public double getDouble(String sample code for java.lang.String definition code for java.lang.String  key,
                        double def)
Implements the getDouble method as per the specification in Preferences.getDouble(String,double) sample code for java.util.prefs.Preferences.getDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.getDouble(java.lang.String, double) .

This implementation invokes get(key, null) sample code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.get(java.lang.String, java.lang.String) . If the return value is non-null, the implementation attempts to translate it to an double with Double.parseDouble(String) sample code for java.lang.Double.parseDouble(java.lang.String) definition code for java.lang.Double.parseDouble(java.lang.String) . If the attempt succeeds, the return value is returned by this method. Otherwise, def is returned.

Specified by:
getDouble sample code for java.util.prefs.Preferences.getDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.getDouble(java.lang.String, double) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned as a double.
def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a double.
Returns:
the double value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a double.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null.
See Also:
Preferences.putDouble(String,double) sample code for java.util.prefs.Preferences.putDouble(java.lang.String, double) definition code for java.util.prefs.Preferences.putDouble(java.lang.String, double) , Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String)

putByteArray sample code for java.util.prefs.AbstractPreferences.putByteArray(java.lang.String, byte[]) definition code for java.util.prefs.AbstractPreferences.putByteArray(java.lang.String, byte[])

public void putByteArray(String sample code for java.lang.String definition code for java.lang.String  key,
                         byte[] value)
Implements the putByteArray method as per the specification in Preferences.putByteArray(String,byte[]) sample code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) .

Specified by:
putByteArray sample code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key with which the string form of value is to be associated.
value - value whose string form is to be associated with key.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key or value is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if key.length() exceeds MAX_KEY_LENGTH or if value.length exceeds MAX_VALUE_LENGTH*3/4.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.getByteArray(String,byte[]) sample code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) , Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String)

getByteArray sample code for java.util.prefs.AbstractPreferences.getByteArray(java.lang.String, byte[]) definition code for java.util.prefs.AbstractPreferences.getByteArray(java.lang.String, byte[])

public byte[] getByteArray(String sample code for java.lang.String definition code for java.lang.String  key,
                           byte[] def)
Implements the getByteArray method as per the specification in Preferences.getByteArray(String,byte[]) sample code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) .

Specified by:
getByteArray sample code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.getByteArray(java.lang.String, byte[]) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
key - key whose associated value is to be returned as a byte array.
def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a byte array.
Returns:
the byte array value represented by the string associated with key in this preference node, or def if the associated value does not exist or cannot be interpreted as a byte array.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if key is null. (A null value for def is permitted.)
See Also:
Preferences.get(String,String) sample code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) definition code for java.util.prefs.Preferences.get(java.lang.String, java.lang.String) , Preferences.putByteArray(String,byte[]) sample code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[]) definition code for java.util.prefs.Preferences.putByteArray(java.lang.String, byte[])

keys sample code for java.util.prefs.AbstractPreferences.keys() definition code for java.util.prefs.AbstractPreferences.keys()

public String sample code for java.lang.String definition code for java.lang.String [] keys()
              throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the keys method as per the specification in Preferences.keys() sample code for java.util.prefs.Preferences.keys() definition code for java.util.prefs.Preferences.keys() .

This implementation obtains this preference node's lock, checks that the node has not been removed and invokes keysSpi() sample code for java.util.prefs.AbstractPreferences.keysSpi() definition code for java.util.prefs.AbstractPreferences.keysSpi() .

Specified by:
keys sample code for java.util.prefs.Preferences.keys() definition code for java.util.prefs.Preferences.keys() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
an array of the keys that have an associated value in this preference node.
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.

childrenNames sample code for java.util.prefs.AbstractPreferences.childrenNames() definition code for java.util.prefs.AbstractPreferences.childrenNames()

public String sample code for java.lang.String definition code for java.lang.String [] childrenNames()
                       throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the children method as per the specification in Preferences.childrenNames() sample code for java.util.prefs.Preferences.childrenNames() definition code for java.util.prefs.Preferences.childrenNames() .

This implementation obtains this preference node's lock, checks that the node has not been removed, constructs a TreeSet initialized to the names of children already cached (the children in this node's "child-cache"), invokes childrenNamesSpi() sample code for java.util.prefs.AbstractPreferences.childrenNamesSpi() definition code for java.util.prefs.AbstractPreferences.childrenNamesSpi() , and adds all of the returned child-names into the set. The elements of the tree set are dumped into a String array using the toArray method, and this array is returned.

Specified by:
childrenNames sample code for java.util.prefs.Preferences.childrenNames() definition code for java.util.prefs.Preferences.childrenNames() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
the names of the children of this preference node.
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
cachedChildren() sample code for java.util.prefs.AbstractPreferences.cachedChildren() definition code for java.util.prefs.AbstractPreferences.cachedChildren()

cachedChildren sample code for java.util.prefs.AbstractPreferences.cachedChildren() definition code for java.util.prefs.AbstractPreferences.cachedChildren()

protected final AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences [] cachedChildren()
Returns all known unremoved children of this node.

Returns:
all known unremoved children of this node.

parent sample code for java.util.prefs.AbstractPreferences.parent() definition code for java.util.prefs.AbstractPreferences.parent()

public Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences  parent()
Implements the parent method as per the specification in Preferences.parent() sample code for java.util.prefs.Preferences.parent() definition code for java.util.prefs.Preferences.parent() .

This implementation obtains this preference node's lock, checks that the node has not been removed and returns the parent value that was passed to this node's constructor.

Specified by:
parent sample code for java.util.prefs.Preferences.parent() definition code for java.util.prefs.Preferences.parent() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
the parent of this preference node.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.

node sample code for java.util.prefs.AbstractPreferences.node(java.lang.String) definition code for java.util.prefs.AbstractPreferences.node(java.lang.String)

public Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences  node(String sample code for java.lang.String definition code for java.lang.String  path)
Implements the node method as per the specification in Preferences.node(String) sample code for java.util.prefs.Preferences.node(java.lang.String) definition code for java.util.prefs.Preferences.node(java.lang.String) .

This implementation obtains this preference node's lock and checks that the node has not been removed. If path is "", this node is returned; if path is "/", this node's root is returned. If the first character in path is not '/', the implementation breaks path into tokens and recursively traverses the path from this node to the named node, "consuming" a name and a slash from path at each step of the traversal. At each step, the current node is locked and the node's child-cache is checked for the named node. If it is not found, the name is checked to make sure its length does not exceed MAX_NAME_LENGTH. Then the childSpi(String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) method is invoked, and the result stored in this node's child-cache. If the newly created Preferences object's newNode sample code for java.util.prefs.AbstractPreferences.newNode definition code for java.util.prefs.AbstractPreferences.newNode field is true and there are any node change listeners, a notification event is enqueued for processing by the event dispatch thread.

When there are no more tokens, the last value found in the child-cache or returned by childSpi is returned by this method. If during the traversal, two "/" tokens occur consecutively, or the final token is "/" (rather than a name), an appropriate IllegalArgumentException is thrown.

If the first character of path is '/' (indicating an absolute path name name) this preference node's lock is dropped prior to breaking path into tokens, and this method recursively traverses the path starting from the root (rather than starting from this node). The traversal is otherwise identical to the one described for relative path names. Dropping the lock on this node prior to commencing the traversal at the root node is essential to avoid the possibility of deadlock, as per the locking invariant sample code for java.util.prefs.AbstractPreferences.lock definition code for java.util.prefs.AbstractPreferences.lock .

Specified by:
node sample code for java.util.prefs.Preferences.node(java.lang.String) definition code for java.util.prefs.Preferences.node(java.lang.String) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
path - the path name of the preference node to return.
Returns:
the specified preference node.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the path name is invalid (i.e., it contains multiple consecutive slash characters, or ends with a slash character and is more than one character long).
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
Preferences.flush() sample code for java.util.prefs.Preferences.flush() definition code for java.util.prefs.Preferences.flush()

nodeExists sample code for java.util.prefs.AbstractPreferences.nodeExists(java.lang.String) definition code for java.util.prefs.AbstractPreferences.nodeExists(java.lang.String)

public boolean nodeExists(String sample code for java.lang.String definition code for java.lang.String  path)
                   throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the nodeExists method as per the specification in Preferences.nodeExists(String) sample code for java.util.prefs.Preferences.nodeExists(java.lang.String) definition code for java.util.prefs.Preferences.nodeExists(java.lang.String) .

This implementation is very similar to node(String) sample code for java.util.prefs.AbstractPreferences.node(java.lang.String) definition code for java.util.prefs.AbstractPreferences.node(java.lang.String) , except that getChild(String) sample code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) is used instead of childSpi(String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) .

Specified by:
nodeExists sample code for java.util.prefs.Preferences.nodeExists(java.lang.String) definition code for java.util.prefs.Preferences.nodeExists(java.lang.String) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
path - the path name of the node whose existence is to be checked.
Returns:
true if the specified node exists.
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the path name is invalid (i.e., it contains multiple consecutive slash characters, or ends with a slash character and is more than one character long).
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method and pathname is not the empty string ("").

removeNode sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode()

public void removeNode()
                throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the removeNode() method as per the specification in Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() .

This implementation checks to see that this node is the root; if so, it throws an appropriate exception. Then, it locks this node's parent, and calls a recursive helper method that traverses the subtree rooted at this node. The recursive method locks the node on which it was called, checks that it has not already been removed, and then ensures that all of its children are cached: The childrenNamesSpi() sample code for java.util.prefs.AbstractPreferences.childrenNamesSpi() definition code for java.util.prefs.AbstractPreferences.childrenNamesSpi() method is invoked and each returned child name is checked for containment in the child-cache. If a child is not already cached, the childSpi(String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) method is invoked to create a Preferences instance for it, and this instance is put into the child-cache. Then the helper method calls itself recursively on each node contained in its child-cache. Next, it invokes removeNodeSpi() sample code for java.util.prefs.AbstractPreferences.removeNodeSpi() definition code for java.util.prefs.AbstractPreferences.removeNodeSpi() , marks itself as removed, and removes itself from its parent's child-cache. Finally, if there are any node change listeners, it enqueues a notification event for processing by the event dispatch thread.

Note that the helper method is always invoked with all ancestors up to the "closest non-removed ancestor" locked.

Specified by:
removeNode sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has already been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if this method is invoked on the root node.
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
See Also:
Preferences.flush() sample code for java.util.prefs.Preferences.flush() definition code for java.util.prefs.Preferences.flush()

name sample code for java.util.prefs.AbstractPreferences.name() definition code for java.util.prefs.AbstractPreferences.name()

public String sample code for java.lang.String definition code for java.lang.String  name()
Implements the name method as per the specification in Preferences.name() sample code for java.util.prefs.Preferences.name() definition code for java.util.prefs.Preferences.name() .

This implementation merely returns the name that was passed to this node's constructor.

Specified by:
name sample code for java.util.prefs.Preferences.name() definition code for java.util.prefs.Preferences.name() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
this preference node's name, relative to its parent.

absolutePath sample code for java.util.prefs.AbstractPreferences.absolutePath() definition code for java.util.prefs.AbstractPreferences.absolutePath()

public String sample code for java.lang.String definition code for java.lang.String  absolutePath()
Implements the absolutePath method as per the specification in Preferences.absolutePath() sample code for java.util.prefs.Preferences.absolutePath() definition code for java.util.prefs.Preferences.absolutePath() .

This implementation merely returns the absolute path name that was computed at the time that this node was constructed (based on the name that was passed to this node's constructor, and the names that were passed to this node's ancestors' constructors).

Specified by:
absolutePath sample code for java.util.prefs.Preferences.absolutePath() definition code for java.util.prefs.Preferences.absolutePath() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
this preference node's absolute path name.

isUserNode sample code for java.util.prefs.AbstractPreferences.isUserNode() definition code for java.util.prefs.AbstractPreferences.isUserNode()

public boolean isUserNode()
Implements the isUserNode method as per the specification in Preferences.isUserNode() sample code for java.util.prefs.Preferences.isUserNode() definition code for java.util.prefs.Preferences.isUserNode() .

This implementation compares this node's root node (which is stored in a private field) with the value returned by Preferences.userRoot() sample code for java.util.prefs.Preferences.userRoot() definition code for java.util.prefs.Preferences.userRoot() . If the two object references are identical, this method returns true.

Specified by:
isUserNode sample code for java.util.prefs.Preferences.isUserNode() definition code for java.util.prefs.Preferences.isUserNode() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
true if this preference node is in the user preference tree, false if it's in the system preference tree.

addPreferenceChangeListener sample code for java.util.prefs.AbstractPreferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.AbstractPreferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener)

public void addPreferenceChangeListener(PreferenceChangeListener sample code for java.util.prefs.PreferenceChangeListener definition code for java.util.prefs.PreferenceChangeListener  pcl)
Description copied from class: Preferences sample code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener)
Registers the specified listener to receive preference change events for this preference node. A preference change event is generated when a preference is added to this node, removed from this node, or when the value associated with a preference is changed. (Preference change events are not generated by the Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() method, which generates a node change event. Preference change events are generated by the clear method.)

Events are only guaranteed for changes made within the same JVM as the registered listener, though some implementations may generate events for changes made outside this JVM. Events may be generated before the changes have been made persistent. Events are not generated when preferences are modified in descendants of this node; a caller desiring such events must register with each descendant.

Specified by:
addPreferenceChangeListener sample code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
pcl - The preference change listener to add.
See Also:
Preferences.removePreferenceChangeListener(PreferenceChangeListener) sample code for java.util.prefs.Preferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) , Preferences.addNodeChangeListener(NodeChangeListener) sample code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener)

removePreferenceChangeListener sample code for java.util.prefs.AbstractPreferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.AbstractPreferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener)

public void removePreferenceChangeListener(PreferenceChangeListener sample code for java.util.prefs.PreferenceChangeListener definition code for java.util.prefs.PreferenceChangeListener  pcl)
Description copied from class: Preferences sample code for java.util.prefs.Preferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener)
Removes the specified preference change listener, so it no longer receives preference change events.

Specified by:
removePreferenceChangeListener sample code for java.util.prefs.Preferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
pcl - The preference change listener to remove.
See Also:
Preferences.addPreferenceChangeListener(PreferenceChangeListener) sample code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener)

addNodeChangeListener sample code for java.util.prefs.AbstractPreferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.AbstractPreferences.addNodeChangeListener(java.util.prefs.NodeChangeListener)

public void addNodeChangeListener(NodeChangeListener sample code for java.util.prefs.NodeChangeListener definition code for java.util.prefs.NodeChangeListener  ncl)
Description copied from class: Preferences sample code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener)
Registers the specified listener to receive node change events for this node. A node change event is generated when a child node is added to or removed from this node. (A single Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() invocation results in multiple node change events, one for every node in the subtree rooted at the removed node.)

Events are only guaranteed for changes made within the same JVM as the registered listener, though some implementations may generate events for changes made outside this JVM. Events may be generated before the changes have become permanent. Events are not generated when indirect descendants of this node are added or removed; a caller desiring such events must register with each descendant.

Few guarantees can be made regarding node creation. Because nodes are created implicitly upon access, it may not be feasible for an implementation to determine whether a child node existed in the backing store prior to access (for example, because the backing store is unreachable or cached information is out of date). Under these circumstances, implementations are neither required to generate node change events nor prohibited from doing so.

Specified by:
addNodeChangeListener sample code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
ncl - The NodeChangeListener to add.
See Also:
Preferences.removeNodeChangeListener(NodeChangeListener) sample code for java.util.prefs.Preferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) , Preferences.addPreferenceChangeListener(PreferenceChangeListener) sample code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener) definition code for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener)

removeNodeChangeListener sample code for java.util.prefs.AbstractPreferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.AbstractPreferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener)

public void removeNodeChangeListener(NodeChangeListener sample code for java.util.prefs.NodeChangeListener definition code for java.util.prefs.NodeChangeListener  ncl)
Description copied from class: Preferences sample code for java.util.prefs.Preferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener)
Removes the specified NodeChangeListener, so it no longer receives change events.

Specified by:
removeNodeChangeListener sample code for java.util.prefs.Preferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
ncl - The NodeChangeListener to remove.
See Also:
Preferences.addNodeChangeListener(NodeChangeListener) sample code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener) definition code for java.util.prefs.Preferences.addNodeChangeListener(java.util.prefs.NodeChangeListener)

putSpi sample code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String) definition code for java.util.prefs.AbstractPreferences.putSpi(java.lang.String, java.lang.String)

protected abstract void putSpi(String sample code for java.lang.String definition code for java.lang.String  key,
                               String sample code for java.lang.String definition code for java.lang.String  value)
Put the given key-value association into this preference node. It is guaranteed that key and value are non-null and of legal length. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for any of these things.)

This method is invoked with the lock on this node held.


getSpi sample code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getSpi(java.lang.String)

protected abstract String sample code for java.lang.String definition code for java.lang.String  getSpi(String sample code for java.lang.String definition code for java.lang.String  key)
Return the value associated with the specified key at this preference node, or null if there is no association for this key, or the association cannot be determined at this time. It is guaranteed that key is non-null. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for either of these things.)

Generally speaking, this method should not throw an exception under any circumstances. If, however, if it does throw an exception, the exception will be intercepted and treated as a null return value.

This method is invoked with the lock on this node held.

Returns:
the value associated with the specified key at this preference node, or null if there is no association for this key, or the association cannot be determined at this time.

removeSpi sample code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.removeSpi(java.lang.String)

protected abstract void removeSpi(String sample code for java.lang.String definition code for java.lang.String  key)
Remove the association (if any) for the specified key at this preference node. It is guaranteed that key is non-null. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for either of these things.)

This method is invoked with the lock on this node held.


removeNodeSpi sample code for java.util.prefs.AbstractPreferences.removeNodeSpi() definition code for java.util.prefs.AbstractPreferences.removeNodeSpi()

protected abstract void removeNodeSpi()
                               throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Removes this preference node, invalidating it and any preferences that it contains. The named child will have no descendants at the time this invocation is made (i.e., the Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() method invokes this method repeatedly in a bottom-up fashion, removing each of a node's descendants before removing the node itself).

This method is invoked with the lock held on this node and its parent (and all ancestors that are being removed as a result of a single invocation to Preferences.removeNode() sample code for java.util.prefs.Preferences.removeNode() definition code for java.util.prefs.Preferences.removeNode() ).

The removal of a node needn't become persistent until the flush method is invoked on this node (or an ancestor).

If this node throws a BackingStoreException, the exception will propagate out beyond the enclosing removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() invocation.

Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.

keysSpi sample code for java.util.prefs.AbstractPreferences.keysSpi() definition code for java.util.prefs.AbstractPreferences.keysSpi()

protected abstract String sample code for java.lang.String definition code for java.lang.String [] keysSpi()
                             throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Returns all of the keys that have an associated value in this preference node. (The returned array will be of size zero if this node has no preferences.) It is guaranteed that this node has not been removed.

This method is invoked with the lock on this node held.

If this node throws a BackingStoreException, the exception will propagate out beyond the enclosing keys() sample code for java.util.prefs.AbstractPreferences.keys() definition code for java.util.prefs.AbstractPreferences.keys() invocation.

Returns:
an array of the keys that have an associated value in this preference node.
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.

childrenNamesSpi sample code for java.util.prefs.AbstractPreferences.childrenNamesSpi() definition code for java.util.prefs.AbstractPreferences.childrenNamesSpi()

protected abstract String sample code for java.lang.String definition code for java.lang.String [] childrenNamesSpi()
                                      throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Returns the names of the children of this preference node. (The returned array will be of size zero if this node has no children.) This method need not return the names of any nodes already cached, but may do so without harm.

This method is invoked with the lock on this node held.

If this node throws a BackingStoreException, the exception will propagate out beyond the enclosing childrenNames() sample code for java.util.prefs.AbstractPreferences.childrenNames() definition code for java.util.prefs.AbstractPreferences.childrenNames() invocation.

Returns:
an array containing the names of the children of this preference node.
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.

getChild sample code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getChild(java.lang.String)

protected AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences  getChild(String sample code for java.lang.String definition code for java.lang.String  nodeName)
                                throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Returns the named child if it exists, or null if it does not. It is guaranteed that nodeName is non-null, non-empty, does not contain the slash character ('/'), and is no longer than Preferences.MAX_NAME_LENGTH sample code for java.util.prefs.Preferences.MAX_NAME_LENGTH definition code for java.util.prefs.Preferences.MAX_NAME_LENGTH characters. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for any of these things if he chooses to override this method.)

Finally, it is guaranteed that the named node has not been returned by a previous invocation of this method or childSpi(java.lang.String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) after the last time that it was removed. In other words, a cached value will always be used in preference to invoking this method. (The implementor needn't maintain his own cache of previously returned children if he chooses to override this method.)

This implementation obtains this preference node's lock, invokes childrenNames() sample code for java.util.prefs.AbstractPreferences.childrenNames() definition code for java.util.prefs.AbstractPreferences.childrenNames() to get an array of the names of this node's children, and iterates over the array comparing the name of each child with the specified node name. If a child node has the correct name, the childSpi(String) sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) method is invoked and the resulting node is returned. If the iteration completes without finding the specified name, null is returned.

Parameters:
nodeName - name of the child to be searched for.
Returns:
the named child if it exists, or null if it does not.
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.

childSpi sample code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String) definition code for java.util.prefs.AbstractPreferences.childSpi(java.lang.String)

protected abstract AbstractPreferences sample code for java.util.prefs.AbstractPreferences definition code for java.util.prefs.AbstractPreferences  childSpi(String sample code for java.lang.String definition code for java.lang.String  name)
Returns the named child of this preference node, creating it if it does not already exist. It is guaranteed that name is non-null, non-empty, does not contain the slash character ('/'), and is no longer than Preferences.MAX_NAME_LENGTH sample code for java.util.prefs.Preferences.MAX_NAME_LENGTH definition code for java.util.prefs.Preferences.MAX_NAME_LENGTH characters. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for any of these things.)

Finally, it is guaranteed that the named node has not been returned by a previous invocation of this method or getChild(String) sample code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) definition code for java.util.prefs.AbstractPreferences.getChild(java.lang.String) after the last time that it was removed. In other words, a cached value will always be used in preference to invoking this method. Subclasses need not maintain their own cache of previously returned children.

The implementer must ensure that the returned node has not been removed. If a like-named child of this node was previously removed, the implementer must return a newly constructed AbstractPreferences node; once removed, an AbstractPreferences node cannot be "resuscitated."

If this method causes a node to be created, this node is not guaranteed to be persistent until the flush method is invoked on this node or one of its ancestors (or descendants).

This method is invoked with the lock on this node held.

Parameters:
name - The name of the child node to return, relative to this preference node.
Returns:
The named child node.

toString sample code for java.util.prefs.AbstractPreferences.toString() definition code for java.util.prefs.AbstractPreferences.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns the absolute path name of this preferences node.

Specified by:
toString sample code for java.util.prefs.Preferences.toString() definition code for java.util.prefs.Preferences.toString() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Returns:
a string representation of the object.

sync sample code for java.util.prefs.AbstractPreferences.sync() definition code for java.util.prefs.AbstractPreferences.sync()

public void sync()
          throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the sync method as per the specification in Preferences.sync() sample code for java.util.prefs.Preferences.sync() definition code for java.util.prefs.Preferences.sync() .

This implementation calls a recursive helper method that locks this node, invokes syncSpi() on it, unlocks this node, and recursively invokes this method on each "cached child." A cached child is a child of this node that has been created in this VM and not subsequently removed. In effect, this method does a depth first traversal of the "cached subtree" rooted at this node, calling syncSpi() on each node in the subTree while only that node is locked. Note that syncSpi() is invoked top-down.

Specified by:
sync sample code for java.util.prefs.Preferences.sync() definition code for java.util.prefs.Preferences.sync() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.
See Also:
flush() sample code for java.util.prefs.AbstractPreferences.flush() definition code for java.util.prefs.AbstractPreferences.flush()

syncSpi sample code for java.util.prefs.AbstractPreferences.syncSpi() definition code for java.util.prefs.AbstractPreferences.syncSpi()

protected abstract void syncSpi()
                         throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
This method is invoked with this node locked. The contract of this method is to synchronize any cached preferences stored at this node with any stored in the backing store. (It is perfectly possible that this node does not exist on the backing store, either because it has been deleted by another VM, or because it has not yet been created.) Note that this method should not synchronize the preferences in any subnodes of this node. If the backing store naturally syncs an entire subtree at once, the implementer is encouraged to override sync(), rather than merely overriding this method.

If this node throws a BackingStoreException, the exception will propagate out beyond the enclosing sync() sample code for java.util.prefs.AbstractPreferences.sync() definition code for java.util.prefs.AbstractPreferences.sync() invocation.

Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.

flush sample code for java.util.prefs.AbstractPreferences.flush() definition code for java.util.prefs.AbstractPreferences.flush()

public void flush()
           throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the flush method as per the specification in Preferences.flush() sample code for java.util.prefs.Preferences.flush() definition code for java.util.prefs.Preferences.flush() .

This implementation calls a recursive helper method that locks this node, invokes flushSpi() on it, unlocks this node, and recursively invokes this method on each "cached child." A cached child is a child of this node that has been created in this VM and not subsequently removed. In effect, this method does a depth first traversal of the "cached subtree" rooted at this node, calling flushSpi() on each node in the subTree while only that node is locked. Note that flushSpi() is invoked top-down.

If this method is invoked on a node that has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method, flushSpi() is invoked on this node, but not on others.

Specified by:
flush sample code for java.util.prefs.Preferences.flush() definition code for java.util.prefs.Preferences.flush() in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
See Also:
flush() sample code for java.util.prefs.AbstractPreferences.flush() definition code for java.util.prefs.AbstractPreferences.flush()

flushSpi sample code for java.util.prefs.AbstractPreferences.flushSpi() definition code for java.util.prefs.AbstractPreferences.flushSpi()

protected abstract void flushSpi()
                          throws BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
This method is invoked with this node locked. The contract of this method is to force any cached changes in the contents of this preference node to the backing store, guaranteeing their persistence. (It is perfectly possible that this node does not exist on the backing store, either because it has been deleted by another VM, or because it has not yet been created.) Note that this method should not flush the preferences in any subnodes of this node. If the backing store naturally flushes an entire subtree at once, the implementer is encouraged to override flush(), rather than merely overriding this method.

If this node throws a BackingStoreException, the exception will propagate out beyond the enclosing flush() sample code for java.util.prefs.AbstractPreferences.flush() definition code for java.util.prefs.AbstractPreferences.flush() invocation.

Throws:
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.

isRemoved sample code for java.util.prefs.AbstractPreferences.isRemoved() definition code for java.util.prefs.AbstractPreferences.isRemoved()

protected boolean isRemoved()
Returns true iff this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method. This method locks this node prior to returning the contents of the private field used to track this state.

Returns:
true iff this node (or an ancestor) has been removed with the removeNode() sample code for java.util.prefs.AbstractPreferences.removeNode() definition code for java.util.prefs.AbstractPreferences.removeNode() method.

exportNode sample code for java.util.prefs.AbstractPreferences.exportNode(java.io.OutputStream) definition code for java.util.prefs.AbstractPreferences.exportNode(java.io.OutputStream)

public void exportNode(OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  os)
                throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                       BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the exportNode method as per the specification in Preferences.exportNode(OutputStream) sample code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) .

Specified by:
exportNode sample code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
os - the output stream on which to emit the XML document.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if writing to the specified output stream results in an IOException.
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if preference data cannot be read from backing store.
See Also:
Preferences.importPreferences(InputStream) sample code for java.util.prefs.Preferences.importPreferences(java.io.InputStream) definition code for java.util.prefs.Preferences.importPreferences(java.io.InputStream)

exportSubtree sample code for java.util.prefs.AbstractPreferences.exportSubtree(java.io.OutputStream) definition code for java.util.prefs.AbstractPreferences.exportSubtree(java.io.OutputStream)

public void exportSubtree(OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  os)
                   throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                          BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException 
Implements the exportSubtree method as per the specification in Preferences.exportSubtree(OutputStream) sample code for java.util.prefs.Preferences.exportSubtree(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportSubtree(java.io.OutputStream) .

Specified by:
exportSubtree sample code for java.util.prefs.Preferences.exportSubtree(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportSubtree(java.io.OutputStream) in class Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences
Parameters:
os - the output stream on which to emit the XML document.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if writing to the specified output stream results in an IOException.
BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException - if preference data cannot be read from backing store.
See Also:
Preferences.importPreferences(InputStream) sample code for java.util.prefs.Preferences.importPreferences(java.io.InputStream) definition code for java.util.prefs.Preferences.importPreferences(java.io.InputStream) , Preferences.exportNode(OutputStream) sample code for java.util.prefs.Preferences.exportNode(java.io.OutputStream) definition code for java.util.prefs.Preferences.exportNode(java.io.OutputStream)