AbstractPreferences | java.util.prefs | This class implements all the abstract methods of Preferences on top of a smaller set of abstract methods. Programmers creating a Preferences implementation (or "service provider") can subclass this class and need define only the nine methods whose names end in "Spi". Application programmers never need to use this class. Figure 16-124. java.util.prefs.AbstractPreferences public abstract class AbstractPreferences extends Preferences { // Protected Constructors protected AbstractPreferences (AbstractPreferences parent , String name ); // Event Registration Methods (by event name) public void addNodeChangeListener (NodeChangeListener ncl ); Overrides:Preferences public void removeNodeChangeListener (NodeChangeListener ncl ); Overrides:Preferences public void addPreferenceChangeListener (PreferenceChangeListener pcl ); Overrides:Preferences public void removePreferenceChangeListener (PreferenceChangeListener pcl ); Overrides:Preferences // Public Methods Overriding Preferences public String absolutePath ( ); public String[ ] childrenNames ( ) throws BackingStoreException; public void clear ( ) throws BackingStoreException; public void exportNode (java.io.OutputStream os ) throws java.io.IOException, BackingStoreException; public void exportSubtree (java.io.OutputStream os ) throws java.io.IOException, BackingStoreException; public void flush ( ) throws BackingStoreException; public String get (String key , String def ); public boolean getBoolean (String key , boolean def ); public byte[ ] getByteArray (String key , byte[ ] def ); public double getDouble (String key , double def ); public float getFloat (String key , float def ); public int getInt (String key , int def ); public long getLong (String key , long def ); public boolean isUserNode ( ); public String[ ] keys ( ) throws BackingStoreException; public String name ( ); public Preferences node (String path ); public boolean nodeExists (String path ) throws BackingStoreException; public Preferences parent ( ); public void put (String key , String value ); public void putBoolean (String key , boolean value ); public void putByteArray (String key , byte[ ] value ); public void putDouble (String key , double value ); public void putFloat (String key , float value ); public void putInt (String key , int value ); public void putLong (String key , long value ); public void remove (String key ); public void removeNode ( ) throws BackingStoreException; public void sync ( ) throws BackingStoreException; public String toString ( ); // Protected Instance Methods protected final AbstractPreferences[ ] cachedChildren ( ); protected abstract String[ ] childrenNamesSpi ( ) throws BackingStoreException; protected abstract AbstractPreferences childSpi (String name ); protected abstract void flushSpi ( ) throws BackingStoreException; protected AbstractPreferences getChild (String nodeName ) throws BackingStoreException; protected abstract String getSpi (String key ); protected boolean isRemoved ( ); protected abstract String[ ] keysSpi ( ) throws BackingStoreException; protected abstract void putSpi (String key , String value ); protected abstract void removeNodeSpi ( ) throws BackingStoreException; protected abstract void removeSpi (String key ); protected abstract void syncSpi ( ) throws BackingStoreException; // Protected Instance Fields protected final Object lock ; protected boolean newNode ; } |