public class RQueue<E> extends RCollection<E> implements Queue<E>
Queue
. Note: unlike standard Java queues, reactive queues
do not support removing arbitrary items from the queue; only the head of the queue may be
removed.Modifier and Type | Class and Description |
---|---|
static class |
RQueue.Listener<E>
Publishes queue events to listeners.
|
Reactor.RListener
Constructor and Description |
---|
RQueue(Queue<E> impl)
Creates a reactive queue with the supplied underlying queue implementation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element) |
boolean |
addAll(Collection<? extends E> elements) |
void |
clear() |
Connection |
connect(RQueue.Listener<? super E> listener)
Connects the supplied listener to this queue, such that it will be notified on offers and
polls.
|
Connection |
connectNotify(RQueue.Listener<? super E> listener)
Invokes
onOffer for all existing queue elements, then connects listener . |
boolean |
contains(Object object) |
boolean |
containsAll(Collection<?> collection) |
static <E> RQueue<E> |
create()
Creates a reactive queue backed by an
LinkedList . |
static <E> RQueue<E> |
create(Queue<E> impl)
Creates a reactive queue with the supplied underlying queue implementation.
|
void |
disconnect(RQueue.Listener<? super E> listener)
Disconnects the supplied listener from this queue if listen was called with it.
|
E |
element() |
boolean |
equals(Object other) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
offer(E element) |
E |
peek() |
E |
poll() |
E |
remove() |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> collection) |
boolean |
retainAll(Collection<?> collection) |
int |
size()
Returns the number of elements in this collection.
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
String |
toString() |
isEmptyView, isNonEmptyView, sizeView
clearConnections, hasConnections
parallelStream, removeIf, spliterator, stream
public static <E> RQueue<E> create()
LinkedList
.public static <E> RQueue<E> create(Queue<E> impl)
public Connection connect(RQueue.Listener<? super E> listener)
public Connection connectNotify(RQueue.Listener<? super E> listener)
onOffer
for all existing queue elements, then connects listener
.public void disconnect(RQueue.Listener<? super E> listener)
public boolean add(E element)
public boolean addAll(Collection<? extends E> elements)
addAll
in interface Collection<E>
public void clear()
clear
in interface Collection<E>
public boolean equals(Object other)
equals
in interface Collection<E>
equals
in class Object
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<E>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<E>
public boolean remove(Object object)
remove
in interface Collection<E>
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in class Object
public int size()
RCollection
size
in interface Collection<E>
size
in class RCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
public boolean contains(Object object)
contains
in interface Collection<E>
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<E>
public Object[] toArray()
toArray
in interface Collection<E>
public <T> T[] toArray(T[] array)
toArray
in interface Collection<E>
Copyright © 2017. All rights reserved.