edu.washington.cs.supple.rep.values
Class ValueRef

java.lang.Object
  extended byedu.washington.cs.supple.rep.values.Variable
      extended byedu.washington.cs.supple.rep.values.ValueRef
All Implemented Interfaces:
ValueBinding, ValueListener
Direct Known Subclasses:
FirstAndOnlyRef

public class ValueRef
extends Variable
implements ValueListener

ValueRef acts as a pointer to another value.

Author:
dbc1

Constructor Summary
ValueRef(ValueBinding binding)
           
 
Method Summary
 ValueBinding deref()
          Get the referenced value binding.
 java.lang.Object getValue()
          Get the bound value.
 java.lang.Class getValueClass()
          Get the class of this variable
 void ref(ValueBinding binding)
          Change the referenced value binding.
 void setValue(java.lang.Object value)
          Set the value of this variable.
 void valueChanged(ValueBinding binding, java.lang.Object newValue)
          Signals variable change.
 
Methods inherited from class edu.washington.cs.supple.rep.values.Variable
addListener, postLastListener, preFirstListener, processUpdate, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueRef

public ValueRef(ValueBinding binding)
Method Detail

getValueClass

public java.lang.Class getValueClass()
Description copied from interface: ValueBinding
Get the class of this variable

Specified by:
getValueClass in interface ValueBinding
Returns:

getValue

public java.lang.Object getValue()
Description copied from interface: ValueBinding
Get the bound value.

Specified by:
getValue in interface ValueBinding
Returns:

setValue

public void setValue(java.lang.Object value)
Description copied from interface: ValueBinding
Set the value of this variable.

Specified by:
setValue in interface ValueBinding
Parameters:
value -

ref

public void ref(ValueBinding binding)
Change the referenced value binding.

Parameters:
binding -

deref

public ValueBinding deref()
Get the referenced value binding.

Returns:

valueChanged

public void valueChanged(ValueBinding binding,
                         java.lang.Object newValue)
Description copied from interface: ValueListener
Signals variable change.

Specified by:
valueChanged in interface ValueListener
Parameters:
binding -
newValue -