public class PropertyChangeNamespace extends PropertyChangeDispatcher implements java.beans.PropertyChangeListener
This class is useful for collecting data on multiple SimEntities of the same type. It allows you to distinguish between properties with the same name on different SimEntities. For example, to collect data on a number of identical servers, A PropertyChangeNamespace is created with a unique namespace as a PropertyChangeListener for each server. Then the class responsible for collecting the statistics is registered as a listener to each of the PropertyChangeNamespaces. Since the namespace is prepended to the property name, the server on which the property changed can be distinguished by the statistics collector.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
nameSpace
The String to prepend to the property name.
|
Constructor and Description |
---|
PropertyChangeNamespace(java.lang.Object source,
java.lang.String name)
Creates a new instance of PropertyChangeNamespace.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNameSpace() |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Re-fires the PropertyChangeEvent with the namespace prepended to the
property name.
|
void |
setNamespace(java.lang.String name) |
java.lang.String |
toString() |
addPropertyChangeListener, addPropertyChangeListener, clearAddedProperties, clearAddedProperty, firePropertyChange, firePropertyChange, getAddedProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyName, isGetterSignature, isSetterSignature, paramString, removePropertyChangeListener, removePropertyChangeListener, setProperty
private java.lang.String nameSpace
public PropertyChangeNamespace(java.lang.Object source, java.lang.String name)
source
- The Object this PropertyChangeNamespace will manage
properties for.name
- The String to prepend to the property name.PropertyChangeDispatcher
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
e
- given PropertyChangeEventpublic java.lang.String getNameSpace()
public void setNamespace(java.lang.String name)
name
- the String to prepend to the property name.public java.lang.String toString()
toString
in class PropertyChangeDispatcher