org.eigenbase.util.property
Class Property.TriggerList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
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.
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 |
Property.TriggerList
private Property.TriggerList()
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.