Class AbstractPreferences
- All Implemented Interfaces:
IPropertyChangeProvider,IPreferences
- Direct Known Subclasses:
Preferences
public abstract class AbstractPreferences extends java.lang.Object implements IPreferences, IPropertyChangeProvider
- Author:
- ralph
-
Field Summary
Fields inherited from interface rs.baselib.prefs.IPreferences
CHILD_ADDED, CHILD_REMOVED, VALUES_CLEARED -
Constructor Summary
Constructors Constructor Description AbstractPreferences()Constructor.AbstractPreferences(AbstractPreferences parent, java.lang.String name)Constructor. -
Method Summary
Modifier and Type Method Description java.lang.StringabsolutePath()Returns this node's absolute path name.protected voidaddNode(AbstractPreferences child)Adds the given node.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Add a change listener.voidaddPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Add a change listener.java.lang.String[]childrenNames()Returns the names of the children of this node.voidclear()Removes all of the properties (key-value associations) in this node.protected abstract AbstractPreferencescreateNode(AbstractPreferences parent, java.lang.String name)Subclasses must implement this to return a new child node.protected abstract java.util.concurrent.locks.LockcreateReadLock()Creates the appropriate read lock object.protected abstract java.util.concurrent.locks.LockcreateWriteLock()Creates the appropriate write lock object.protected booleanfirePropertyChange(java.beans.PropertyChangeEvent event)Fires a change event.protected booleanfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Fires an event if property changed.voidflush()Forces any changes in the contents of this node and its descendants to the persistent store.java.lang.Stringget(java.lang.String key, java.lang.String def)Returns the value associated with the specifiedkeyin this node.booleangetBoolean(java.lang.String key, boolean def)Returns thebooleanvalue represented by theStringobject associated with the specifiedkeyin this node.byte[]getByteArray(java.lang.String key, byte[] def)Returns thebyte[]value represented by theStringobject associated with the specifiedkeyin this node.doublegetDouble(java.lang.String key, double def)Returns thedoublevalue represented by theStringobject associated with the specifiedkeyin this node.floatgetFloat(java.lang.String key, float def)Returns the floatvaluerepresented by theStringobject associated with the specifiedkeyin this node.intgetInt(java.lang.String key, int def)Returns theintvalue represented by theStringobject associated with the specifiedkeyin this node.longgetLong(java.lang.String key, long def)Returns thelongvalue represented by theStringobject associated with the specifiedkeyin this node.protected abstract AbstractPreferencesServicegetPreferencesService()Returns the preferences service.java.util.concurrent.locks.LockgetReadLock()Returns the readLock.protected AbstractPreferencesgetRootNode()Returns the root node of this node.java.util.concurrent.locks.LockgetWriteLock()Returns the writeLock.protected booleanisAbsolute(java.lang.String pathName)Returns true when the given pathname is absolute to root node of this node.protected booleanisRelative(java.lang.String pathName)Returns true when the given pathname is relative to this node.protected booleanisRootNode()Returns true when this is a root node.java.lang.String[]keys()Returns all of the keys that have an associated value in this node.java.lang.Stringname()Returns this node's name, relative to its parent.IPreferencesnode(java.lang.String pathName)Returns a namedPreferencesobject (node), creating it and any of its ancestors if they do not already exist.booleannodeExists(java.lang.String pathName)Returns true if the named node exists.IPreferencesparent()Returns the parent of this node, ornullif this is the root.voidput(java.lang.String key, java.lang.String value)Associates the specified value with the specified key in this node.voidputBoolean(java.lang.String key, boolean value)Associates aStringobject representing the specifiedbooleanvalue with the specified key in this node.voidputByteArray(java.lang.String key, byte[] value)Associates aStringobject representing the specifiedbyte[]with the specifiedkeyin this node.voidputDouble(java.lang.String key, double value)Associates aStringobject representing the specifieddoublevalue with the specifiedkeyin this node.voidputFloat(java.lang.String key, float value)Associates aStringobject representing the specifiedfloatvalue with the specifiedkeyin this node.voidputInt(java.lang.String key, int value)Associates aStringobject representing the specifiedintvalue with the specifiedkeyin this node.voidputLong(java.lang.String key, long value)Associates aStringobject representing the specifiedlongvalue with the specifiedkeyin this node.protected voidreadLock()Aquires a read lock.protected voidreadUnlock()Releases a read lock.voidremove(java.lang.String key)Removes the value associated with the specifiedkeyin this node, if any.voidremoveNode()Removes this node and all of its descendants, invalidating any properties contained in the removed nodes.protected voidremoveNode(AbstractPreferences child)Removes the given node.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Remove a change listener.voidremovePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Remove a change listener.voidsync()Ensures that future reads from this node and its descendants reflect any changes that were committed to the persistent store (from any VM) prior to thesyncinvocation.protected voidwriteLock()Aquires a write lock.protected voidwriteUnlock()Releases a write lock.
-
Constructor Details
-
AbstractPreferences
public AbstractPreferences()Constructor. Creates a root node. -
AbstractPreferences
Constructor.- Parameters:
parent- the parent of this nodename- the name of this preferences
-
-
Method Details
-
createReadLock
protected abstract java.util.concurrent.locks.Lock createReadLock()Creates the appropriate read lock object.- Returns:
- the read lock object
-
createWriteLock
protected abstract java.util.concurrent.locks.Lock createWriteLock()Creates the appropriate write lock object.- Returns:
- the write lock object
-
getReadLock
public java.util.concurrent.locks.Lock getReadLock()Returns the readLock.- Returns:
- the readLock
-
readLock
protected void readLock()Aquires a read lock. -
readUnlock
protected void readUnlock()Releases a read lock. -
getWriteLock
public java.util.concurrent.locks.Lock getWriteLock()Returns the writeLock.- Returns:
- the writeLock
-
writeLock
protected void writeLock()Aquires a write lock. -
writeUnlock
protected void writeUnlock()Releases a write lock. -
createNode
protected abstract AbstractPreferences createNode(AbstractPreferences parent, java.lang.String name)Subclasses must implement this to return a new child node.- Parameters:
parent- the parent to be usedname- the name to be used- Returns:
- the new node
-
addNode
Adds the given node. The scheduling policy will define whether this task is executed immediately or performed by a background task (which requires aflush()call to access the node later).- Parameters:
child- child to be added
-
removeNode
Removes the given node. The scheduling policy will define whether this task is executed immediately or performed by a background task (which requires aflush()to see the result).- Parameters:
child- child to be removed
-
put
public void put(java.lang.String key, java.lang.String value)Associates the specified value with the specified key in this node.- Specified by:
putin interfaceIPreferences- Parameters:
key- key with which the specified value is to be associated.value- value to be associated with the specified key.
-
get
public java.lang.String get(java.lang.String key, java.lang.String def)Returns the value associated with the specifiedkeyin this node. Returns the specified default if there is no value associated with thekey, or the backing store is inaccessible.- Specified by:
getin interfaceIPreferences- Parameters:
key- key whose associated value is to be returned.def- the value to be returned in the event that this node has no value associated withkeyor the backing store is inaccessible.- Returns:
- the value associated with
key, ordefif no value is associated withkey.
-
remove
public void remove(java.lang.String key)Removes the value associated with the specifiedkeyin this node, if any.- Specified by:
removein interfaceIPreferences- Parameters:
key- key whose mapping is to be removed from this node.- See Also:
IPreferences.get(String,String)
-
clear
public void clear() throws java.util.prefs.BackingStoreExceptionRemoves all of the properties (key-value associations) in this node. This call has no effect on any descendants of this node.- Specified by:
clearin interfaceIPreferences- Throws:
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:
IPreferences.remove(String)
-
putInt
public void putInt(java.lang.String key, int value)Associates aStringobject representing the specifiedintvalue with the specifiedkeyin this node. The associated string is the one that would be returned if theintvalue were passed toInteger.toString(int). This method is intended for use in conjunction withIPreferences.getInt(java.lang.String, int)method.Implementor's note: it is not necessary that the property value be represented by a
Stringobject in the backing store. If the backing store supports integer values, it is not unreasonable to use them. This implementation detail is not visible through thePreferencesAPI, which allows the value to be read as anint(withgetIntor aString(withget) type.- Specified by:
putIntin interfaceIPreferences- Parameters:
key- key with which the string form of value is to be associated.value-valuewhose string form is to be associated withkey.- See Also:
IPreferences.getInt(String,int)
-
getInt
public int getInt(java.lang.String key, int def)Returns theintvalue represented by theStringobject associated with the specifiedkeyin this node. TheStringobject is converted to anintas byInteger.parseInt(String). Returns the specified default if there is no value associated with thekey, the backing store is inaccessible, or ifInteger.parseInt(String)would throw aNumberFormatExceptionif the associatedvaluewere passed. This method is intended for use in conjunction with theIPreferences.putInt(java.lang.String, int)method.- Specified by:
getIntin interfaceIPreferences- Parameters:
key- key whose associated value is to be returned as anint.def- the value to be returned in the event that this node has no value associated withkeyor the associated value cannot be interpreted as anintor the backing store is inaccessible.- Returns:
- the
intvalue represented by theStringobject associated withkeyin this node, ordefif the associated value does not exist or cannot be interpreted as aninttype. - See Also:
IPreferences.putInt(String,int),IPreferences.get(String,String)
-
putLong
public void putLong(java.lang.String key, long value)Associates aStringobject representing the specifiedlongvalue with the specifiedkeyin this node. The associatedStringobject is the one that would be returned if thelongvalue were passed toLong.toString(long). This method is intended for use in conjunction with theIPreferences.getLong(java.lang.String, long)method.Implementor's note: it is not necessary that the
valuebe represented by aStringtype in the backing store. If the backing store supportslongvalues, it is not unreasonable to use them. This implementation detail is not visible through thePreferencesAPI, which allows the value to be read as along(withgetLongor aString(withget) type.- Specified by:
putLongin interfaceIPreferences- Parameters:
key-keywith which the string form ofvalueis to be associated.value-valuewhose string form is to be associated withkey.- See Also:
IPreferences.getLong(String,long)
-
getLong
public long getLong(java.lang.String key, long def)Returns thelongvalue represented by theStringobject associated with the specifiedkeyin this node. TheStringobject is converted to alongas byLong.parseLong(String). Returns the specified default if there is no value associated with thekey, the backing store is inaccessible, or ifLong.parseLong(String)would throw aNumberFormatExceptionif the associatedvaluewere passed. This method is intended for use in conjunction with theIPreferences.putLong(java.lang.String, long)method.- Specified by:
getLongin interfaceIPreferences- Parameters:
key-keywhose associated value is to be returned as alongvalue.def- the value to be returned in the event that this node has no value associated withkeyor the associated value cannot be interpreted as alongtype or the backing store is inaccessible.- Returns:
- the
longvalue represented by theStringobject associated withkeyin this node, ordefif the associated value does not exist or cannot be interpreted as alongtype. - See Also:
IPreferences.putLong(String,long),IPreferences.get(String,String)
-
putBoolean
public void putBoolean(java.lang.String key, boolean value)Associates aStringobject representing the specifiedbooleanvalue with the specified key in this node. The associated string is "true" if the value istrue, and "false" if it isfalse. This method is intended for use in conjunction with theIPreferences.getBoolean(java.lang.String, boolean)method.Implementor's note: it is not necessary that the value be represented by a string in the backing store. If the backing store supports
booleanvalues, it is not unreasonable to use them. This implementation detail is not visible through thePreferencesAPI, which allows the value to be read as aboolean(withgetBoolean) or aString(withget) type.- Specified by:
putBooleanin interfaceIPreferences- Parameters:
key-keywith which the string form of value is to be associated.value- value whose string form is to be associated withkey.- See Also:
IPreferences.getBoolean(String,boolean),IPreferences.get(String,String)
-
getBoolean
public boolean getBoolean(java.lang.String key, boolean def)Returns thebooleanvalue represented by theStringobject associated with the specifiedkeyin this node. Valid strings are "true", which representstrue, and "false", which representsfalse. Case is ignored, so, for example, "TRUE" and "False" are also valid. This method is intended for use in conjunction with theIPreferences.putBoolean(java.lang.String, boolean)method.Returns the specified default if there is no value associated with the
key, the backing store is inaccessible, or if the associated value is something other than "true" or "false", ignoring case.- Specified by:
getBooleanin interfaceIPreferences- Parameters:
key-keywhose associated value is to be returned as aboolean.def- the value to be returned in the event that this node has no value associated withkeyor the associated value cannot be interpreted as abooleanor the backing store is inaccessible.- Returns:
- the
booleanvalue represented by theStringobject associated withkeyin this node, ornullif the associated value does not exist or cannot be interpreted as aboolean. - See Also:
IPreferences.get(String,String),IPreferences.putBoolean(String,boolean)
-
putFloat
public void putFloat(java.lang.String key, float value)Associates aStringobject representing the specifiedfloatvalue with the specifiedkeyin this node. The associatedStringobject is the one that would be returned if thefloatvalue were passed toFloat.toString(float). This method is intended for use in conjunction with theIPreferences.getFloat(java.lang.String, float)method.Implementor's note: it is not necessary that the value be represented by a string in the backing store. If the backing store supports
floatvalues, it is not unreasonable to use them. This implementation detail is not visible through thePreferencesAPI, which allows the value to be read as afloat(withgetFloat) or aString(withget) type.- Specified by:
putFloatin interfaceIPreferences- Parameters:
key-keywith which the string form of value is to be associated.value- value whose string form is to be associated withkey.- See Also:
IPreferences.getFloat(String,float)
-
getFloat
public float getFloat(java.lang.String key, float def)Returns the floatvaluerepresented by theStringobject associated with the specifiedkeyin this node. TheStringobject is converted to afloatvalue as byFloat.parseFloat(String). Returns the specified default if there is no value associated with thekey, the backing store is inaccessible, or ifFloat.parseFloat(String)would throw aNumberFormatExceptionif the associated value were passed. This method is intended for use in conjunction with theIPreferences.putFloat(java.lang.String, float)method.- Specified by:
getFloatin interfaceIPreferences- Parameters:
key-keywhose associated value is to be returned as afloatvalue.def- the value to be returned in the event that this node has no value associated withkeyor the associated value cannot be interpreted as afloattype or the backing store is inaccessible.- Returns:
- the
floatvalue represented by the string associated withkeyin this node, ordefif the associated value does not exist or cannot be interpreted as afloattype. - See Also:
IPreferences.putFloat(String,float),IPreferences.get(String,String)
-
putDouble
public void putDouble(java.lang.String key, double value)Associates aStringobject representing the specifieddoublevalue with the specifiedkeyin this node. The associatedStringobject is the one that would be returned if thedoublevalue were passed toDouble.toString(double). This method is intended for use in conjunction with theIPreferences.getDouble(java.lang.String, double)methodImplementor's note: it is not necessary that the value be represented by a string in the backing store. If the backing store supports
doublevalues, it is not unreasonable to use them. This implementation detail is not visible through thePreferencesAPI, which allows the value to be read as adouble(withgetDouble) or aString(withget) type.- Specified by:
putDoublein interfaceIPreferences- Parameters:
key-keywith which the string form of value is to be associated.value- value whose string form is to be associated withkey.- See Also:
IPreferences.getDouble(String,double)
-
getDouble
public double getDouble(java.lang.String key, double def)Returns thedoublevalue represented by theStringobject associated with the specifiedkeyin this node. TheStringobject is converted to adoublevalue as byDouble.parseDouble(String). Returns the specified default if there is no value associated with thekey, the backing store is inaccessible, or ifDouble.parseDouble(String)would throw aNumberFormatExceptionif the associated value were passed. This method is intended for use in conjunction with theIPreferences.putDouble(java.lang.String, double)method.- Specified by:
getDoublein interfaceIPreferences- Parameters:
key-keywhose associated value is to be returned as adoublevalue.def- the value to be returned in the event that this node has no value associated withkeyor the associated value cannot be interpreted as adoubletype or the backing store is inaccessible.- Returns:
- the
doublevalue represented by theStringobject associated withkeyin this node, ordefif the associated value does not exist or cannot be interpreted as adoubletype. - See Also:
IPreferences.putDouble(String,double),IPreferences.get(String,String)
-
putByteArray
public void putByteArray(java.lang.String key, byte[] value)Associates aStringobject representing the specifiedbyte[]with the specifiedkeyin this node. The associatedStringobject the Base64 encoding of thebyte[], as defined in RFC 2045 , Section 6.8, with one minor change: the string will consist solely of characters from the Base64 Alphabet ; it will not contain any newline characters. This method is intended for use in conjunction with theIPreferences.getByteArray(java.lang.String, byte[])method.Implementor's note: it is not necessary that the value be represented by a
Stringtype in the backing store. If the backing store supportsbyte[]values, it is not unreasonable to use them. This implementation detail is not visible through thePreferencesAPI, which allows the value to be read as an abyte[]object (withgetByteArray) or aStringobject (withget).- Specified by:
putByteArrayin interfaceIPreferences- Parameters:
key-keywith which the string form ofvalueis to be associated.value-valuewhose string form is to be associated withkey.- See Also:
IPreferences.getByteArray(String,byte[]),IPreferences.get(String,String)
-
getByteArray
public byte[] getByteArray(java.lang.String key, byte[] def)Returns thebyte[]value represented by theStringobject associated with the specifiedkeyin this node. ValidStringobjects are Base64 encoded binary data, as defined in RFC 2045 , Section 6.8, with one minor change: the string must consist solely of characters from the Base64 Alphabet ; no newline characters or extraneous characters are permitted. This method is intended for use in conjunction with theIPreferences.putByteArray(java.lang.String, byte[])method.Returns the specified default if there is no value associated with the
key, the backing store is inaccessible, or if the associated value is not a valid Base64 encoded byte array (as defined above).- Specified by:
getByteArrayin interfaceIPreferences- Parameters:
key-keywhose associated value is to be returned as abyte[]object.def- the value to be returned in the event that this node has no value associated withkeyor the associated value cannot be interpreted as abyte[]type, or the backing store is inaccessible.- Returns:
- the
byte[]value represented by theStringobject associated withkeyin this node, ordefif the associated value does not exist or cannot be interpreted as abyte[]. - See Also:
IPreferences.get(String,String),IPreferences.putByteArray(String,byte[])
-
keys
public java.lang.String[] keys() throws java.util.prefs.BackingStoreExceptionReturns all of the keys that have an associated value in this node. (The returned array will be of size zero if this node has no preferences and notnull!)- Specified by:
keysin interfaceIPreferences- Returns:
- an array of the keys that have an associated value in this node.
- Throws:
java.util.prefs.BackingStoreException- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
childrenNames
public java.lang.String[] childrenNames() throws java.util.prefs.BackingStoreExceptionReturns the names of the children of this node. (The returned array will be of size zero if this node has no children and notnull!)- Specified by:
childrenNamesin interfaceIPreferences- Returns:
- the names of the children of this node.
- Throws:
java.util.prefs.BackingStoreException- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
parent
Returns the parent of this node, ornullif this is the root.- Specified by:
parentin interfaceIPreferences- Returns:
- the parent of this node.
-
isRelative
protected boolean isRelative(java.lang.String pathName)Returns true when the given pathname is relative to this node. This means the path does not start with a slash ('/').- Parameters:
pathName- name to be checked- Returns:
truewhen path name is relative to this node
-
isAbsolute
protected boolean isAbsolute(java.lang.String pathName)Returns true when the given pathname is absolute to root node of this node. This means the path starts with a slash ('/').- Parameters:
pathName- name to be checked- Returns:
truewhen path name is absolute to root node of this node
-
isRootNode
protected boolean isRootNode()Returns true when this is a root node.- Returns:
truewhen this is a root node
-
getRootNode
Returns the root node of this node.- Returns:
- root node
-
node
Returns a namedPreferencesobject (node), creating it and any of its ancestors if they do not already exist. Accepts a relative or absolute pathname. Absolute pathnames (which begin with'/') are interpreted relative to the root of this node. Relative pathnames (which begin with any character other than'/') are interpreted relative to this node itself. The empty string ("") is a valid relative pathname, referring to this node itself.If the returned node did not exist prior to this call, this node and any ancestors that were created by this call are not guaranteed to become persistent until the
flushmethod is called on the returned node (or one of its descendants).- Specified by:
nodein interfaceIPreferences- Parameters:
pathName- the path name of thePreferencesobject to return.- Returns:
- the specified
Preferencesobject. - See Also:
IPreferences.flush()
-
nodeExists
public boolean nodeExists(java.lang.String pathName) throws java.util.prefs.BackingStoreExceptionReturns true if the named node exists. Accepts a relative or absolute pathname. Absolute pathnames (which begin with'/') are interpreted relative to the root of this node. Relative pathnames (which begin with any character other than'/') are interpreted relative to this node itself. The pathname""is valid, and refers to this node itself.If this node (or an ancestor) has already been removed with the
IPreferences.removeNode()method, it is legal to invoke this method, but only with the pathname""; the invocation will returnfalse. Thus, the idiomp.nodeExists("")may be used to test whetherphas been removed.- Specified by:
nodeExistsin interfaceIPreferences- Parameters:
pathName- the path name of the node whose existence is to be checked.- Returns:
- true if the specified node exists.
- Throws:
java.util.prefs.BackingStoreException- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
removeNode
public void removeNode() throws java.util.prefs.BackingStoreExceptionRemoves this node and all of its descendants, invalidating any properties contained in the removed nodes. Once a node has been removed, attempting any method other thanname(),absolutePath()ornodeExists("")on the correspondingPreferencesinstance will fail with anIllegalStateException. (The methods defined onObjectcan still be invoked on a node after it has been removed; they will not throwIllegalStateException.)The removal is not guaranteed to be persistent until the
flushmethod is called on the parent of this node.- Specified by:
removeNodein interfaceIPreferences- Throws:
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:
IPreferences.flush()
-
name
public java.lang.String name()Returns this node's name, relative to its parent.- Specified by:
namein interfaceIPreferences- Returns:
- this node's name, relative to its parent.
-
absolutePath
public java.lang.String absolutePath()Returns this node's absolute path name. Note that:- Root node - The path name of the root node is
"/". - Slash at end - Path names other than that of the root node may not
end in slash (
'/'). - Unusual names -
"."and".."have no special significance in path names. - Illegal names - The only illegal path names are those that contain multiple consecutive slashes, or that end in slash and are not the root.
- Specified by:
absolutePathin interfaceIPreferences- Returns:
- this node's absolute path name.
- Root node - The path name of the root node is
-
getPreferencesService
Returns the preferences service.- Returns:
- the preferences service
-
flush
public void flush() throws java.util.prefs.BackingStoreExceptionForces any changes in the contents of this node and its descendants to the persistent store.Once this method returns successfully, it is safe to assume that all changes made in the subtree rooted at this node prior to the method invocation have become permanent.
Implementations are free to flush changes into the persistent store at any time. They do not need to wait for this method to be called.
When a flush occurs on a newly created node, it is made persistent, as are any ancestors (and descendants) that have yet to be made persistent. Note however that any properties value changes in ancestors are not guaranteed to be made persistent.
- Specified by:
flushin interfaceIPreferences- Throws:
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:
IPreferences.sync()
-
sync
public void sync() throws java.util.prefs.BackingStoreExceptionEnsures that future reads from this node and its descendants reflect any changes that were committed to the persistent store (from any VM) prior to thesyncinvocation. As a side-effect, forces any changes in the contents of this node and its descendants to the persistent store, as if theflushmethod had been invoked on this node.- Specified by:
syncin interfaceIPreferences- Throws:
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:
IPreferences.flush()
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)Add a change listener.- Specified by:
addPropertyChangeListenerin interfaceIPropertyChangeProvider- Parameters:
listener- the listener to be added
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)Remove a change listener.- Specified by:
removePropertyChangeListenerin interfaceIPropertyChangeProvider- Parameters:
listener- the listener to be removed
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Add a change listener.- Specified by:
addPropertyChangeListenerin interfaceIPropertyChangeProvider- Parameters:
propertyName- the property name the listener will be registered forlistener- the listener to be added
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Remove a change listener.- Specified by:
removePropertyChangeListenerin interfaceIPropertyChangeProvider- Parameters:
propertyName- the property name the listener will not listen for anymorelistener- the listener to be removed
-
firePropertyChange
protected boolean firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Fires an event if property changed.- Parameters:
propertyName- name of propertyoldValue- old valuenewValue- new value- Returns:
truewhen the event was fired (because values were not equal)
-
firePropertyChange
protected boolean firePropertyChange(java.beans.PropertyChangeEvent event)Fires a change event.- Parameters:
event- event to be fired- Returns:
truewhen the event was fired (because values were not equal)
-