danger.util
Interface ActiveObject

All Known Implementing Classes:
StdActiveObject


public interface ActiveObject

An object that can report on its activity. This interface (and its inner interface) merely provides a simple reporting mechanism, and it's up to users of the interface to do something useful with it.


Nested Class Summary
static interface ActiveObject.Delegate
          Interface for delegates that get notified on changes to instances of this (outer) class.
static class ActiveObject.WeakDelegateList
          List of delegates which are held onto weakly.
 
Method Summary
 void addDelegate(ActiveObject.Delegate delegate)
          Add a new delegate to this instance.
 void removeDelegate(ActiveObject.Delegate delegate)
          Remove a delegate from this instance that was previously added via a call to addDelegate(danger.util.ActiveObject.Delegate).
 void update()
          Indicate that this instance has been updated.
 

Method Detail

addDelegate

void addDelegate(ActiveObject.Delegate delegate)
Add a new delegate to this instance.

Parameters:
delegate - non-null; the delegate to add
Throws:
NullPointerException - thrown if delegate == null

removeDelegate

void removeDelegate(ActiveObject.Delegate delegate)
Remove a delegate from this instance that was previously added via a call to addDelegate(danger.util.ActiveObject.Delegate).

Parameters:
delegate - non-null; the delegate to remove
Throws:
IllegalArgumentException - thrown if the delegate had not been added as a delegate of this instance

update

void update()
Indicate that this instance has been updated. This should just call through to the delegate, if any.