Package org.redisson.api
Interface RScoredSortedSetRx<V>
-
- Type Parameters:
V
- value type
- All Superinterfaces:
RExpirableRx
,RObjectRx
,RSortableRx<Set<V>>
- All Known Subinterfaces:
RGeoRx<V>
,RLexSortedSetRx
public interface RScoredSortedSetRx<V> extends RExpirableRx, RSortableRx<Set<V>>
RxJava2 interface for scored sorted set data structure.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.Flowable<Boolean>
add(double score, V object)
Adds element to this set, overrides previous score if it has been already added.io.reactivex.Flowable<Long>
addAll(Map<V,Double> objects)
io.reactivex.Flowable<Integer>
addAndGetRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added.io.reactivex.Flowable<Integer>
addAndGetRevRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added.io.reactivex.Flowable<Double>
addScore(V object, Number value)
io.reactivex.Flowable<Integer>
addScoreAndGetRank(V object, Number value)
Adds score to element and returns its rankio.reactivex.Flowable<Integer>
addScoreAndGetRevRank(V object, Number value)
Adds score to element and returns its reverse rankio.reactivex.Flowable<Boolean>
contains(V o)
io.reactivex.Flowable<Boolean>
containsAll(Collection<?> c)
io.reactivex.Flowable<Long>
count(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns the number of elements with a score betweenstartScore
andendScore
.io.reactivex.Flowable<Collection<ScoredEntry<V>>>
entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
io.reactivex.Flowable<Collection<ScoredEntry<V>>>
entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
io.reactivex.Flowable<Collection<ScoredEntry<V>>>
entryRange(int startIndex, int endIndex)
io.reactivex.Flowable<Collection<ScoredEntry<V>>>
entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
io.reactivex.Flowable<Collection<ScoredEntry<V>>>
entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
io.reactivex.Flowable<Collection<ScoredEntry<V>>>
entryRangeReversed(int startIndex, int endIndex)
io.reactivex.Flowable<V>
first()
Returns the head element ornull
if this sorted set is empty.io.reactivex.Flowable<Double>
firstScore()
Returns score of the head element or returnsnull
if this sorted set is empty.io.reactivex.Flowable<Double>
getScore(V o)
io.reactivex.Flowable<Integer>
intersection(String... names)
Intersect provided ScoredSortedSets and store result to current ScoredSortedSetio.reactivex.Flowable<Integer>
intersection(Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSetio.reactivex.Flowable<Integer>
intersection(RScoredSortedSet.Aggregate aggregate, String... names)
Intersect provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSetio.reactivex.Flowable<Integer>
intersection(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSetio.reactivex.Flowable<V>
iterator()
io.reactivex.Flowable<V>
iterator(int count)
Returns an iterator over elements in this set.io.reactivex.Flowable<V>
iterator(String pattern)
Returns an iterator over elements in this set.io.reactivex.Flowable<V>
iterator(String pattern, int count)
Returns an iterator over elements in this set.io.reactivex.Flowable<V>
last()
Returns the tail element ornull
if this sorted set is empty.io.reactivex.Flowable<Double>
lastScore()
Returns score of the tail element or returnsnull
if this sorted set is empty.io.reactivex.Flowable<V>
pollFirst()
Removes and returns the head element ornull
if this sorted set is empty.io.reactivex.Flowable<Collection<V>>
pollFirst(int count)
Removes and returns the head elements ornull
if this sorted set is empty.io.reactivex.Flowable<V>
pollFirst(long timeout, TimeUnit unit)
Removes and returns the head element ornull
if this sorted set is empty.io.reactivex.Flowable<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.io.reactivex.Flowable<V>
pollLast()
Removes and returns the tail element ornull
if this sorted set is empty.io.reactivex.Flowable<Collection<V>>
pollLast(int count)
Removes and returns the tail elements ornull
if this sorted set is empty.io.reactivex.Flowable<V>
pollLast(long timeout, TimeUnit unit)
Removes and returns the tail element ornull
if this sorted set is empty.io.reactivex.Flowable<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.io.reactivex.Flowable<Integer>
rank(V o)
Returns rank of value, with the scores ordered from low to high.io.reactivex.Flowable<Collection<V>>
readAll()
Read all values at once.io.reactivex.Flowable<Boolean>
remove(V object)
io.reactivex.Flowable<Boolean>
removeAll(Collection<?> c)
io.reactivex.Flowable<Integer>
removeRangeByRank(int startIndex, int endIndex)
io.reactivex.Flowable<Integer>
removeRangeByScore(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
io.reactivex.Flowable<Boolean>
retainAll(Collection<?> c)
io.reactivex.Flowable<Integer>
revRank(V o)
Returns rank of value, with the scores ordered from high to low.io.reactivex.Flowable<Integer>
size()
io.reactivex.Flowable<Boolean>
tryAdd(double score, V object)
Adds element to this set only if has not been added before.io.reactivex.Flowable<Integer>
union(String... names)
Union provided ScoredSortedSets and store result to current ScoredSortedSetio.reactivex.Flowable<Integer>
union(Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSetio.reactivex.Flowable<Integer>
union(RScoredSortedSet.Aggregate aggregate, String... names)
Union provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSetio.reactivex.Flowable<Integer>
union(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSetio.reactivex.Flowable<Collection<V>>
valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
io.reactivex.Flowable<Collection<V>>
valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
io.reactivex.Flowable<Collection<V>>
valueRange(int startIndex, int endIndex)
io.reactivex.Flowable<Collection<V>>
valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
in reversed order.io.reactivex.Flowable<Collection<V>>
valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
io.reactivex.Flowable<Collection<V>>
valueRangeReversed(int startIndex, int endIndex)
-
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectRx
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
-
Methods inherited from interface org.redisson.api.RSortableRx
readSorted, readSorted, readSorted, readSorted, readSorted, readSorted, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
-
-
-
-
Method Detail
-
pollLastFromAny
io.reactivex.Flowable<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.Requires Redis 5.0.0 and higher.
- Parameters:
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the tail element, or
null
if all sorted sets are empty
-
pollFirstFromAny
io.reactivex.Flowable<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.Requires Redis 5.0.0 and higher.
- Parameters:
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head element, or
null
if all sorted sets are empty
-
pollFirst
io.reactivex.Flowable<V> pollFirst(long timeout, TimeUnit unit)
Removes and returns the head element ornull
if this sorted set is empty.Requires Redis 5.0.0 and higher.
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head element,
or
null
if this sorted set is empty
-
pollLast
io.reactivex.Flowable<V> pollLast(long timeout, TimeUnit unit)
Removes and returns the tail element ornull
if this sorted set is empty.Requires Redis 5.0.0 and higher.
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the tail element or
null
if this sorted set is empty
-
pollFirst
io.reactivex.Flowable<Collection<V>> pollFirst(int count)
Removes and returns the head elements ornull
if this sorted set is empty.- Parameters:
count
- - elements amount- Returns:
- the head element,
or
null
if this sorted set is empty
-
pollLast
io.reactivex.Flowable<Collection<V>> pollLast(int count)
Removes and returns the tail elements ornull
if this sorted set is empty.- Parameters:
count
- - elements amount- Returns:
- the tail element or
null
if this sorted set is empty
-
pollFirst
io.reactivex.Flowable<V> 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
io.reactivex.Flowable<V> 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
-
first
io.reactivex.Flowable<V> first()
Returns the head element ornull
if this sorted set is empty.- Returns:
- the head element or
null
if this sorted set is empty
-
last
io.reactivex.Flowable<V> last()
Returns the tail element ornull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
firstScore
io.reactivex.Flowable<Double> firstScore()
Returns score of the head element or returnsnull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
lastScore
io.reactivex.Flowable<Double> lastScore()
Returns score of the tail element or returnsnull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
iterator
io.reactivex.Flowable<V> iterator(String pattern)
Returns an iterator over elements in this set. Ifpattern
is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search pattern- Returns:
- iterator
-
iterator
io.reactivex.Flowable<V> iterator(int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
iterator
io.reactivex.Flowable<V> iterator(String pattern, int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search patterncount
- - size of elements batch- Returns:
- iterator
-
iterator
io.reactivex.Flowable<V> iterator()
-
removeRangeByScore
io.reactivex.Flowable<Integer> removeRangeByScore(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
removeRangeByRank
io.reactivex.Flowable<Integer> removeRangeByRank(int startIndex, int endIndex)
-
rank
io.reactivex.Flowable<Integer> rank(V o)
Returns rank of value, with the scores ordered from low to high.- Parameters:
o
- - object- Returns:
- rank or
null
if value does not exist
-
revRank
io.reactivex.Flowable<Integer> revRank(V 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
-
add
io.reactivex.Flowable<Boolean> add(double score, V object)
Adds element to this set, overrides previous score if it has been already added.- Parameters:
score
- - object scoreobject
- - object itself- Returns:
true
if element has added andfalse
if not.
-
addAndGetRank
io.reactivex.Flowable<Integer> addAndGetRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added. Finally return the rank of the item- Parameters:
score
- - object scoreobject
- - object itself- Returns:
- rank
-
addAndGetRevRank
io.reactivex.Flowable<Integer> addAndGetRevRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added. Finally return the reverse rank of the item- Parameters:
score
- - object scoreobject
- - object itself- Returns:
- reverse rank
-
tryAdd
io.reactivex.Flowable<Boolean> tryAdd(double score, V object)
Adds element to this set only if has not been added before.Requires Redis 3.0.2 and higher.
- Parameters:
score
- - object scoreobject
- - object itself- Returns:
true
if element has added andfalse
if not.
-
size
io.reactivex.Flowable<Integer> size()
-
containsAll
io.reactivex.Flowable<Boolean> containsAll(Collection<?> c)
-
removeAll
io.reactivex.Flowable<Boolean> removeAll(Collection<?> c)
-
retainAll
io.reactivex.Flowable<Boolean> retainAll(Collection<?> c)
-
addScoreAndGetRevRank
io.reactivex.Flowable<Integer> addScoreAndGetRevRank(V object, Number value)
Adds score to element and returns its reverse rank- Parameters:
object
- - object itselfvalue
- - object score- Returns:
- reverse rank
-
addScoreAndGetRank
io.reactivex.Flowable<Integer> addScoreAndGetRank(V object, Number value)
Adds score to element and returns its rank- Parameters:
object
- - object itselfvalue
- - object score- Returns:
- rank
-
valueRange
io.reactivex.Flowable<Collection<V>> valueRange(int startIndex, int endIndex)
-
entryRange
io.reactivex.Flowable<Collection<ScoredEntry<V>>> entryRange(int startIndex, int endIndex)
-
valueRange
io.reactivex.Flowable<Collection<V>> valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
entryRange
io.reactivex.Flowable<Collection<ScoredEntry<V>>> entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
valueRange
io.reactivex.Flowable<Collection<V>> valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
entryRange
io.reactivex.Flowable<Collection<ScoredEntry<V>>> entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
valueRangeReversed
io.reactivex.Flowable<Collection<V>> valueRangeReversed(int startIndex, int endIndex)
-
valueRangeReversed
io.reactivex.Flowable<Collection<V>> valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
in reversed order.- Parameters:
startScore
- - start score. UseDouble.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
to define infinity numbersstartScoreInclusive
- - start score inclusiveendScore
- - end score UseDouble.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
to define infinity numbersendScoreInclusive
- - end score inclusive- Returns:
- values
-
valueRangeReversed
io.reactivex.Flowable<Collection<V>> valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
entryRangeReversed
io.reactivex.Flowable<Collection<ScoredEntry<V>>> entryRangeReversed(int startIndex, int endIndex)
-
entryRangeReversed
io.reactivex.Flowable<Collection<ScoredEntry<V>>> entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
entryRangeReversed
io.reactivex.Flowable<Collection<ScoredEntry<V>>> entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
count
io.reactivex.Flowable<Long> count(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns the number of elements with a score betweenstartScore
andendScore
.- Parameters:
startScore
- - start scorestartScoreInclusive
- - start score inclusiveendScore
- - end scoreendScoreInclusive
- - end score inclusive- Returns:
- count
-
readAll
io.reactivex.Flowable<Collection<V>> readAll()
Read all values at once.- Returns:
- values
-
intersection
io.reactivex.Flowable<Integer> intersection(String... names)
Intersect provided ScoredSortedSets and store result to current ScoredSortedSet- Parameters:
names
- - names of ScoredSortedSet- Returns:
- length of intersection
-
intersection
io.reactivex.Flowable<Integer> intersection(RScoredSortedSet.Aggregate aggregate, String... names)
Intersect provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSet- Parameters:
aggregate
- - score aggregation modenames
- - names of ScoredSortedSet- Returns:
- length of intersection
-
intersection
io.reactivex.Flowable<Integer> intersection(Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSet- Parameters:
nameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of intersection
-
intersection
io.reactivex.Flowable<Integer> 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- Parameters:
aggregate
- - score aggregation modenameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of intersection
-
union
io.reactivex.Flowable<Integer> union(String... names)
Union provided ScoredSortedSets and store result to current ScoredSortedSet- Parameters:
names
- - names of ScoredSortedSet- Returns:
- length of union
-
union
io.reactivex.Flowable<Integer> union(RScoredSortedSet.Aggregate aggregate, String... names)
Union provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSet- Parameters:
aggregate
- - score aggregation modenames
- - names of ScoredSortedSet- Returns:
- length of union
-
union
io.reactivex.Flowable<Integer> union(Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSet- Parameters:
nameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of union
-
union
io.reactivex.Flowable<Integer> 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- Parameters:
aggregate
- - score aggregation modenameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of union
-
-