All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openstar.generic.Parameter

java.lang.Object
   |
   +----openstar.generic.Parameter

public class Parameter
extends Object
implements Serializable
A 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.

Version:
11 Jun 1997
Author:
Nils Schwabe

Variable Index

 o name
 o value

Constructor Index

 o Parameter(String)
 o Parameter(String, Object)

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
 o clone()
Returns an independent copy of this parameter.
 o equals(Object)
Returns 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.
 o getName()
 o getValue()
 o removePropertyChangeListener(PropertyChangeListener)
 o setValue(Object)
Changes the value of the parameter.

Variables

 o name
  protected String name
 o value
  protected Object value

Constructors

 o Parameter
  public Parameter(String name)
 o Parameter
  public Parameter(String name,
                   Object value)

Methods

 o getName
  public String getName()
 o setValue
  public void setValue(Object value)
Changes the value of the parameter.

A java.beans.PropertyChangeEvent is fired to all registered listeners (only if the new value is different from the current value).

 o getValue
  public Object getValue()
 o equals
  public boolean equals(Object object)
Returns 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.

Overrides:
equals in class Object
 o clone
  public Object clone()
Returns an independent copy of this parameter.

The new parameter has no registered listeners.

Overrides:
clone in class Object
 o addPropertyChangeListener
  public void addPropertyChangeListener(PropertyChangeListener listener)
 o removePropertyChangeListener
  public void removePropertyChangeListener(PropertyChangeListener listener)

All Packages  Class Hierarchy  This Package  Previous  Next  Index