All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----openstar.generic.Parameter
Parameter
consists of a name (a String
object)
and a current value (an arbitrary Object
).
The name of a parameter is used (within a given context) to uniquely identify the parameter. Therefore, it cannot be changed after the parameter has been created.
The value of a parameter can be changed during the lifetime of the parameter object.
Two parameter objects are equal if they have equal names and equal values.
The type of a parameter name is always String
, and the
string will usually have the form of an identifier in common programming
languages, e.g. "color", "width", etc. However, while the type of a
parameter's value is defined to be an Object
, one should
always pass around complete Parameter
objects and avoid
to make copies of these objects. This is essential for the correct
behaviour of the notification mechanism associated with parameters.
true
if and only if the given object
is a Parameter
and both, name and value of the
parameter, are equal to the name and value of this object.
protected String name
protected Object value
public Parameter(String name)
public Parameter(String name, Object value)
public String getName()
public void setValue(Object value)
A java.beans.PropertyChangeEvent
is fired to all registered
listeners (only if the new value is different from the current value).
public Object getValue()
public boolean equals(Object object)
true
if and only if the given object
is a Parameter
and both, name and value of the
parameter, are equal to the name and value of this object.
Note that equality in this sense does not imply that both parameters are the same objects.
public Object clone()
The new parameter has no registered listeners.
public void addPropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
All Packages Class Hierarchy This Package Previous Next Index