public interface Inbox
Queue<Object>
API restricted to the consumer side,
with additional support for bulk draining operations.Modifier and Type | Method and Description |
---|---|
default <E> int |
drain(java.util.function.Consumer<E> consumer)
Passes each of this object's items to the supplied consumer until it is empty.
|
default <E> int |
drainTo(Collection<E> target)
Drains all elements into the provided
Collection . |
boolean |
isEmpty()
Returns
true if this inbox contains no elements, false otherwise. |
Object |
peek()
Retrieves, but does not remove, the head of this inbox, or returns
null if it is empty. |
Object |
poll()
Retrieves and removes the head of this inbox, or returns
null
if it is empty. |
Object |
remove()
Retrieves and removes the head of this inbox.
|
boolean isEmpty()
true
if this inbox contains no elements, false
otherwise.Object peek()
null
if it is empty.Object poll()
null
if it is empty.Object remove()
poll
only in that it throws an exception if the inbox is empty.NoSuchElementException
- if this inbox is emptydefault <E> int drainTo(Collection<E> target)
Collection
.target
- the collection to drain this object's items intodefault <E> int drain(java.util.function.Consumer<E> consumer)
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.