Class com.bdnm.mvc.ValueHolder
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bdnm.mvc.ValueHolder

java.lang.Object
   |
   +----java.util.Observable
           |
           +----com.bdnm.mvc.ValueModel
                   |
                   +----com.bdnm.mvc.ValueHolder

public class ValueHolder
extends ValueModel
This class represents a holder on an Object. It implements the Valuable interface, so you can set and get this value. In addition, it is an Observable so you can share this instance between any number of Observers. The argument that is sent in an update is the new value.

Constructor Index

 o ValueHolder(Object)
Construct an instance with an initial value.

Method Index

 o getValue()
Called to get the current value this object represents.
 o setValue(Object)
Called to set the current value, which must be cast to an Object.

Constructors

 o ValueHolder
  public ValueHolder(Object initValue)
Construct an instance with an initial value.
Parameters:
initValue - the initial value

Methods

 o getValue
  public Object getValue()
Called to get the current value this object represents. Necessary to implement Valuable.
Returns:
the current value, which is cast to an Object
Overrides:
getValue in class ValueModel
 o setValue
  public synchronized void setValue(Object newValue)
Called to set the current value, which must be cast to an Object. This will also notify all Observers of the change. Necessary to implement Valuable.
Parameters:
newValue - the new value to set
Overrides:
setValue in class ValueModel

All Packages  Class Hierarchy  This Package  Previous  Next  Index