Package org.redisson.api
Interface RDeque<V>
-
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
Collection<V>
,Deque<V>
,Iterable<V>
,Queue<V>
,RCollectionAsync<V>
,RDequeAsync<V>
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RQueue<V>
,RQueueAsync<V>
- All Known Subinterfaces:
RBlockingDeque<V>
,RPriorityBlockingDeque<V>
,RPriorityDeque<V>
- All Known Implementing Classes:
RedissonBlockingDeque
,RedissonDeque
,RedissonPriorityBlockingDeque
,RedissonPriorityDeque
public interface RDeque<V> extends Deque<V>, RQueue<V>, RDequeAsync<V>
Distributed implementation ofDeque
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
addFirstIfExists(V... elements)
Adds element at the head of existing deque.int
addLastIfExists(V... elements)
Adds element at the tail of existing deque.V
move(DequeMoveArgs args)
Move element from this deque to the given destination deque.List<V>
pollFirst(int limit)
Retrieves and removes the head elements of this queue.List<V>
pollLast(int limit)
Retrieves and removes the tail elements of this queue.-
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface java.util.Deque
add, addAll, addFirst, addLast, contains, descendingIterator, element, getFirst, getLast, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size
-
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RDequeAsync
addFirstAsync, addFirstIfExistsAsync, addLastAsync, addLastIfExistsAsync, getLastAsync, moveAsync, offerFirstAsync, offerLastAsync, peekFirstAsync, peekLastAsync, pollFirstAsync, pollFirstAsync, pollLastAsync, pollLastAsync, popAsync, pushAsync, removeFirstAsync, removeFirstOccurrenceAsync, removeLastAsync, removeLastOccurrenceAsync
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RQueue
addListener, poll, pollLastAndOfferFirstTo, readAll
-
Methods inherited from interface org.redisson.api.RQueueAsync
addListenerAsync, offerAsync, peekAsync, pollAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
-
-
-
Method Detail
-
addFirstIfExists
int addFirstIfExists(V... elements)
Adds element at the head of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addLastIfExists
int addLastIfExists(V... elements)
Adds element at the tail of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
pollLast
List<V> pollLast(int limit)
Retrieves and removes the tail elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of tail elements
-
pollFirst
List<V> pollFirst(int limit)
Retrieves and removes the head elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of head elements
-
move
V move(DequeMoveArgs args)
Move element from this deque to the given destination deque. Returns moved element.Usage examples:
V element = deque.move(DequeMoveArgs.pollLast() .addFirstTo("deque2"));
V elements = deque.move(DequeMoveArgs.pollFirst() .addLastTo("deque2"));
Requires Redis 6.2.0 and higher.
- Parameters:
args
- - arguments object- Returns:
- moved element
-
-