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
Distributed implementation of
Deque- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionintAdds elements at the head of deque.intaddFirstIfExists(V... elements) Adds element at the head of existing deque.intAdds elements at the tail of deque.intaddLastIfExists(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, toArrayMethods 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, sizeMethods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsyncMethods 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, removeLastOccurrenceAsyncMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods 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, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RQueue
addListener, poll, pollLastAndOfferFirstTo, readAllMethods 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 bylimitparam.- Returns:
- list of tail elements
-
pollFirst
Retrieves and removes the head elements of this queue. Elements amount limited bylimitparam.- 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
-