net.israfil.foundation.valuemodel
Class ValueHolder<E>

java.lang.Object
  extended by net.israfil.foundation.valuemodel.ValueHolder<E>
All Implemented Interfaces:
MutableValue<E>, Observable, Value<E>, Vetoable

public class ValueHolder<E>
extends java.lang.Object
implements MutableValue<E>

Author:
cgruber To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Nested Class Summary
protected  class ValueHolder.CallbackObjectHolder
           
protected  class ValueHolder.ObserverHolder
           
protected  class ValueHolder.VetoerHolder
           
 
Constructor Summary
protected ValueHolder()
           
  ValueHolder(E o)
           
 
Method Summary
 void addObservers(java.lang.String callback, java.lang.Object... observers)
          Add an observer to this object, with a callback method spec that will be invoked upon a data change.
 void addVetoers(java.lang.String callback, java.lang.Object... vetoers)
          Add one or more vetoers to this object, with a callback method spec that will be invoked upon a data change.
 E get()
           
 void removeObservers(java.lang.Object... observers)
          Remove observer from observable object.
 void removeVetoers(java.lang.Object... vetoers)
          Remove one or more vetoers from vetoable object.
 void set(E newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueHolder

public ValueHolder(E o)

ValueHolder

protected ValueHolder()
Method Detail

get

public E get()
Specified by:
get in interface Value<E>

set

public void set(E newValue)
Specified by:
set in interface MutableValue<E>

addObservers

public void addObservers(java.lang.String callback,
                         java.lang.Object... observers)
Description copied from interface: Observable
Add an observer to this object, with a callback method spec that will be invoked upon a data change. The callback method should contain only one Object parameter which will be the sender when the callback is invoked.

Specified by:
addObservers in interface Observable
See Also:
org.israfil.maveric.Observable#addObserver(java.lang.Object, java.lang.String)

removeObservers

public void removeObservers(java.lang.Object... observers)
Description copied from interface: Observable
Remove observer from observable object.

Specified by:
removeObservers in interface Observable
See Also:
org.israfil.maveric.Observable#removeObserver(java.lang.Object)

addVetoers

public void addVetoers(java.lang.String callback,
                       java.lang.Object... vetoers)
Description copied from interface: Vetoable
Add one or more vetoers to this object, with a callback method spec that will be invoked upon a data change. The callback method should contain two parameters. The first is the notification source (the holder or whatever) and the new value. It also should return a boolean.

Specified by:
addVetoers in interface Vetoable
See Also:
org.israfil.maveric.Vetoable#addVetoer(java.lang.Object, java.lang.String)

removeVetoers

public void removeVetoers(java.lang.Object... vetoers)
Description copied from interface: Vetoable
Remove one or more vetoers from vetoable object.

Specified by:
removeVetoers in interface Vetoable
See Also:
org.israfil.maveric.Vetoable#removeVetoer(java.lang.Object)


Copyright © 2006-2008. All Rights Reserved.