|
|
|
@ -16,7 +16,7 @@
|
|
|
|
|
package org.redisson.api;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@link java.util.Deque} backed by Redis
|
|
|
|
|
* Distributed async implementation of {@link java.util.Deque}
|
|
|
|
|
*
|
|
|
|
|
* @author Nikita Koksharov
|
|
|
|
|
*
|
|
|
|
@ -24,34 +24,124 @@ package org.redisson.api;
|
|
|
|
|
*/
|
|
|
|
|
public interface RDequeAsync<V> extends RQueueAsync<V> {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Removes last occurrence of element <code>o</code>
|
|
|
|
|
*
|
|
|
|
|
* @param o - element
|
|
|
|
|
* @return <code>true</code> if object has been removed otherwise <code>false</code>
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Boolean> removeLastOccurrenceAsync(Object o);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieves and removes the last element of deque.
|
|
|
|
|
* Returns <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> removeLastAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieves and removes the first element of deque.
|
|
|
|
|
* Returns <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> removeFirstAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Removes first occurrence of element <code>o</code>
|
|
|
|
|
*
|
|
|
|
|
* @param o - element to remove
|
|
|
|
|
* @return <code>true</code> if object has been removed otherwise <code>false</code>
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Boolean> removeFirstOccurrenceAsync(Object o);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds element at the head of this deque.
|
|
|
|
|
*
|
|
|
|
|
* @param e - element to add
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Void> pushAsync(V e);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieves and removes element at the head of this deque.
|
|
|
|
|
* Returns <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> popAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieves and removes element at the tail of this deque.
|
|
|
|
|
* Returns <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> pollLastAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieves and removes element at the head of this deque.
|
|
|
|
|
* Returns <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> pollFirstAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns element at the tail of this deque
|
|
|
|
|
* or <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> peekLastAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns element at the head of this deque
|
|
|
|
|
* or <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> peekFirstAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds element at the tail of this deque.
|
|
|
|
|
*
|
|
|
|
|
* @param e - element to add
|
|
|
|
|
* @return <code>true</code> if element was added to this deque otherwise <code>false</code>
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Boolean> offerLastAsync(V e);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns element at the tail of this deque
|
|
|
|
|
* or <code>null</code> if there are no elements in deque.
|
|
|
|
|
*
|
|
|
|
|
* @return element
|
|
|
|
|
*/
|
|
|
|
|
RFuture<V> getLastAsync();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds element at the tail of this deque.
|
|
|
|
|
*
|
|
|
|
|
* @param e - element to add
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Void> addLastAsync(V e);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds element at the head of this deque.
|
|
|
|
|
*
|
|
|
|
|
* @param e - element to add
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Void> addFirstAsync(V e);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds element at the head of this deque.
|
|
|
|
|
*
|
|
|
|
|
* @param e - element to add
|
|
|
|
|
* @return <code>true</code> if element was added to this deque otherwise <code>false</code>
|
|
|
|
|
*/
|
|
|
|
|
RFuture<Boolean> offerFirstAsync(V e);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|