Build 1.0_r1(from source)

java.util.prefs
Class PreferenceChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.util.prefs.PreferenceChangeEvent
All Implemented Interfaces:
Serializable

public class PreferenceChangeEvent
extends EventObject
implements Serializable

This is the event class to indicate some preferences has been added, deleted or updated.

Please note that this class cannot be serialized actually, so relevant serialization methods only throw NotSerializableException.

Since:
1.4
See Also:
Preferences, PreferenceChangeListener, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PreferenceChangeEvent(Preferences p, String k, String v)
          Construct a new PreferenceChangeEvent instance.
 
Method Summary
 String getKey()
          Get the changed preference's key.
 String getNewValue()
          Get the new value of the changed preference, or null if this preference is removed.
 Preferences getNode()
          Get the Preferences instance that this event happened.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PreferenceChangeEvent

public PreferenceChangeEvent(Preferences p,
                             String k,
                             String v)
Construct a new PreferenceChangeEvent instance.

Parameters:
p - the Preferences instance that this event happened, this object is considered as event's source.
k - the changed preference's key
v - the new value of the changed preference, this value can be null, which means the preference is removed.
Method Detail

getKey

public String getKey()
Get the changed preference's key.

Returns:
the changed preference's key

getNewValue

public String getNewValue()
Get the new value of the changed preference, or null if this preference is removed.

Returns:
the new value of the changed preference, or null if this preference is removed.

getNode

public Preferences getNode()
Get the Preferences instance that this event happened.

Returns:
the Preferences instance that this event happened.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature