Package jmri.util
Class PropertyChangeEventQueue
java.lang.Object
jmri.util.PropertyChangeEventQueue
Gathers PropertyChangeEvents that might occur in overlapping threads and at
overlapping times, presenting them as requested.
Listeners are installed when the object is constructed. dispose()
detaches those listeners, after which the object should not be used. It is
not an error to call dispose() multiple times.
Although this could be more generic than NamedBean, there's no single interface that specifies "can call addPropertyChangeListener(..)".
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BlockingQueue<PropertyChangeEvent>(package private) final Collection<NamedBean>(package private) final PropertyChangeListener(package private) static final int -
Constructor Summary
ConstructorsConstructorDescriptionPropertyChangeEventQueue(Collection<NamedBean> collection) PropertyChangeEventQueue(NamedBean[] array) -
Method Summary
-
Field Details
-
items
-
MAX_SIZE
- See Also:
-
dq
-
listener
-
-
Constructor Details
-
PropertyChangeEventQueue
- Parameters:
collection- Set of NamedBeans whose events should be handled. Keeps a copy of the contents, so future changes irrelevant.
-
PropertyChangeEventQueue
- Parameters:
array- Set of NamedBeans whose events should be handled Keeps a copy of the contents, so future changes irrelevant.
-
-
Method Details
-
dispose
Dispose by dropping the listeners to all the specifiedNamedBeans. The object should not be used again after calling this. It is not an error to call this multiple times. -
take
- Throws:
InterruptedException
-
poll
- Throws:
InterruptedException
-
toString
-