A
- the type of wrapper valuepublic abstract class PropertyValue<A>
extends java.lang.Object
DockProperties
,
or can be set by the client directly.Constructor and Description |
---|
PropertyValue(PropertyKey<A> key)
Creates a new value.
|
PropertyValue(PropertyKey<A> key,
DockController controller)
Creates a new value.
|
Modifier and Type | Method and Description |
---|---|
PropertyKey<A> |
getKey()
Gets the key which is used to access the value in
DockProperties . |
A |
getOwnValue()
Gets the value that was set through
setValue(Object) . |
DockProperties |
getProperties()
Gets the currently observed properties.
|
A |
getValue()
Gets the current value.
|
boolean |
isAnyValueSet()
Tells whether any value is set.
|
void |
setKey(PropertyKey<A> key)
Sets the key which is used to access the value in
DockProperties . |
void |
setProperties(DockController controller)
Sets the
DockProperties that are read from
controller . |
void |
setProperties(DockProperties properties)
Sets the
DockProperties which should be observed. |
void |
setValue(A value)
Sets the current value.
|
java.lang.String |
toString() |
protected abstract void |
valueChanged(A oldValue,
A newValue)
Invoked when the value has been changed.
|
public PropertyValue(PropertyKey<A> key)
key
- the key used to access the value in DockProperties
public PropertyValue(PropertyKey<A> key, DockController controller)
key
- the key used to access the value in DockProperties
controller
- the controller from which properties are to be readpublic void setProperties(DockController controller)
DockProperties
that are read from
controller
.controller
- the properties, can be null
setProperties(DockProperties)
public void setProperties(DockProperties properties)
DockProperties
which should be observed.properties
- the new properties, can be null
public DockProperties getProperties()
null
public PropertyKey<A> getKey()
DockProperties
.public void setKey(PropertyKey<A> key)
DockProperties
.key
- the new keypublic A getValue()
setValue(Object)
if
the argument was not null
, or else the value read from
the properties
.null
even if the
PropertyKey
has a non-null
default value.null
if no value was found at allpublic A getOwnValue()
setValue(Object)
.null
public boolean isAnyValueSet()
true
if not the default value of the key
would be returnedpublic void setValue(A value)
value
- the value, null
if the value should be read
from the properties
protected abstract void valueChanged(A oldValue, A newValue)
oldValue
- the new valuenewValue
- the old valuepublic java.lang.String toString()
toString
in class java.lang.Object