Merge branch 'master' into 3.0.0

# Conflicts:
#	redisson/src/main/java/org/redisson/api/RLexSortedSetReactive.java
pull/1933/head
Nikita Koksharov 6 years ago
commit 0dade23726

@ -25,8 +25,19 @@ import java.util.Collection;
*/
public interface RLexSortedSet extends RLexSortedSetAsync, RSortedSet<String>, RExpirable {
/**
* Removes and returns the head element or {@code null} if this sorted set is empty.
*
* @return the head element,
* or {@code null} if this sorted set is empty
*/
String pollFirst();
/**
* Removes and returns the tail element or {@code null} if this sorted set is empty.
*
* @return the tail element or {@code null} if this sorted set is empty
*/
String pollLast();
/**
@ -37,44 +48,210 @@ public interface RLexSortedSet extends RLexSortedSetAsync, RSortedSet<String>, R
*/
Integer revRank(String o);
/**
* Removes tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements removed
*/
int removeRangeTail(String fromElement, boolean fromInclusive);
/**
* Removes head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
int removeRangeHead(String toElement, boolean toInclusive);
/**
* Removes values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
int removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns the number of tail values starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements
*/
int countTail(String fromElement, boolean fromInclusive);
/**
* Returns the number of head values ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
int countHead(String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return collection of elements
*/
Collection<String> rangeTail(String fromElement, boolean fromInclusive);
/**
* Returns head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Collection<String> rangeHead(String toElement, boolean toInclusive);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Collection<String> rangeTail(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Returns head values range ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Collection<String> rangeHead(String toElement, boolean toInclusive, int offset, int count);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Returns tail values range in reverse order starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return collection of elements
*/
Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive);
/**
* Returns head values range in reverse order ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Collection<String> rangeHeadReversed(String toElement, boolean toInclusive);
/**
* Returns values range in reverse order starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Collection<String> rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns tail values range in reverse order starting with <code>fromElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Returns head values range in reverse order ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Collection<String> rangeHeadReversed(String toElement, boolean toInclusive, int offset, int count);
/**
* Returns values range in reverse order starting with <code>fromElement</code> and ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Collection<String> rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Returns the number of elements between <code>fromElement</code> and <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
int count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns rank of the element
*
* @param o - element to rank
* @return rank or <code>null</code> if element does not exist
*/
Integer rank(String o);
/**
* Returns values by rank range. Indexes are zero based.
* <code>-1</code> means the highest score, <code>-2</code> means the second highest score.
*
* @param startIndex - start index
* @param endIndex - end index
* @return collection of elements
*/
Collection<String> range(int startIndex, int endIndex);
}

