E
- the type of elements held in this queuepublic class TransformedQueue<E> extends TransformedCollection<E> implements java.util.Queue<E>
Queue
to transform objects that are added.
The add/offer methods are affected by this class. Thus objects must be removed or searched for using their transformed form. For example, if the transformation converts Strings to Integers, you must use the Integer form to remove objects.
Modifier and Type | Method and Description |
---|---|
E |
element() |
boolean |
offer(E obj) |
E |
peek() |
E |
poll() |
E |
remove() |
static <E> TransformedQueue<E> |
transformedQueue(java.util.Queue<E> queue,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming queue that will transform
existing contents of the specified queue.
|
static <E> TransformedQueue<E> |
transformingQueue(java.util.Queue<E> queue,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming queue.
|
add, addAll, transformedCollection, transformingCollection
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static <E> TransformedQueue<E> transformingQueue(java.util.Queue<E> queue, Transformer<? super E,? extends E> transformer)
If there are any elements already in the queue being decorated, they
are NOT transformed.
Contrast this with transformedQueue(Queue, Transformer)
.
E
- the type of the elements in the queuequeue
- the queue to decorate, must not be nulltransformer
- the transformer to use for conversion, must not be nulljava.lang.NullPointerException
- if queue or transformer is nullpublic static <E> TransformedQueue<E> transformedQueue(java.util.Queue<E> queue, Transformer<? super E,? extends E> transformer)
If there are any elements already in the queue being decorated, they
will be transformed by this method.
Contrast this with transformingQueue(Queue, Transformer)
.
E
- the type of the elements in the queuequeue
- the queue to decorate, must not be nulltransformer
- the transformer to use for conversion, must not be nulljava.lang.NullPointerException
- if queue or transformer is nullCopyright © 2010 - 2020 Adobe. All Rights Reserved