Package org.redisson.api
Interface RLexSortedSetAsync
- All Superinterfaces:
RCollectionAsync<String>
,RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RLexSortedSet
- All Known Implementing Classes:
RedissonLexSortedSet
Async interface for sorted set contained values of String type.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddListenerAsync
(ObjectListener listener) Adds object event listenercountAsync
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns the number of elements betweenfromElement
andtoElement
.countHeadAsync
(String toElement, boolean toInclusive) Returns the number of head values ending withtoElement
.countTailAsync
(String fromElement, boolean fromInclusive) Returns the number of tail values starting withfromElement
.Returns the first element.Returns the last element.Removes and returns the head element ornull
if this sorted set is empty.Removes and returns the tail element ornull
if this sorted set is empty.Returns random element from this sorted setrandomAsync
(int count) Returns random elements from this sorted set limited bycount
rangeAsync
(int startIndex, int endIndex) Returns values by rank range.rangeAsync
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns values range starting withfromElement
and ending withtoElement
.rangeAsync
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) Returns values range starting withfromElement
and ending withtoElement
.rangeHeadAsync
(String toElement, boolean toInclusive) Returns head values range ending withtoElement
.rangeHeadAsync
(String toElement, boolean toInclusive, int offset, int count) Returns head values range ending withtoElement
.rangeHeadReversedAsync
(String toElement, boolean toInclusive) Returns head values range in reverse order ending withtoElement
.rangeHeadReversedAsync
(String toElement, boolean toInclusive, int offset, int count) Returns head values range in reverse order ending withtoElement
.rangeReversedAsync
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns values range in reverse order starting withfromElement
and ending withtoElement
.rangeReversedAsync
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) Returns values range in reverse order starting withfromElement
and ending withtoElement
.rangeTailAsync
(String fromElement, boolean fromInclusive) Returns tail values range starting withfromElement
.rangeTailAsync
(String fromElement, boolean fromInclusive, int offset, int count) Returns tail values range starting withfromElement
.rangeTailReversedAsync
(String fromElement, boolean fromInclusive) Returns tail values range in reverse order starting withfromElement
.rangeTailReversedAsync
(String fromElement, boolean fromInclusive, int offset, int count) Returns tail values range in reverse order starting withfromElement
.Returns rank of the elementRead all values at once.removeRangeAsync
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Removes values range starting withfromElement
and ending withtoElement
.removeRangeHeadAsync
(String toElement, boolean toInclusive) Removes head values range ending withtoElement
.removeRangeTailAsync
(String fromElement, boolean fromInclusive) Removes tail values range starting withfromElement
.Returns rank of value, with the scores ordered from high to low.Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
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.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
pollLastAsync
Removes and returns the tail element ornull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
pollFirstAsync
Removes and returns the head element ornull
if this sorted set is empty.- Returns:
- the head element,
or
null
if this sorted set is empty
-
firstAsync
Returns the first element.- Returns:
- element
-
lastAsync
Returns the last element.- Returns:
- element
-
readAllAsync
RFuture<Collection<String>> readAllAsync()Read all values at once.- Returns:
- collection of values
-
removeRangeAsync
RFuture<Integer> removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Removes values range starting withfromElement
and ending withtoElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements removed
-
removeRangeTailAsync
Removes tail values range starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- number of elements removed
-
removeRangeHeadAsync
Removes head values range ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements removed
-
countTailAsync
Returns the number of tail values starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- number of elements
-
countHeadAsync
Returns the number of head values ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements
-
rangeTailAsync
Returns tail values range starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- collection of elements
-
rangeHeadAsync
Returns head values range ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- collection of elements
-
rangeAsync
RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns values range starting withfromElement
and ending withtoElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- collection of elements
-
rangeTailAsync
RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) Returns tail values range starting withfromElement
. Returned collection limited bycount
and starts withoffset
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusiveoffset
- - offset of result collectioncount
- - amount of result collection- Returns:
- collection of elements
-
rangeHeadAsync
RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) Returns head values range ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - amount of result collection- Returns:
- collection of elements
-
rangeAsync
RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) Returns values range starting withfromElement
and ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - amount of result collection- Returns:
- collection of elements
-
rangeTailReversedAsync
Returns tail values range in reverse order starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- collection of elements
-
rangeHeadReversedAsync
Returns head values range in reverse order ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- collection of elements
-
rangeReversedAsync
RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns values range in reverse order starting withfromElement
and ending withtoElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- collection of elements
-
rangeTailReversedAsync
RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive, int offset, int count) Returns tail values range in reverse order starting withfromElement
. Returned collection limited bycount
and starts withoffset
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusiveoffset
- - offset of result collectioncount
- - amount of result collection- Returns:
- collection of elements
-
rangeHeadReversedAsync
RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive, int offset, int count) Returns head values range in reverse order ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - amount of result collection- Returns:
- collection of elements
-
rangeReversedAsync
RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) Returns values range in reverse order starting withfromElement
and ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - amount of result collection- Returns:
- collection of elements
-
countAsync
RFuture<Integer> countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns the number of elements betweenfromElement
andtoElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements
-
rankAsync
Returns rank of the element- Parameters:
o
- - element to rank- Returns:
- rank or
null
if element does not exist
-
rangeAsync
Returns values by rank range. Indexes are zero based.-1
means the highest score,-2
means the second highest score.- Parameters:
startIndex
- - start indexendIndex
- - end index- Returns:
- collection of elements
-
revRankAsync
Returns rank of value, with the scores ordered from high to low.- Parameters:
o
- - value- Returns:
- rank or
null
if value does not exist
-
randomAsync
Returns random element from this sorted setRequires Redis 6.2.0 and higher.
- Returns:
- value
-
randomAsync
Returns random elements from this sorted set limited bycount
Requires Redis 6.2.0 and higher.
- Parameters:
count
- - values amount to return- Returns:
- value
-
addListenerAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Parameters:
listener
- object event listener- Returns:
- listener id
- See Also:
-