V
- valueIterable<V>
, RExpirable
, RExpirableAsync
, RObject
, RObjectAsync
, RScoredSortedSetAsync<V>
, RSortable<Set<V>>
, RSortableAsync<Set<V>>
RGeo<V>
RedissonGeo
, RedissonLexSortedSet
, RedissonScoredSortedSet
public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable<V>, RExpirable, RSortable<Set<V>>
Modifier and Type | Interface | Description |
---|---|---|
static class |
RScoredSortedSet.Aggregate |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(double score,
V object) |
Adds element to this set, overrides previous score if it has been already added.
|
Long |
addAll(Map<V,Double> objects) |
|
Integer |
addAndGetRank(double score,
V object) |
Adds element to this set, overrides previous score if it has been already added.
|
Integer |
addAndGetRevRank(double score,
V object) |
Adds element to this set, overrides previous score if it has been already added.
|
Double |
addScore(V object,
Number value) |
|
Integer |
addScoreAndGetRank(V object,
Number value) |
Adds score to element and returns its rank
|
Integer |
addScoreAndGetRevRank(V object,
Number value) |
Adds score to element and returns its reverse rank
|
void |
clear() |
|
boolean |
contains(Object o) |
|
boolean |
containsAll(Collection<?> c) |
|
Long |
count(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive) |
Returns the number of elements with a score between
startScore and endScore . |
Collection<ScoredEntry<V>> |
entryRange(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive) |
|
Collection<ScoredEntry<V>> |
entryRange(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive,
int offset,
int count) |
|
Collection<ScoredEntry<V>> |
entryRange(int startIndex,
int endIndex) |
|
Collection<ScoredEntry<V>> |
entryRangeReversed(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive) |
|
Collection<ScoredEntry<V>> |
entryRangeReversed(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive,
int offset,
int count) |
|
Collection<ScoredEntry<V>> |
entryRangeReversed(int startIndex,
int endIndex) |
|
V |
first() |
Returns the head element or
null if this sorted set is empty. |
Double |
firstScore() |
Returns score of the tail element or returns
null if this sorted set is empty. |
Double |
getScore(V o) |
Returns score of element or
null if it doesn't exist. |
int |
intersection(String... names) |
Intersect provided ScoredSortedSets
and store result to current ScoredSortedSet
|
int |
intersection(Map<String,Double> nameWithWeight) |
Intersect provided ScoredSortedSets mapped to weight multiplier
and store result to current ScoredSortedSet
|
int |
intersection(RScoredSortedSet.Aggregate aggregate,
String... names) |
Intersect provided ScoredSortedSets with defined aggregation method
and store result to current ScoredSortedSet
|
int |
intersection(RScoredSortedSet.Aggregate aggregate,
Map<String,Double> nameWithWeight) |
Intersect provided ScoredSortedSets mapped to weight multiplier
with defined aggregation method
and store result to current ScoredSortedSet
|
boolean |
isEmpty() |
Returns
true if this set is empty |
Iterator<V> |
iterator(int count) |
Returns an iterator over elements in this set.
|
Iterator<V> |
iterator(String pattern) |
Returns an iterator over elements in this set.
|
Iterator<V> |
iterator(String pattern,
int count) |
Returns an iterator over elements in this set.
|
V |
last() |
Returns the tail element or
null if this sorted set is empty. |
Double |
lastScore() |
Returns score of the head element or returns
null if this sorted set is empty. |
<KOut,VOut> |
mapReduce() |
Returns
RMapReduce object associated with this object |
V |
pollFirst() |
Removes and returns the head element or
null if this sorted set is empty. |
Collection<V> |
pollFirst(int count) |
Removes and returns the head elements or
null if this sorted set is empty. |
V |
pollFirst(long timeout,
TimeUnit unit) |
Removes and returns the head element or
null if this sorted set is empty. |
V |
pollFirstFromAny(long timeout,
TimeUnit unit,
String... queueNames) |
Removes and returns first available head element of any sorted set,
waiting up to the specified wait time if necessary for an element to become available
in any of defined sorted sets including this one.
|
V |
pollLast() |
Removes and returns the tail element or
null if this sorted set is empty. |
Collection<V> |
pollLast(int count) |
Removes and returns the tail elements or
null if this sorted set is empty. |
V |
pollLast(long timeout,
TimeUnit unit) |
Removes and returns the tail element or
null if this sorted set is empty. |
V |
pollLastFromAny(long timeout,
TimeUnit unit,
String... queueNames) |
Removes and returns first available tail element of any sorted set,
waiting up to the specified wait time if necessary for an element to become available
in any of defined sorted sets including this one.
|
Integer |
rank(V o) |
Returns rank of value, with the scores ordered from low to high.
|
Collection<V> |
readAll() |
Read all values at once.
|
boolean |
remove(Object o) |
|
boolean |
removeAll(Collection<?> c) |
|
int |
removeRangeByRank(int startIndex,
int endIndex) |
|
int |
removeRangeByScore(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive) |
|
boolean |
retainAll(Collection<?> c) |
|
Integer |
revRank(V o) |
Returns rank of value, with the scores ordered from high to low.
|
int |
size() |
Returns size of this set.
|
Object[] |
toArray() |
|
<T> T[] |
toArray(T[] a) |
|
boolean |
tryAdd(double score,
V object) |
Adds element to this set only if has not been added before.
|
int |
union(String... names) |
Union provided ScoredSortedSets
and store result to current ScoredSortedSet
|
int |
union(Map<String,Double> nameWithWeight) |
Union provided ScoredSortedSets mapped to weight multiplier
and store result to current ScoredSortedSet
|
int |
union(RScoredSortedSet.Aggregate aggregate,
String... names) |
Union provided ScoredSortedSets with defined aggregation method
and store result to current ScoredSortedSet
|
int |
union(RScoredSortedSet.Aggregate aggregate,
Map<String,Double> nameWithWeight) |
Union provided ScoredSortedSets mapped to weight multiplier
with defined aggregation method
and store result to current ScoredSortedSet
|
Collection<V> |
valueRange(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive) |
Returns all values between
startScore and endScore . |
Collection<V> |
valueRange(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive,
int offset,
int count) |
|
Collection<V> |
valueRange(int startIndex,
int endIndex) |
|
Collection<V> |
valueRangeReversed(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive) |
Returns all values between
startScore and endScore in reversed order. |
Collection<V> |
valueRangeReversed(double startScore,
boolean startScoreInclusive,
double endScore,
boolean endScoreInclusive,
int offset,
int count) |
|
Collection<V> |
valueRangeReversed(int startIndex,
int endIndex) |
forEach, iterator, spliterator
clearExpire, expire, expireAt, expireAt, remainTimeToLive
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
addAllAsync, addAndGetRankAsync, addAndGetRevRankAsync, addAsync, addScoreAndGetRankAsync, addScoreAndGetRevRankAsync, addScoreAsync, containsAllAsync, containsAsync, countAsync, entryRangeAsync, entryRangeAsync, entryRangeAsync, entryRangeReversedAsync, entryRangeReversedAsync, entryRangeReversedAsync, firstAsync, firstScoreAsync, getScoreAsync, intersectionAsync, intersectionAsync, intersectionAsync, intersectionAsync, lastAsync, lastScoreAsync, pollFirstAsync, pollFirstAsync, pollFirstAsync, pollFirstFromAnyAsync, pollLastAsync, pollLastAsync, pollLastAsync, pollLastFromAnyAsync, rankAsync, readAllAsync, removeAllAsync, removeAsync, removeRangeByRankAsync, removeRangeByScoreAsync, retainAllAsync, revRankAsync, sizeAsync, tryAddAsync, unionAsync, unionAsync, unionAsync, unionAsync, valueRangeAsync, valueRangeAsync, valueRangeAsync, valueRangeReversedAsync, valueRangeReversedAsync, valueRangeReversedAsync
readSort, readSort, readSort, readSort, readSort, readSort, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync
<KOut,VOut> RCollectionMapReduce<V,KOut,VOut> mapReduce()
RMapReduce
object associated with this objectKOut
- output keyVOut
- output valueV pollLastFromAny(long timeout, TimeUnit unit, String... queueNames)
Requires Redis 5.0.0 and higher.
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if all sorted sets are emptyV pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames)
Requires Redis 5.0.0 and higher.
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if all sorted sets are emptyV pollFirst(long timeout, TimeUnit unit)
null
if this sorted set is empty.timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if this sorted set is emptyV pollLast(long timeout, TimeUnit unit)
null
if this sorted set is empty.timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if this sorted set is emptyCollection<V> pollFirst(int count)
null
if this sorted set is empty.count
- - elements amountnull
if this sorted set is emptyCollection<V> pollLast(int count)
null
if this sorted set is empty.count
- - elements amountnull
if this sorted set is emptyV pollFirst()
null
if this sorted set is empty.null
if this sorted set is emptyV pollLast()
null
if this sorted set is empty.null
if this sorted set is emptyV first()
null
if this sorted set is empty.null
if this sorted set is emptyV last()
null
if this sorted set is empty.null
if this sorted set is emptyDouble firstScore()
null
if this sorted set is empty.null
if this sorted set is emptyDouble lastScore()
null
if this sorted set is empty.null
if this sorted set is emptyint removeRangeByScore(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
int removeRangeByRank(int startIndex, int endIndex)
Integer rank(V o)
o
- - objectnull
if value does not existInteger revRank(V o)
o
- - objectnull
if value does not existDouble getScore(V o)
null
if it doesn't exist.o
- - elementboolean add(double score, V object)
score
- - object scoreobject
- - object itselftrue
if element has added and false
if not.Integer addAndGetRank(double score, V object)
score
- - object scoreobject
- - object itselfInteger addAndGetRevRank(double score, V object)
score
- - object scoreobject
- - object itselfboolean tryAdd(double score, V object)
Works only with Redis 3.0.2 and higher.
score
- - object scoreobject
- - object itselftrue
if element has added and false
if not.int size()
boolean isEmpty()
true
if this set is emptytrue
if emptyIterator<V> iterator(String pattern)
pattern
is not null then only elements match this pattern are loaded.pattern
- - search patternIterator<V> iterator(int count)
count
param.count
- - size of elements batchIterator<V> iterator(String pattern, int count)
count
param.
If pattern is not null then only elements match this pattern are loaded.pattern
- - search patterncount
- - size of elements batchboolean contains(Object o)
Object[] toArray()
<T> T[] toArray(T[] a)
boolean remove(Object o)
boolean containsAll(Collection<?> c)
boolean removeAll(Collection<?> c)
boolean retainAll(Collection<?> c)
void clear()
Integer addScoreAndGetRank(V object, Number value)
object
- - object itselfvalue
- - object scoreInteger addScoreAndGetRevRank(V object, Number value)
object
- - object itselfvalue
- - object scoreCollection<V> valueRange(int startIndex, int endIndex)
Collection<V> valueRangeReversed(int startIndex, int endIndex)
Collection<ScoredEntry<V>> entryRange(int startIndex, int endIndex)
Collection<ScoredEntry<V>> entryRangeReversed(int startIndex, int endIndex)
Collection<V> valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
startScore
and endScore
.startScore
- - start score.
Use Double.POSITIVE_INFINITY
or Double.NEGATIVE_INFINITY
to define infinity numbersstartScoreInclusive
- - start score inclusiveendScore
- - end score
Use Double.POSITIVE_INFINITY
or Double.NEGATIVE_INFINITY
to define infinity numbersendScoreInclusive
- - end score inclusiveCollection<V> valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
startScore
and endScore
in reversed order.startScore
- - start score.
Use Double.POSITIVE_INFINITY
or Double.NEGATIVE_INFINITY
to define infinity numbersstartScoreInclusive
- - start score inclusiveendScore
- - end score
Use Double.POSITIVE_INFINITY
or Double.NEGATIVE_INFINITY
to define infinity numbersendScoreInclusive
- - end score inclusiveCollection<ScoredEntry<V>> entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Collection<V> valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
Collection<V> valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
Collection<ScoredEntry<V>> entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
Collection<ScoredEntry<V>> entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Collection<ScoredEntry<V>> entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
Long count(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
startScore
and endScore
.startScore
- - start scorestartScoreInclusive
- - start score inclusiveendScore
- - end scoreendScoreInclusive
- - end score inclusiveCollection<V> readAll()
int intersection(String... names)
names
- - names of ScoredSortedSetint intersection(RScoredSortedSet.Aggregate aggregate, String... names)
aggregate
- - score aggregation modenames
- - names of ScoredSortedSetint intersection(Map<String,Double> nameWithWeight)
nameWithWeight
- - name of ScoredSortedSet mapped to weight multiplierint intersection(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
aggregate
- - score aggregation modenameWithWeight
- - name of ScoredSortedSet mapped to weight multiplierint union(String... names)
names
- - names of ScoredSortedSetint union(RScoredSortedSet.Aggregate aggregate, String... names)
aggregate
- - score aggregation modenames
- - names of ScoredSortedSetint union(Map<String,Double> nameWithWeight)
nameWithWeight
- - name of ScoredSortedSet mapped to weight multiplierint union(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
aggregate
- - score aggregation modenameWithWeight
- - name of ScoredSortedSet mapped to weight multiplierCopyright © 2014–2018 The Redisson Project. All rights reserved.