org.eigenbase.util.property
Class Property.TriggerList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.eigenbase.util.property.Property.TriggerList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess
Enclosing class:
Property

private static class Property.TriggerList
extends ArrayList

A trigger list a list of triggers associated with a given property.

A trigger list is associated with a property key, and contains zero or more Trigger objects.

Each Trigger is stored in a WeakReference so that when the Trigger is only reachable via weak references the Trigger will be be collected and the contents of the WeakReference will be set to null.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
private Property.TriggerList()
           
 
Method Summary
(package private)  void add(Trigger trigger)
          Adds a Trigger, wrapping it in a WeakReference.
private  Trigger convert(Object o)
          Converts a trigger or a weak reference to a trigger into a trigger.
(package private)  void execute(Property property, String value)
          Executes every Trigger in this Property.TriggerList, passing in the property key whose change was the casue.
(package private)  void remove(Trigger trigger)
          Removes the given Trigger.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Property.TriggerList

private Property.TriggerList()
Method Detail

add

void add(Trigger trigger)
Adds a Trigger, wrapping it in a WeakReference.

Parameters:
trigger -

remove

void remove(Trigger trigger)
Removes the given Trigger.

In addition, removes any WeakReference that is empty.

Parameters:
trigger -

execute

void execute(Property property,
             String value)
       throws Trigger.VetoRT
Executes every Trigger in this Property.TriggerList, passing in the property key whose change was the casue.

In addition, removes any WeakReference that is empty.

Synchronizes on property while modifying the trigger list.

Parameters:
property - The property whose change caused this property to fire
Throws:
Trigger.VetoRT

convert

private Trigger convert(Object o)
Converts a trigger or a weak reference to a trigger into a trigger. The result may be null.