com.std.util
Class Stateful<U>

java.lang.Object
extended by com.std.util.Stateful<U>
Type Parameters:
U - the object class to be wrapped
Direct Known Subclasses:
Persistent, StatefulAppointment, StatefulDate

public class Stateful<U>
extends java.lang.Object

Stateful is a wrapper around any object U that keeps track of the instance reference of U and alerts its observers when U is replaced.

Author:
xxx

Constructor Summary
Stateful(U target)
           
 
Method Summary
 U getTarget()
           
 ObservableEvent onChanged()
           
 void setTarget(U target)
          replaces the target reference to U
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stateful

public Stateful(U target)
Method Detail

getTarget

public U getTarget()
Returns:
the target reference of U

onChanged

public ObservableEvent onChanged()
Returns:
the observable event that will send out notifications when the target reference has changed.

setTarget

public void setTarget(U target)
replaces the target reference to U

Parameters:
target - the new target reference