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>
,SequencedCollection<V>
- All Known Subinterfaces:
RBlockingDeque<V>
,RPriorityBlockingDeque<V>
,RPriorityDeque<V>
- All Known Implementing Classes:
RedissonBlockingDeque
,RedissonDeque
,RedissonPriorityBlockingDeque
,RedissonPriorityDeque
Distributed implementation of
Deque
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionint
Adds elements at the head of deque.int
addFirstIfExists
(V... elements) Adds element at the head of existing deque.int
Adds elements at the tail of deque.int
addLastIfExists
(V... elements) Adds element at the tail of existing deque.move
(DequeMoveArgs args) Move element from this deque to the given destination deque.pollFirst
(int limit) Retrieves and removes the head elements of this queue.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, reversed, 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, addFirstAsync, addFirstIfExistsAsync, addLastAsync, 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, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, 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 Details
-
addFirstIfExists
Adds element at the head of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addFirst
Adds elements at the head of deque.- Parameters:
elements
- - elements to add- Returns:
- length of the deque
-
addLastIfExists
Adds element at the tail of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addLast
Adds elements at the tail of deque.- Parameters:
elements
- - elements to add- Returns:
- length of the deque
-
pollLast
Retrieves and removes the tail elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of tail elements
-
pollFirst
Retrieves and removes the head elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of head elements
-
move
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
-