com.hazelcast.map.impl.mapstore.writebehind
E
- the type of element to be stored in this queue.public interface WriteBehindQueue<E>
getFrontByTime(long, java.util.Collection)
, getFrontByNumber(int, java.util.Collection)
Modifier and Type | Method and Description |
---|---|
void |
addFirst(Collection<E> collection)
Inserts collection of elements to the front of this queue.
|
void |
addLast(E e)
Inserts to the end of this queue.
|
List<E> |
asList()
Returns a read-only list representation of this queue.
|
void |
clear()
Removes all of the elements in this
WriteBehindQueue
Queue will be empty after this method returns. |
boolean |
contains(E e)
Checks whether an element exist in this queue.
|
int |
drainTo(Collection<E> collection)
Removes all elements from this queue and adds them to the given collection.
|
void |
getFrontByNumber(int numberOfElements,
Collection<E> collection)
Adds the given number of elements to the supplied collection by starting from the head of this queue.
|
void |
getFrontByTime(long time,
Collection<E> collection)
Adds all elements to the supplied collection which are smaller than or equal to the given time.
|
boolean |
removeFirstOccurrence(E e)
Removes the first occurrence of the specified element in this queue
when searching it by starting from the head of this queue.
|
int |
size()
Returns the number of elements in this
WriteBehindQueue . |
void addFirst(Collection<E> collection)
collection
- collection of elements to be inserted in front of this queue.void addLast(E e)
e
- element to be offeredboolean removeFirstOccurrence(E e)
e
- element to be removed.true
if removed successfully, false
otherwiseint drainTo(Collection<E> collection)
collection
- all elements to be added to this collection.boolean contains(E e)
e
- item to be checkedtrue
if exists, false
otherwiseint size()
WriteBehindQueue
.WriteBehindQueue
.void clear()
WriteBehindQueue
Queue will be empty after this method returns.List<E> asList()
void getFrontByTime(long time, Collection<E> collection)
time
- given time.collection
- all found elements will be added to this collection.void getFrontByNumber(int numberOfElements, Collection<E> collection)
numberOfElements
- get this number of elements from the start of this queue.collection
- all found elements will be added to this collection.Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.