Package org.redisson.api
Interface RLexSortedSet
- All Superinterfaces:
Collection<String>
,Iterable<String>
,RCollectionAsync<String>
,RExpirable
,RExpirableAsync
,RLexSortedSetAsync
,RObject
,RObjectAsync
,RSortedSet<String>
,Set<String>
,SortedSet<String>
- All Known Implementing Classes:
RedissonLexSortedSet
Sorted set contained values of String type
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of elements betweenfromElement
andtoElement
.int
Returns the number of head values ending withtoElement
.int
Returns the number of tail values starting withfromElement
.Removes and returns the head element ornull
if this sorted set is empty.pollLast()
Removes and returns the tail element ornull
if this sorted set is empty.range
(int startIndex, int endIndex) Returns values by rank range.Returns values range starting withfromElement
and ending withtoElement
.range
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) Returns values range starting withfromElement
and ending withtoElement
.Returns head values range ending withtoElement
.Returns head values range ending withtoElement
.rangeHeadReversed
(String toElement, boolean toInclusive) Returns head values range in reverse order ending withtoElement
.rangeHeadReversed
(String toElement, boolean toInclusive, int offset, int count) Returns head values range in reverse order ending withtoElement
.rangeReversed
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Returns values range in reverse order starting withfromElement
and ending withtoElement
.rangeReversed
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) Returns values range in reverse order starting withfromElement
and ending withtoElement
.Returns tail values range starting withfromElement
.Returns tail values range starting withfromElement
.rangeTailReversed
(String fromElement, boolean fromInclusive) Returns tail values range in reverse order starting withfromElement
.rangeTailReversed
(String fromElement, boolean fromInclusive, int offset, int count) Returns tail values range in reverse order starting withfromElement
.Returns rank of the elementint
removeRange
(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) Removes values range starting withfromElement
and ending withtoElement
.int
removeRangeHead
(String toElement, boolean toInclusive) Removes head values range ending withtoElement
.int
removeRangeTail
(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 java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
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.RLexSortedSetAsync
countAsync, countHeadAsync, countTailAsync, firstAsync, lastAsync, pollFirstAsync, pollLastAsync, rangeAsync, rangeAsync, rangeAsync, rangeHeadAsync, rangeHeadAsync, rangeHeadReversedAsync, rangeHeadReversedAsync, rangeReversedAsync, rangeReversedAsync, rangeTailAsync, rangeTailAsync, rangeTailReversedAsync, rangeTailReversedAsync, rankAsync, readAllAsync, removeRangeAsync, removeRangeHeadAsync, removeRangeTailAsync, revRankAsync
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
Methods inherited from interface org.redisson.api.RSortedSet
addAsync, distributedIterator, distributedIterator, mapReduce, readAll, readAllAsync, removeAsync, trySetComparator
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
Methods inherited from interface java.util.SortedSet
comparator, first, headSet, last, spliterator, subSet, tailSet
-
Method Details
-
pollFirst
String pollFirst()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
-
pollLast
String pollLast()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
-
revRank
Returns rank of value, with the scores ordered from high to low.- Parameters:
o
- - object- Returns:
- rank or
null
if value does not exist
-
removeRangeTail
Removes tail values range starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- number of elements removed
-
removeRangeHead
Removes head values range ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements removed
-
removeRange
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
-
countTail
Returns the number of tail values starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- number of elements
-
countHead
Returns the number of head values ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements
-
rangeTail
Returns tail values range starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- collection of elements
-
rangeHead
Returns head values range ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- collection of elements
-
range
Collection<String> range(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
-
rangeTail
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
-
rangeHead
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
-
range
Collection<String> range(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
-
rangeTailReversed
Returns tail values range in reverse order starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- collection of elements
-
rangeHeadReversed
Returns head values range in reverse order ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- collection of elements
-
rangeReversed
Collection<String> rangeReversed(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
-
rangeTailReversed
Collection<String> rangeTailReversed(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
-
rangeHeadReversed
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
-
rangeReversed
Collection<String> rangeReversed(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
-
count
Returns the number of elements betweenfromElement
andtoElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements
-
rank
Returns rank of the element- Parameters:
o
- - element to rank- Returns:
- rank or
null
if element does not exist
-
range
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
-