public class PropertyMapImpl extends java.lang.Object implements PropertyMap
| Constructor and Description |
|---|
PropertyMapImpl(PropertyMapGroup propertyGroup) |
PropertyMapImpl(PropertyMapGroup propertyGroup,
PropertyMapImpl superObject) |
PropertyMapImpl(PropertyMapGroup propertyGroup,
PropertyMapImpl parent,
PropertyMapProperty property) |
PropertyMapImpl(PropertyMapImpl inheritFrom) |
PropertyMapImpl(PropertyMapImpl parent,
PropertyMapProperty property) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PropertyMapListener listener)
Adds a listener that listens for value changes in this PropertyMap.
|
void |
addPropertyChangeListener(Property property,
PropertyChangeListener listener)
Adds a property listener that listens for value changes for a specific property.
|
void |
addSuperMap(PropertyMap superMap)
Adds a super map to this map.
|
void |
addTreeListener(PropertyMapTreeListener listener)
Adds a tree listener that listens for value changes in this PropertyMap or any child maps.
|
void |
clear(boolean recursive)
Removes all property values in this property map.
|
PropertyMap |
copy(boolean copySuperMaps,
boolean recursive)
Creates a copy of this map.
|
java.lang.Object |
createRelativeRef(Property fromProperty,
PropertyMap toObject,
Property toProperty)
Creates a relative reference from one property value to another property value.
|
void |
dump() |
void |
dump(Printer printer,
java.util.Set printed) |
void |
dumpSuperMaps(Printer printer) |
protected void |
firePropertyTreeValuesChanged(java.util.Map changes) |
void |
firePropertyValueChanged(Property property,
ValueChange change) |
PropertyMap |
getChildMap(PropertyMapProperty property) |
PropertyMapImpl |
getChildMapImpl(PropertyMapProperty property) |
ConstChangeNotifyMap |
getMap() |
PropertyMapImpl |
getParent() |
PropertyMapProperty |
getProperty() |
PropertyMapGroup |
getPropertyGroup() |
PropertyMap |
getSuperMap()
Returns the most recently added super map.
|
int |
getSuperMapCount() |
PropertyValue |
getValue(Property property) |
PropertyValue |
getValueWithDefault(Property property) |
boolean |
isEmpty(boolean recursive)
Returns true if this property map doesn't contain any property values.
|
void |
read(java.io.ObjectInputStream in)
Reads property values from a stream and sets them in this map.
|
void |
removeListener(PropertyMapListener listener)
Removes a listener which was previously added with
PropertyMap.addListener(PropertyMapListener). |
void |
removePropertyChangeListener(Property property,
PropertyChangeListener listener)
Removes a previously added property listener.
|
PropertyMap |
removeSuperMap()
Removes the most recently added super map.
|
boolean |
removeSuperMap(PropertyMap superMap)
Removes a super map that has previously been added using
PropertyMap.addSuperMap(PropertyMap). |
void |
removeTreeListener(PropertyMapTreeListener listener)
Removes a previously added tree listener.
|
java.lang.Object |
removeValue(Property property)
Removes a property value.
|
boolean |
replaceSuperMap(PropertyMap oldSuperMap,
PropertyMap newSuperMap)
Replaces a super map that has previously been added using
PropertyMap.addSuperMap(PropertyMap). |
PropertyValue |
setValue(Property property,
PropertyValue value) |
static void |
skip(java.io.ObjectInputStream in) |
boolean |
valueIsSet(Property property) |
boolean |
valuesEqualTo(PropertyMap propertyObject,
boolean recursive)
Returns true if all the values in this property map is equal to the values in the given map.
|
void |
write(java.io.ObjectOutputStream out)
Serializes the serializable values of this property map.
|
void |
write(java.io.ObjectOutputStream out,
boolean recursive)
Serializes the serializable values of this property map.
|
public PropertyMapImpl(PropertyMapGroup propertyGroup)
public PropertyMapImpl(PropertyMapImpl inheritFrom)
public PropertyMapImpl(PropertyMapGroup propertyGroup, PropertyMapImpl superObject)
public PropertyMapImpl(PropertyMapImpl parent, PropertyMapProperty property)
public PropertyMapImpl(PropertyMapGroup propertyGroup, PropertyMapImpl parent, PropertyMapProperty property)
public ConstChangeNotifyMap getMap()
public PropertyMap getSuperMap()
PropertyMapgetSuperMap in interface PropertyMappublic java.lang.Object removeValue(Property property) throws InvalidPropertyException
PropertyMapremoveValue in interface PropertyMapproperty - the propertyInvalidPropertyException - if values for this property can't be stored in this property mappublic java.lang.Object createRelativeRef(Property fromProperty, PropertyMap toObject, Property toProperty)
PropertyMapWhen the value of the fromProperty is read, it will return the value of the toProperty in the toMap.
Sub maps of this property map will inherit this reference relative to themselves, ie the reference in the sub map is converted to a reference relative to the sub map if possible, otherwise the reference is the same as for the super map. Here is an example:
Changes to the referenced property value will be propagated to listeners of this property.
createRelativeRef in interface PropertyMapfromProperty - the property value that will hold the referencetoObject - the property map that holds the property value that is referencedtoProperty - the property which value is referencedpublic int getSuperMapCount()
public void addSuperMap(PropertyMap superMap)
PropertyMapaddSuperMap in interface PropertyMapsuperMap - the super mappublic PropertyMap removeSuperMap()
PropertyMapremoveSuperMap in interface PropertyMappublic boolean removeSuperMap(PropertyMap superMap)
PropertyMapPropertyMap.addSuperMap(PropertyMap).removeSuperMap in interface PropertyMapsuperMap - the super map to removepublic boolean replaceSuperMap(PropertyMap oldSuperMap, PropertyMap newSuperMap)
PropertyMapPropertyMap.addSuperMap(PropertyMap).replaceSuperMap in interface PropertyMapoldSuperMap - the super map to replacenewSuperMap - the super map to replace it withpublic void addTreeListener(PropertyMapTreeListener listener)
PropertyMapaddTreeListener in interface PropertyMaplistener - the listenerpublic void removeTreeListener(PropertyMapTreeListener listener)
PropertyMapremoveTreeListener in interface PropertyMaplistener - the listenerpublic void addListener(PropertyMapListener listener)
PropertyMapaddListener in interface PropertyMaplistener - the listenerpublic void removeListener(PropertyMapListener listener)
PropertyMapPropertyMap.addListener(PropertyMapListener).removeListener in interface PropertyMaplistener - the listenerpublic PropertyMapGroup getPropertyGroup()
public void addPropertyChangeListener(Property property, PropertyChangeListener listener)
PropertyMapaddPropertyChangeListener in interface PropertyMapproperty - the property to listen to changes onlistener - the listenerpublic void removePropertyChangeListener(Property property, PropertyChangeListener listener)
PropertyMapremovePropertyChangeListener in interface PropertyMapproperty - the property which the listener listens to changes onlistener - the listenerpublic PropertyMapImpl getParent()
public PropertyMapProperty getProperty()
public PropertyMap getChildMap(PropertyMapProperty property)
public PropertyMapImpl getChildMapImpl(PropertyMapProperty property)
public PropertyValue getValueWithDefault(Property property)
public PropertyValue getValue(Property property)
public PropertyValue setValue(Property property, PropertyValue value)
public boolean valueIsSet(Property property)
public void firePropertyValueChanged(Property property, ValueChange change)
protected void firePropertyTreeValuesChanged(java.util.Map changes)
public void dump()
public void dump(Printer printer, java.util.Set printed)
public void dumpSuperMaps(Printer printer)
public void clear(boolean recursive)
PropertyMapclear in interface PropertyMaprecursive - true if child maps should be cleared recursivelypublic boolean isEmpty(boolean recursive)
PropertyMapisEmpty in interface PropertyMaprecursive - true if child maps should be recursively checkedpublic void write(java.io.ObjectOutputStream out,
boolean recursive)
throws java.io.IOException
PropertyMapSerializable
interface will not be written to the stream. The properties are identified using their names.write in interface PropertyMapout - the stream on which to serialize this maprecursive - true if child maps should be recursively serializedjava.io.IOException - if there is an error in the streampublic void write(java.io.ObjectOutputStream out)
throws java.io.IOException
PropertyMap
Serializes the serializable values of this property map. Values not implementing the Serializable
interface will not be written to the stream. The properties are identified using their names.
This method recursively writes all child maps.
write in interface PropertyMapwrite in interface Writableout - the streamjava.io.IOException - if there is a stream errorpublic void read(java.io.ObjectInputStream in)
throws java.io.IOException
PropertyMapread in interface PropertyMapread in interface Readablein - the stream from which to read property valuesjava.io.IOException - if there is an error in the streampublic static void skip(java.io.ObjectInputStream in)
throws java.io.IOException
java.io.IOExceptionpublic boolean valuesEqualTo(PropertyMap propertyObject, boolean recursive)
PropertyMapObject.equals(java.lang.Object).valuesEqualTo in interface PropertyMappropertyObject - the map to compare values withrecursive - true if child maps should be recursively checkedpublic PropertyMap copy(boolean copySuperMaps, boolean recursive)
PropertyMapcopy in interface PropertyMapcopySuperMaps - if true, copies the references to super mapsrecursive - if true, copies all child maps as well