public interface RedisZSet<E> extends RedisCollection<E>, Set<E>
SortedSet
based on the given priorities or weights
associated with each item.
Since using a Comparator
does not apply, a ZSet implements the SortedSet
methods where applicable.Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Adds an element to the set with a default score.
|
boolean |
add(E e,
double score)
Adds an element to the set with the given score, or updates the score if the element exists.
|
E |
first()
Returns the first (lowest) element currently in this sorted set.
|
Double |
getDefaultScore()
Returns the default score used by this set.
|
RedisZSet<E> |
intersectAndStore(Collection<? extends RedisZSet<?>> sets,
String destKey) |
RedisZSet<E> |
intersectAndStore(RedisZSet<?> set,
String destKey) |
E |
last()
Returns the last (highest) element currently in this sorted set.
|
Set<E> |
range(long start,
long end) |
Set<E> |
rangeByScore(double min,
double max) |
Set<ZSetOperations.TypedTuple<E>> |
rangeByScoreWithScores(double min,
double max) |
Set<ZSetOperations.TypedTuple<E>> |
rangeWithScores(long start,
long end) |
Long |
rank(Object o)
Returns the rank (position) of the given element in the set, in ascending order.
|
RedisZSet<E> |
remove(long start,
long end) |
RedisZSet<E> |
removeByScore(double min,
double max) |
Set<E> |
reverseRange(long start,
long end) |
Set<E> |
reverseRangeByScore(double min,
double max) |
Set<ZSetOperations.TypedTuple<E>> |
reverseRangeByScoreWithScores(double min,
double max) |
Set<ZSetOperations.TypedTuple<E>> |
reverseRangeWithScores(long start,
long end) |
Long |
reverseRank(Object o)
Returns the rank (position) of the given element in the set, in descending order.
|
Iterator<E> |
scan() |
Double |
score(Object o)
Returns the score of the given element.
|
RedisZSet<E> |
unionAndStore(Collection<? extends RedisZSet<?>> sets,
String destKey) |
RedisZSet<E> |
unionAndStore(RedisZSet<?> set,
String destKey) |
getOperations
RedisZSet<E> intersectAndStore(Collection<? extends RedisZSet<?>> sets, String destKey)
RedisZSet<E> unionAndStore(Collection<? extends RedisZSet<?>> sets, String destKey)
Set<ZSetOperations.TypedTuple<E>> rangeWithScores(long start, long end)
Set<ZSetOperations.TypedTuple<E>> reverseRangeWithScores(long start, long end)
Set<ZSetOperations.TypedTuple<E>> rangeByScoreWithScores(double min, double max)
Set<ZSetOperations.TypedTuple<E>> reverseRangeByScoreWithScores(double min, double max)
boolean add(E e, double score)
e
- element to addscore
- element scoreboolean add(E e)
add(e, getDefaultScore())
. The score value
is implementation specific. Double score(Object o)
o
- objectLong rank(Object o)
o
- objectLong reverseRank(Object o)
o
- objectDouble getDefaultScore()
E first()
NoSuchElementException
- sorted set is empty.E last()
NoSuchElementException
- sorted set is empty.