Package org.redisson.api
Interface RDequeRx<V>
-
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
RCollectionRx<V>
,RExpirableRx
,RObjectRx
,RQueueRx<V>
- All Known Subinterfaces:
RBlockingDequeRx<V>
public interface RDequeRx<V> extends RQueueRx<V>
RxJava2 interface for Deque object- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Completable
addFirst(V e)
Adds element at the head of this deque.io.reactivex.rxjava3.core.Single<Integer>
addFirst(V... elements)
Adds elements at the head of deque.io.reactivex.rxjava3.core.Single<Integer>
addFirstIfExists(V... elements)
Adds element at the head of existing deque.io.reactivex.rxjava3.core.Completable
addLast(V e)
Adds element at the tail of this deque.io.reactivex.rxjava3.core.Single<Integer>
addLast(V... elements)
Adds elements at the tail of deque.io.reactivex.rxjava3.core.Single<Integer>
addLastIfExists(V... elements)
Adds element at the tail of existing deque.io.reactivex.rxjava3.core.Flowable<V>
descendingIterator()
io.reactivex.rxjava3.core.Maybe<V>
getLast()
Returns element at the tail of this deque ornull
if there are no elements in deque.io.reactivex.rxjava3.core.Maybe<V>
move(DequeMoveArgs args)
Move element from this deque to the given destination deque.io.reactivex.rxjava3.core.Single<Boolean>
offerFirst(V e)
Adds element at the head of this deque.io.reactivex.rxjava3.core.Single<Boolean>
offerLast(V e)
Adds element at the tail of this deque.io.reactivex.rxjava3.core.Maybe<V>
peekFirst()
Returns element at the head of this deque ornull
if there are no elements in deque.io.reactivex.rxjava3.core.Maybe<V>
peekLast()
Returns element at the tail of this deque ornull
if there are no elements in deque.io.reactivex.rxjava3.core.Maybe<V>
pollFirst()
Retrieves and removes element at the head of this deque.io.reactivex.rxjava3.core.Flowable<V>
pollFirst(int limit)
Retrieves and removes the head elements of this queue.io.reactivex.rxjava3.core.Maybe<V>
pollLast()
Retrieves and removes element at the tail of this deque.io.reactivex.rxjava3.core.Flowable<V>
pollLast(int limit)
Retrieves and removes the tail elements of this queue.io.reactivex.rxjava3.core.Maybe<V>
pop()
Retrieves and removes element at the head of this deque.io.reactivex.rxjava3.core.Completable
push(V e)
Adds element at the head of this deque.io.reactivex.rxjava3.core.Maybe<V>
removeFirst()
Retrieves and removes the first element of deque.io.reactivex.rxjava3.core.Single<Boolean>
removeFirstOccurrence(Object o)
Removes first occurrence of elemento
io.reactivex.rxjava3.core.Maybe<V>
removeLast()
Retrieves and removes the last element of deque.io.reactivex.rxjava3.core.Single<Boolean>
removeLastOccurrence(Object o)
Removes last occurrence of elemento
-
Methods inherited from interface org.redisson.api.RCollectionRx
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
-
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
addFirstIfExists
io.reactivex.rxjava3.core.Single<Integer> addFirstIfExists(V... elements)
Adds element at the head of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addLastIfExists
io.reactivex.rxjava3.core.Single<Integer> addLastIfExists(V... elements)
Adds element at the tail of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addFirst
io.reactivex.rxjava3.core.Single<Integer> addFirst(V... elements)
Adds elements at the head of deque.- Parameters:
elements
- - elements to add- Returns:
- length of the deque
-
addLast
io.reactivex.rxjava3.core.Single<Integer> addLast(V... elements)
Adds elements at the tail of deque.- Parameters:
elements
- - elements to add- Returns:
- length of the deque
-
descendingIterator
io.reactivex.rxjava3.core.Flowable<V> descendingIterator()
-
removeLastOccurrence
io.reactivex.rxjava3.core.Single<Boolean> removeLastOccurrence(Object o)
Removes last occurrence of elemento
- Parameters:
o
- - element- Returns:
true
if object has been removed otherwisefalse
-
removeLast
io.reactivex.rxjava3.core.Maybe<V> removeLast()
Retrieves and removes the last element of deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
removeFirst
io.reactivex.rxjava3.core.Maybe<V> removeFirst()
Retrieves and removes the first element of deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
removeFirstOccurrence
io.reactivex.rxjava3.core.Single<Boolean> removeFirstOccurrence(Object o)
Removes first occurrence of elemento
- Parameters:
o
- - element to remove- Returns:
true
if object has been removed otherwisefalse
-
push
io.reactivex.rxjava3.core.Completable push(V e)
Adds element at the head of this deque.- Parameters:
e
- - element to add- Returns:
- void
-
pop
io.reactivex.rxjava3.core.Maybe<V> pop()
Retrieves and removes element at the head of this deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
pollLast
io.reactivex.rxjava3.core.Maybe<V> pollLast()
Retrieves and removes element at the tail of this deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
pollFirst
io.reactivex.rxjava3.core.Maybe<V> pollFirst()
Retrieves and removes element at the head of this deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
pollLast
io.reactivex.rxjava3.core.Flowable<V> pollLast(int limit)
Retrieves and removes the tail elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of tail elements
-
pollFirst
io.reactivex.rxjava3.core.Flowable<V> pollFirst(int limit)
Retrieves and removes the head elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of head elements
-
peekLast
io.reactivex.rxjava3.core.Maybe<V> peekLast()
Returns element at the tail of this deque ornull
if there are no elements in deque.- Returns:
- element
-
peekFirst
io.reactivex.rxjava3.core.Maybe<V> peekFirst()
Returns element at the head of this deque ornull
if there are no elements in deque.- Returns:
- element
-
offerLast
io.reactivex.rxjava3.core.Single<Boolean> offerLast(V e)
Adds element at the tail of this deque.- Parameters:
e
- - element to add- Returns:
true
if element was added to this deque otherwisefalse
-
getLast
io.reactivex.rxjava3.core.Maybe<V> getLast()
Returns element at the tail of this deque ornull
if there are no elements in deque.- Returns:
- element
-
addLast
io.reactivex.rxjava3.core.Completable addLast(V e)
Adds element at the tail of this deque.- Parameters:
e
- - element to add- Returns:
- void
-
addFirst
io.reactivex.rxjava3.core.Completable addFirst(V e)
Adds element at the head of this deque.- Parameters:
e
- - element to add- Returns:
- void
-
offerFirst
io.reactivex.rxjava3.core.Single<Boolean> offerFirst(V e)
Adds element at the head of this deque.- Parameters:
e
- - element to add- Returns:
true
if element was added to this deque otherwisefalse
-
move
io.reactivex.rxjava3.core.Maybe<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
-
-