Class SynchronizedPropertyObject
- java.lang.Object
-
- jadex.commons.SimplePropertyObject
-
- jadex.commons.meta.TypedPropertyObject
-
- jadex.extension.envsupport.environment.SynchronizedPropertyObject
-
- All Implemented Interfaces:
IPropertyObject
,ITypedPropertyObject
- Direct Known Subclasses:
AbstractEnvironmentSpace
,SpaceObject
public abstract class SynchronizedPropertyObject extends TypedPropertyObject
Basic synchronized IPropertyObject implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
monitor
The monitor.-
Fields inherited from class jadex.commons.SimplePropertyObject
pcs, properties
-
-
Constructor Summary
Constructors Constructor Description SynchronizedPropertyObject(IPropertyMetaDataSet propertiesMeta, java.lang.Object monitor)
Initializes the PropertyHolder, should be called by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.java.lang.Object
getMonitor()
Returns the monitor.java.lang.Object
getProperty(java.lang.String name)
Returns a property.java.util.Set
getPropertyNames()
Returns all of the properties.boolean
hasProperty(java.lang.String name)
Test if has a property.void
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.void
setProperty(java.lang.String name, java.lang.Object value)
Sets a property-
Methods inherited from class jadex.commons.meta.TypedPropertyObject
getMetaData, getMetaDatas
-
Methods inherited from class jadex.commons.SimplePropertyObject
getProperties, setProperties, toString
-
-
-
-
Constructor Detail
-
SynchronizedPropertyObject
public SynchronizedPropertyObject(IPropertyMetaDataSet propertiesMeta, java.lang.Object monitor)
Initializes the PropertyHolder, should be called by subclasses.- Parameters:
monitor
- the monitor
-
-
Method Detail
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Returns a property.- Specified by:
getProperty
in interfaceIPropertyObject
- Overrides:
getProperty
in classSimplePropertyObject
- Parameters:
name
- name of the property- Returns:
- the property
-
getPropertyNames
public java.util.Set getPropertyNames()
Returns all of the properties.- Specified by:
getPropertyNames
in interfaceIPropertyObject
- Overrides:
getPropertyNames
in classSimplePropertyObject
- Returns:
- the properties
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value)
Sets a property- Specified by:
setProperty
in interfaceIPropertyObject
- Overrides:
setProperty
in classSimplePropertyObject
- Parameters:
name
- name of the propertyvalue
- value of the property
-
hasProperty
public boolean hasProperty(java.lang.String name)
Test if has a property.- Specified by:
hasProperty
in interfaceIPropertyObject
- Overrides:
hasProperty
in classSimplePropertyObject
- Parameters:
name
- the name of the property to test- Returns:
true
if and only if the property exists
-
getMonitor
public java.lang.Object getMonitor()
Returns the monitor.- Returns:
- the monitor
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Overrides:
addPropertyChangeListener
in classSimplePropertyObject
- Parameters:
listener
- The PropertyChangeListener to be added.
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.- Overrides:
removePropertyChangeListener
in classSimplePropertyObject
- Parameters:
listener
- The PropertyChangeListener to be removed.
-
-