Package org.redisson
Class RedissonLexSortedSet
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonScoredSortedSet<String>
-
- org.redisson.RedissonLexSortedSet
-
- All Implemented Interfaces:
Iterable<String>
,Collection<String>
,Set<String>
,SortedSet<String>
,RCollectionAsync<String>
,RExpirable
,RExpirableAsync
,RLexSortedSet
,RLexSortedSetAsync
,RObject
,RObjectAsync
,RScoredSortedSet<String>
,RScoredSortedSetAsync<String>
,RSortable<Set<String>>
,RSortableAsync<Set<String>>
,RSortedSet<String>
public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implements RLexSortedSet
Sorted set contained values of String type- Author:
- Nikita Koksharov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.redisson.api.RScoredSortedSet
RScoredSortedSet.Aggregate
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor
-
-
Constructor Summary
Constructors Constructor Description RedissonLexSortedSet(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(String e)
boolean
addAll(Collection<? extends String> c)
RFuture<Boolean>
addAllAsync(Collection<? extends String> c)
Adds all elements contained in the specified collectionRFuture<Boolean>
addAsync(String e)
Adds element into this collection.boolean
clearExpire()
Clear an expire timeout or expire date for object.RFuture<Boolean>
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.Comparator<? super String>
comparator()
int
count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
RFuture<Integer>
countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
int
countHead(String toElement, boolean toInclusive)
RFuture<Integer>
countHeadAsync(String toElement, boolean toInclusive)
int
countTail(String fromElement, boolean fromInclusive)
RFuture<Integer>
countTailAsync(String fromElement, boolean fromInclusive)
boolean
expire(long timeToLive, TimeUnit timeUnit)
Set a timeout for object.RFuture<Boolean>
expireAsync(long timeToLive, TimeUnit timeUnit)
Set a timeout for object in async mode.boolean
expireAt(long timestamp)
Set an expire date for object.boolean
expireAt(Date timestamp)
Set an expire date for object.RFuture<Boolean>
expireAtAsync(long timestamp)
Set an expire date for object in async mode.RFuture<Boolean>
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.SortedSet<String>
headSet(String toElement)
Collection<String>
range(int startIndex, int endIndex)
Collection<String>
range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Collection<String>
range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
RFuture<Collection<String>>
rangeAsync(int startIndex, int endIndex)
RFuture<Collection<String>>
rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
RFuture<Collection<String>>
rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Collection<String>
rangeHead(String toElement, boolean toInclusive)
Collection<String>
rangeHead(String toElement, boolean toInclusive, int offset, int count)
RFuture<Collection<String>>
rangeHeadAsync(String toElement, boolean toInclusive)
RFuture<Collection<String>>
rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count)
Collection<String>
rangeHeadReversed(String toElement, boolean toInclusive)
Collection<String>
rangeHeadReversed(String toElement, boolean toInclusive, int offset, int count)
RFuture<Collection<String>>
rangeHeadReversedAsync(String toElement, boolean toInclusive)
RFuture<Collection<String>>
rangeHeadReversedAsync(String toElement, boolean toInclusive, int offset, int count)
Collection<String>
rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Collection<String>
rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
RFuture<Collection<String>>
rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
RFuture<Collection<String>>
rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Collection<String>
rangeTail(String fromElement, boolean fromInclusive)
Collection<String>
rangeTail(String fromElement, boolean fromInclusive, int offset, int count)
RFuture<Collection<String>>
rangeTailAsync(String fromElement, boolean fromInclusive)
RFuture<Collection<String>>
rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count)
Collection<String>
rangeTailReversed(String fromElement, boolean fromInclusive)
Collection<String>
rangeTailReversed(String fromElement, boolean fromInclusive, int offset, int count)
RFuture<Collection<String>>
rangeTailReversedAsync(String fromElement, boolean fromInclusive)
RFuture<Collection<String>>
rangeTailReversedAsync(String fromElement, boolean fromInclusive, int offset, int count)
long
remainTimeToLive()
Remaining time to live of Redisson object that has a timeoutRFuture<Long>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeoutint
removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
RFuture<Integer>
removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
int
removeRangeHead(String toElement, boolean toInclusive)
RFuture<Integer>
removeRangeHeadAsync(String toElement, boolean toInclusive)
int
removeRangeTail(String fromElement, boolean fromInclusive)
RFuture<Integer>
removeRangeTailAsync(String fromElement, boolean fromInclusive)
SortedSet<String>
subSet(String fromElement, String toElement)
SortedSet<String>
tailSet(String fromElement)
boolean
trySetComparator(Comparator<? super String> comparator)
Sets new comparator only if current set is empty-
Methods inherited from class org.redisson.RedissonScoredSortedSet
add, addAll, addAllAsync, addAndGetRank, addAndGetRankAsync, addAndGetRevRank, addAndGetRevRankAsync, addAsync, addScore, addScoreAndGetRank, addScoreAndGetRankAsync, addScoreAndGetRevRank, addScoreAndGetRevRankAsync, addScoreAsync, clear, contains, containsAll, containsAllAsync, containsAsync, count, countAsync, entryRange, entryRange, entryRange, entryRangeAsync, entryRangeAsync, entryRangeAsync, entryRangeReversed, entryRangeReversed, entryRangeReversed, entryRangeReversedAsync, entryRangeReversedAsync, entryRangeReversedAsync, first, firstAsync, firstScore, firstScoreAsync, getScore, getScoreAsync, intersection, intersection, intersection, intersection, intersectionAsync, intersectionAsync, intersectionAsync, intersectionAsync, isEmpty, iterator, iterator, iterator, iterator, last, lastAsync, lastScore, lastScoreAsync, mapReduce, pollFirst, pollFirst, pollFirst, pollFirstAsync, pollFirstAsync, pollFirstAsync, pollFirstFromAny, pollFirstFromAnyAsync, pollLast, pollLast, pollLast, pollLastAsync, pollLastAsync, pollLastAsync, pollLastFromAny, pollLastFromAnyAsync, rank, rankAsync, readAll, readAllAsync, readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, remove, removeAll, removeAllAsync, removeAsync, removeRangeByRank, removeRangeByRankAsync, removeRangeByScore, removeRangeByScoreAsync, retainAll, retainAllAsync, revRank, revRankAsync, scanIteratorAsync, size, sizeAsync, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, toArray, toArray, tryAdd, tryAddAsync, union, union, union, union, unionAsync, unionAsync, unionAsync, unionAsync, valueRange, valueRange, valueRange, valueRangeAsync, valueRangeAsync, valueRangeAsync, valueRangeReversed, valueRangeReversed, valueRangeReversed, valueRangeReversedAsync, valueRangeReversedAsync, valueRangeReversedAsync
-
Methods inherited from class org.redisson.RedissonObject
await, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, suffixName, toSeconds, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.redisson.api.RCollectionAsync
containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RLexSortedSet
pollFirst, pollLast, rank, revRank
-
Methods inherited from interface org.redisson.api.RLexSortedSetAsync
firstAsync, lastAsync, pollFirstAsync, pollLastAsync, rankAsync, readAllAsync, revRankAsync
-
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RSortedSet
mapReduce, readAll, readAllAsync, removeAsync
-
Methods inherited from interface java.util.Set
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
first, last, spliterator
-
-
-
-
Constructor Detail
-
RedissonLexSortedSet
public RedissonLexSortedSet(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
-
Method Detail
-
removeRange
public int removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
removeRange
in interfaceRLexSortedSet
-
removeRangeHead
public int removeRangeHead(String toElement, boolean toInclusive)
- Specified by:
removeRangeHead
in interfaceRLexSortedSet
-
removeRangeHeadAsync
public RFuture<Integer> removeRangeHeadAsync(String toElement, boolean toInclusive)
- Specified by:
removeRangeHeadAsync
in interfaceRLexSortedSetAsync
-
removeRangeTail
public int removeRangeTail(String fromElement, boolean fromInclusive)
- Specified by:
removeRangeTail
in interfaceRLexSortedSet
-
removeRangeTailAsync
public RFuture<Integer> removeRangeTailAsync(String fromElement, boolean fromInclusive)
- Specified by:
removeRangeTailAsync
in interfaceRLexSortedSetAsync
-
removeRangeAsync
public RFuture<Integer> removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
removeRangeAsync
in interfaceRLexSortedSetAsync
-
range
public Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
range
in interfaceRLexSortedSet
-
rangeHead
public Collection<String> rangeHead(String toElement, boolean toInclusive)
- Specified by:
rangeHead
in interfaceRLexSortedSet
-
rangeHeadAsync
public RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive)
- Specified by:
rangeHeadAsync
in interfaceRLexSortedSetAsync
-
rangeTail
public Collection<String> rangeTail(String fromElement, boolean fromInclusive)
- Specified by:
rangeTail
in interfaceRLexSortedSet
-
rangeTailAsync
public RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive)
- Specified by:
rangeTailAsync
in interfaceRLexSortedSetAsync
-
rangeAsync
public RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
rangeAsync
in interfaceRLexSortedSetAsync
-
range
public Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
- Specified by:
range
in interfaceRLexSortedSet
-
rangeHead
public Collection<String> rangeHead(String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeHead
in interfaceRLexSortedSet
-
rangeHeadAsync
public RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeHeadAsync
in interfaceRLexSortedSetAsync
-
rangeTail
public Collection<String> rangeTail(String fromElement, boolean fromInclusive, int offset, int count)
- Specified by:
rangeTail
in interfaceRLexSortedSet
-
rangeTailAsync
public RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count)
- Specified by:
rangeTailAsync
in interfaceRLexSortedSetAsync
-
rangeAsync
public RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeAsync
in interfaceRLexSortedSetAsync
-
rangeTailReversed
public Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive)
- Specified by:
rangeTailReversed
in interfaceRLexSortedSet
-
rangeHeadReversed
public Collection<String> rangeHeadReversed(String toElement, boolean toInclusive)
- Specified by:
rangeHeadReversed
in interfaceRLexSortedSet
-
rangeReversed
public Collection<String> rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
rangeReversed
in interfaceRLexSortedSet
-
rangeTailReversed
public Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive, int offset, int count)
- Specified by:
rangeTailReversed
in interfaceRLexSortedSet
-
rangeHeadReversed
public Collection<String> rangeHeadReversed(String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeHeadReversed
in interfaceRLexSortedSet
-
rangeReversed
public Collection<String> rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeReversed
in interfaceRLexSortedSet
-
rangeTailReversedAsync
public RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive)
- Specified by:
rangeTailReversedAsync
in interfaceRLexSortedSetAsync
-
rangeHeadReversedAsync
public RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive)
- Specified by:
rangeHeadReversedAsync
in interfaceRLexSortedSetAsync
-
rangeReversedAsync
public RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
rangeReversedAsync
in interfaceRLexSortedSetAsync
-
rangeTailReversedAsync
public RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive, int offset, int count)
- Specified by:
rangeTailReversedAsync
in interfaceRLexSortedSetAsync
-
rangeHeadReversedAsync
public RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeHeadReversedAsync
in interfaceRLexSortedSetAsync
-
rangeReversedAsync
public RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
- Specified by:
rangeReversedAsync
in interfaceRLexSortedSetAsync
-
countTail
public int countTail(String fromElement, boolean fromInclusive)
- Specified by:
countTail
in interfaceRLexSortedSet
-
countTailAsync
public RFuture<Integer> countTailAsync(String fromElement, boolean fromInclusive)
- Specified by:
countTailAsync
in interfaceRLexSortedSetAsync
-
countHead
public int countHead(String toElement, boolean toInclusive)
- Specified by:
countHead
in interfaceRLexSortedSet
-
countHeadAsync
public RFuture<Integer> countHeadAsync(String toElement, boolean toInclusive)
- Specified by:
countHeadAsync
in interfaceRLexSortedSetAsync
-
count
public int count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
count
in interfaceRLexSortedSet
-
countAsync
public RFuture<Integer> countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
- Specified by:
countAsync
in interfaceRLexSortedSetAsync
-
addAsync
public RFuture<Boolean> addAsync(String e)
Description copied from interface:RCollectionAsync
Adds element into this collection.- Specified by:
addAsync
in interfaceRCollectionAsync<String>
- Specified by:
addAsync
in interfaceRSortedSet<String>
- Parameters:
e
- - element to add- Returns:
true
if an element was added andfalse
if it is already present
-
addAllAsync
public RFuture<Boolean> addAllAsync(Collection<? extends String> c)
Description copied from interface:RCollectionAsync
Adds all elements contained in the specified collection- Specified by:
addAllAsync
in interfaceRCollectionAsync<String>
- Parameters:
c
- - collection of elements to add- Returns:
true
if at least one element was added andfalse
if all elements are already present
-
add
public boolean add(String e)
-
addAll
public boolean addAll(Collection<? extends String> c)
-
range
public Collection<String> range(int startIndex, int endIndex)
- Specified by:
range
in interfaceRLexSortedSet
-
rangeAsync
public RFuture<Collection<String>> rangeAsync(int startIndex, int endIndex)
- Specified by:
rangeAsync
in interfaceRLexSortedSetAsync
-
trySetComparator
public boolean trySetComparator(Comparator<? super String> comparator)
Description copied from interface:RSortedSet
Sets new comparator only if current set is empty- Specified by:
trySetComparator
in interfaceRSortedSet<String>
- Parameters:
comparator
- for values- Returns:
true
if new comparator settedfalse
otherwise
-
comparator
public Comparator<? super String> comparator()
- Specified by:
comparator
in interfaceSortedSet<String>
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirable
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsync
Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsync
Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsync
Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
-