@ -18,19 +18,40 @@ package org.redisson.api;
import java.util.Collection;
/**
* Sorted set contained values of String type
* Async interface for sorted set contained values of String type.
*
* @author Nikita Koksharov
*
*/
public interface RLexSortedSetAsync extends RCollectionAsync<String> {
/**
* Removes and returns the tail element or {@code null} if this sorted set is empty.
*
* @return the tail element or {@code null} if this sorted set is empty
*/
RFuture<String> pollLastAsync();
/**
* Removes and returns the head element or {@code null} if this sorted set is empty.
*
* @return the head element,
* or {@code null} if this sorted set is empty
*/
RFuture<String> pollFirstAsync();
/**
* Returns the first element.
*
* @return element
*/
RFuture<String> firstAsync();
/**
* Returns the last element.
*
* @return element
*/
RFuture<String> lastAsync();
/**
@ -40,44 +61,210 @@ public interface RLexSortedSetAsync extends RCollectionAsync<String> {
*/
RFuture<Collection<String>> readAllAsync();
/**
* Removes values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
RFuture<Integer> removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Removes tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements removed
*/
RFuture<Integer> removeRangeTailAsync(String fromElement, boolean fromInclusive);
/**
* Removes head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
RFuture<Integer> removeRangeHeadAsync(String toElement, boolean toInclusive);
/**
* Returns the number of tail values starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements
*/
RFuture<Integer> countTailAsync(String fromElement, boolean fromInclusive);
/**
* Returns the number of head values ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
RFuture<Integer> countHeadAsync(String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive);
/**
* Returns head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Returns head values range ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Returns tail values range in reverse order starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive);
/**
* Returns head values range in reverse order ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive);
/**
* Returns values range in reverse order starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns tail values range in reverse order starting with <code>fromElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Returns head values range in reverse order ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive, int offset, int count);
/**
* Returns values range in reverse order starting with <code>fromElement</code> and ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Returns the number of elements between <code>fromElement</code> and <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
RFuture<Integer> countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns rank of the element
*
* @param o - element to rank
* @return rank or <code>null</code> if element does not exist
*/
RFuture<Integer> rankAsync(String o);
/**
* Returns values by rank range. Indexes are zero based.
* <code>-1</code> means the highest score, <code>-2</code> means the second highest score.
*
* @param startIndex - start index
* @param endIndex - end index
* @return collection of elements
*/
RFuture<Collection<String>> rangeAsync(int startIndex, int endIndex);
/**

@ -20,35 +20,134 @@ import java.util.Collection;
import reactor.core.publisher.Mono;
/**
* Reactive interface for LexSortedSet object
* Reactive interface for sorted set contained values of String type.
*
* @author Nikita Koksharov
*
*/
public interface RLexSortedSetReactive extends RScoredSortedSetReactive<String>, RCollectionReactive<String> {
/**
* Removes values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
Mono<Integer> removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Removes tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements removed
*/
Mono<Integer> removeRangeTail(String fromElement, boolean fromInclusive);
/**
* Removes head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
Mono<Integer> removeRangeHead(String toElement, boolean toInclusive);
/**
* Returns the number of tail values starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements
*/
Mono<Integer> countTail(String fromElement, boolean fromInclusive);
/**
* Returns the number of head values ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
Mono<Integer> countHead(String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return collection of elements
*/
Mono<Collection<String>> rangeTail(String fromElement, boolean fromInclusive);
/**
* Returns head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Mono<Collection<String>> rangeHead(String toElement, boolean toInclusive);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Mono<Collection<String>> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Mono<Collection<String>> rangeTail(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Returns head values range ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Mono<Collection<String>> rangeHead(String toElement, boolean toInclusive, int offset, int count);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Mono<Collection<String>> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Returns the number of elements between <code>fromElement</code> and <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
Mono<Integer> count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
}

@ -20,35 +20,134 @@ import java.util.Collection;
import io.reactivex.Flowable;
/**
* RxJava2 interface for LexSortedSet object
* RxJava2 interface for sorted set contained values of String type.
*
* @author Nikita Koksharov
*
*/
public interface RLexSortedSetRx extends RScoredSortedSetRx<String>, RCollectionRx<String> {
/**
* Removes values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
Flowable<Integer> removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Removes tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements removed
*/
Flowable<Integer> removeRangeTail(String fromElement, boolean fromInclusive);
/**
* Removes head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements removed
*/
Flowable<Integer> removeRangeHead(String toElement, boolean toInclusive);
/**
* Returns the number of tail values starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return number of elements
*/
Flowable<Integer> countTail(String fromElement, boolean fromInclusive);
/**
* Returns the number of head values ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
Flowable<Integer> countHead(String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @return collection of elements
*/
Flowable<Collection<String>> rangeTail(String fromElement, boolean fromInclusive);
/**
* Returns head values range ending with <code>toElement</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Flowable<Collection<String>> rangeHead(String toElement, boolean toInclusive);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Flowable<Collection<String>> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Returns tail values range starting with <code>fromElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Flowable<Collection<String>> rangeTail(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Returns head values range ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param toElement - end element
* @param toInclusive - end element inclusive
* @param offset - offset of result collection
* @param count - amount of result collection
* @return collection of elements
*/
Flowable<Collection<String>> rangeHead(String toElement, boolean toInclusive, int offset, int count);
/**
* Returns values range starting with <code>fromElement</code> and ending with <code>toElement</code>.
* Returned collection limited by <code>count</code> and starts with <code>offset</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return collection of elements
*/
Flowable<Collection<String>> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Returns the number of elements between <code>fromElement</code> and <code>toElement</code>.
*
* @param fromElement - start element
* @param fromInclusive - start element inclusive
* @param toElement - end element
* @param toInclusive - end element inclusive
* @return number of elements
*/
Flowable<Integer> count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
}

Loading…
Cancel
Save