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
public interface RLexSortedSet extends RLexSortedSetAsync, RSortedSet<String>, RExpirable
Sorted set contained values of String type- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns the number of elements betweenfromElement
andtoElement
.int
countHead(String toElement, boolean toInclusive)
Returns the number of head values ending withtoElement
.int
countTail(String fromElement, boolean fromInclusive)
Returns the number of tail values starting withfromElement
.String
pollFirst()
Removes and returns the head element ornull
if this sorted set is empty.String
pollLast()
Removes and returns the tail element ornull
if this sorted set is empty.Collection<String>
range(int startIndex, int endIndex)
Returns values by rank range.Collection<String>
range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns values range starting withfromElement
and ending withtoElement
.Collection<String>
range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Returns values range starting withfromElement
and ending withtoElement
.Collection<String>
rangeHead(String toElement, boolean toInclusive)
Returns head values range ending withtoElement
.Collection<String>
rangeHead(String toElement, boolean toInclusive, int offset, int count)
Returns head values range ending withtoElement
.Collection<String>
rangeHeadReversed(String toElement, boolean toInclusive)
Returns head values range in reverse order ending withtoElement
.Collection<String>
rangeHeadReversed(String toElement, boolean toInclusive, int offset, int count)
Returns head values range in reverse order ending withtoElement
.Collection<String>
rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns values range in reverse order starting withfromElement
and ending withtoElement
.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
.Collection<String>
rangeTail(String fromElement, boolean fromInclusive)
Returns tail values range starting withfromElement
.Collection<String>
rangeTail(String fromElement, boolean fromInclusive, int offset, int count)
Returns tail values range starting withfromElement
.Collection<String>
rangeTailReversed(String fromElement, boolean fromInclusive)
Returns tail values range in reverse order starting withfromElement
.Collection<String>
rangeTailReversed(String fromElement, boolean fromInclusive, int offset, int count)
Returns tail values range in reverse order starting withfromElement
.Integer
rank(String o)
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
.Integer
revRank(String o)
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, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, 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, 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 Detail
-
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
Integer revRank(String o)
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
int removeRangeTail(String fromElement, boolean fromInclusive)
Removes tail values range starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- number of elements removed
-
removeRangeHead
int removeRangeHead(String toElement, boolean toInclusive)
Removes head values range ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements removed
-
removeRange
int removeRange(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
-
countTail
int countTail(String fromElement, boolean fromInclusive)
Returns the number of tail values starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- number of elements
-
countHead
int countHead(String toElement, boolean toInclusive)
Returns the number of head values ending withtoElement
.- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusive- Returns:
- number of elements
-
rangeTail
Collection<String> rangeTail(String fromElement, boolean fromInclusive)
Returns tail values range starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- collection of elements
-
rangeHead
Collection<String> rangeHead(String toElement, boolean toInclusive)
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
Collection<String> rangeTail(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
-
rangeHead
Collection<String> rangeHead(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
-
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
Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive)
Returns tail values range in reverse order starting withfromElement
.- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusive- Returns:
- collection of elements
-
rangeHeadReversed
Collection<String> rangeHeadReversed(String toElement, boolean toInclusive)
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
Collection<String> rangeHeadReversed(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
-
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
int count(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
-
rank
Integer rank(String o)
Returns rank of the element- Parameters:
o
- - element to rank- Returns:
- rank or
null
if element does not exist
-
range
Collection<String> range(int startIndex, int endIndex)
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
-
-