E - queue element typepublic abstract class AbstractObservableQueue<E> extends AbstractQueueDecorator<E> implements ObservableQueue<E>
Queue.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractObservableQueue(Queue<E> queue)
Create a new abstract observable queue that
decorates the specified queue.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> coll) |
void |
addQueueChangeListener(QueueChangeListener<E> l)
Add the specified queue change listener.
|
void |
addVetoableQueueChangeListener(VetoableQueueChangeListener<E> l)
Add the specified vetoable queue change listener.
|
void |
clear() |
void |
fireQueueChanged()
Fire a change event to all registered
QueueChangeListeners. |
void |
fireQueueChanged(QueueChangeEvent<E> e)
Fire the specified change event to all registered
QueueChangeListeners. |
void |
fireQueueWillChange()
Fire a will change event to all registered
VetoableQueueChangeListeners. |
void |
fireQueueWillChange(VetoableQueueChangeEvent<E> e)
Fire the specified will change event to all registered
VetoableQueueChangeListeners. |
protected ObservableQueueChangeSupport<E> |
getObservableQueueChangeSupport()
Return the
ObservableQueueChangeSupport
class backing this abstract observable queue. |
int |
getQueueChangeListenerCount()
Return the number of
QueueChangeListeners registered
to this observable queue. |
QueueChangeListener<E>[] |
getQueueChangeListeners()
Return an array of all
QueueChangeListeners, or
an empty array if none are registered. |
int |
getVetoableQueueChangeListenerCount()
Return the number of
VetoableQueueChangeListeners
registered to this observable queue. |
VetoableQueueChangeListener<E>[] |
getVetoableQueueChangeListeners()
Return an array of all
VetoableQueueChangeListeners,
or an empty array if none are registered. |
Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
poll() |
protected abstract void |
postAdd(E e)
Notify subclasses the
add method has just been
called on the wrapped queue with the specified parameter. |
protected abstract void |
postAddAll(Collection<? extends E> coll)
Notify subclasses the
addAll method has just been
called on the wrapped queue with the specified parameter. |
protected abstract void |
postClear()
Notify subclasses the
clear method has just been
called on the wrapped queue. |
protected abstract void |
postIteratorRemove()
Notify subclasses the
remove method has just been
called on the wrapped queue's iterator. |
protected abstract void |
postOffer(E e)
Notify subclasses the
offer method has just been
called on the wrapped queue with the specified parameter. |
protected abstract void |
postPoll()
Notify subclasses the
poll method has just been
called on the wrapped queue. |
protected abstract void |
postRemove(Object o)
Notify subclasses the
remove method has just been
called on the wrapped queue with the specified parameter. |
protected abstract void |
postRemoveAll(Collection<?> coll)
Notify subclasses the
removeAll method has just been
called on the wrapped queue with the specified parameter. |
protected abstract void |
postRetainAll(Collection<?> coll)
Notify subclasses the
retainAll method has just been
called on the wrapped queue with the specified parameter. |
protected abstract boolean |
preAdd(E e)
Notify subclasses the
add method is about to
be called on the wrapped queue with the specified parameter. |
protected abstract boolean |
preAddAll(Collection<? extends E> coll)
Notify subclasses the
addAll method is about to
be called on the wrapped queue with the specified parameter. |
protected abstract boolean |
preClear()
Notify subclasses the
clear method is about to
be called on the wrapped queue. |
protected abstract boolean |
preIteratorRemove()
Notify subclasses the
remove method is about to
be called on the wrapped queue's iterator. |
protected abstract boolean |
preOffer(E e)
Notify subclasses the
offer method is about to
be called on the wrapped queue with the specified parameter. |
protected abstract boolean |
prePoll()
Notify subclasses the
poll method is about to
be called on the wrapped queue. |
protected abstract boolean |
preRemove(Object o)
Notify subclasses the
remove method is about to
be called on the wrapped queue with the specified parameter. |
protected abstract boolean |
preRemoveAll(Collection<?> coll)
Notify subclasses the
removeAll method is about to
be called on the wrapped queue with the specified parameter. |
protected abstract boolean |
preRetainAll(Collection<?> coll)
Notify subclasses the
retainAll method is about to
be called on the wrapped queue with the specified parameter. |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> coll) |
void |
removeQueueChangeListener(QueueChangeListener<E> l)
Remove the specified queue change listener.
|
void |
removeVetoableQueueChangeListener(VetoableQueueChangeListener<E> l)
Remove the specified vetoable queue change listener.
|
boolean |
retainAll(Collection<?> coll) |
contains, containsAll, element, equals, getQueue, hashCode, isEmpty, peek, remove, size, toArray, toArrayclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, size, toArray, toArrayprotected final ObservableQueueChangeSupport<E> getObservableQueueChangeSupport()
ObservableQueueChangeSupport
class backing this abstract observable queue.ObservableQueueChangeSupport
class backing this abstract observable queuepublic final void addQueueChangeListener(QueueChangeListener<E> l)
addQueueChangeListener in interface ObservableQueue<E>l - queue change listener to addpublic final void removeQueueChangeListener(QueueChangeListener<E> l)
removeQueueChangeListener in interface ObservableQueue<E>l - queue change listener to removepublic final void addVetoableQueueChangeListener(VetoableQueueChangeListener<E> l)
addVetoableQueueChangeListener in interface ObservableQueue<E>l - vetoable queue change listener to addpublic final void removeVetoableQueueChangeListener(VetoableQueueChangeListener<E> l)
removeVetoableQueueChangeListener in interface ObservableQueue<E>l - vetoable queue change listener to removepublic final QueueChangeListener<E>[] getQueueChangeListeners()
QueueChangeListeners, or
an empty array if none are registered.getQueueChangeListeners in interface ObservableQueue<E>QueueChangeListeners, or
an empty array if none are registeredpublic final int getQueueChangeListenerCount()
QueueChangeListeners registered
to this observable queue.getQueueChangeListenerCount in interface ObservableQueue<E>QueueChangeListeners registered
to this observable queuepublic final VetoableQueueChangeListener<E>[] getVetoableQueueChangeListeners()
VetoableQueueChangeListeners,
or an empty array if none are registered.getVetoableQueueChangeListeners in interface ObservableQueue<E>VetoableQueueChangeListeners,
or an empty array if none are registeredpublic final int getVetoableQueueChangeListenerCount()
VetoableQueueChangeListeners
registered to this observable queue.getVetoableQueueChangeListenerCount in interface ObservableQueue<E>VetoableQueueChangeListeners
registered to this observable queuepublic void fireQueueWillChange()
throws QueueChangeVetoException
VetoableQueueChangeListeners.QueueChangeVetoException - if any of the listeners veto the changepublic void fireQueueWillChange(VetoableQueueChangeEvent<E> e) throws QueueChangeVetoException
VetoableQueueChangeListeners.e - will change eventQueueChangeVetoException - if any of the listeners veto the changepublic void fireQueueChanged()
QueueChangeListeners.public void fireQueueChanged(QueueChangeEvent<E> e)
QueueChangeListeners.e - change eventprotected abstract boolean preAdd(E e)
add method is about to
be called on the wrapped queue with the specified parameter.
Return true to proceed with the change.e - add method parameterprotected abstract void postAdd(E e)
add method has just been
called on the wrapped queue with the specified parameter.e - add method parameterprotected abstract boolean preAddAll(Collection<? extends E> coll)
addAll method is about to
be called on the wrapped queue with the specified parameter.
Return true to proceed with the change.coll - addAll method parameterprotected abstract void postAddAll(Collection<? extends E> coll)
addAll method has just been
called on the wrapped queue with the specified parameter.coll - addAll method parameterprotected abstract boolean preClear()
clear method is about to
be called on the wrapped queue.
Return true to proceed with the change.protected abstract void postClear()
clear method has just been
called on the wrapped queue.protected abstract boolean preRemove(Object o)
remove method is about to
be called on the wrapped queue with the specified parameter.
Return true to proceed with the change.o - remove method parameterprotected abstract void postRemove(Object o)
remove method has just been
called on the wrapped queue with the specified parameter.o - remove method parameterprotected abstract boolean preRemoveAll(Collection<?> coll)
removeAll method is about to
be called on the wrapped queue with the specified parameter.
Return true to proceed with the change.coll - removeAll method parameterprotected abstract void postRemoveAll(Collection<?> coll)
removeAll method has just been
called on the wrapped queue with the specified parameter.coll - removeAll method parameterprotected abstract boolean preRetainAll(Collection<?> coll)
retainAll method is about to
be called on the wrapped queue with the specified parameter.
Return true to proceed with the change.coll - retainAll method parameterprotected abstract void postRetainAll(Collection<?> coll)
retainAll method has just been
called on the wrapped queue with the specified parameter.coll - retainAll method parameterprotected abstract boolean preIteratorRemove()
remove method is about to
be called on the wrapped queue's iterator.
Return true to proceed with the change.protected abstract void postIteratorRemove()
remove method has just been
called on the wrapped queue's iterator.protected abstract boolean preOffer(E e)
offer method is about to
be called on the wrapped queue with the specified parameter.
Return true to proceed with the change.e - offer method parameterprotected abstract void postOffer(E e)
offer method has just been
called on the wrapped queue with the specified parameter.e - offer method parameterprotected abstract boolean prePoll()
poll method is about to
be called on the wrapped queue.
Return true to proceed with the change.protected abstract void postPoll()
poll method has just been
called on the wrapped queue.public boolean add(E e)
add in interface Collection<E>add in interface Queue<E>add in class AbstractQueueDecorator<E>public boolean addAll(Collection<? extends E> coll)
addAll in interface Collection<E>addAll in class AbstractQueueDecorator<E>public void clear()
clear in interface Collection<E>clear in class AbstractQueueDecorator<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractQueueDecorator<E>public boolean remove(Object o)
remove in interface Collection<E>remove in class AbstractQueueDecorator<E>public boolean removeAll(Collection<?> coll)
removeAll in interface Collection<E>removeAll in class AbstractQueueDecorator<E>public boolean retainAll(Collection<?> coll)
retainAll in interface Collection<E>retainAll in class AbstractQueueDecorator<E>public boolean offer(E e)
Copyright (c) 2003-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).