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> |
rangeByLex(RedisZSetCommands.Range range)
Get all elements with lexicographical ordering with a value between
RedisZSetCommands.Range.getMin() and
RedisZSetCommands.Range.getMax() . |
Set<E> |
rangeByLex(RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get all elements n elements, where n =
RedisZSetCommands.Limit.getCount() , starting at
RedisZSetCommands.Limit.getOffset() with lexicographical ordering having a value between RedisZSetCommands.Range.getMin() and
RedisZSetCommands.Range.getMax() . |
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
expire, expireAt, getExpire, getKey, getType, persist, rename
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
RedisZSet<E> intersectAndStore(Collection<? extends RedisZSet<?>> sets, String destKey)
RedisZSet<E> unionAndStore(Collection<? extends RedisZSet<?>> sets, String destKey)
Set<E> rangeByLex(RedisZSetCommands.Range range)
RedisZSetCommands.Range.getMin()
and
RedisZSetCommands.Range.getMax()
.range
- must not be null.BoundZSetOperations#rangeByLex(Range)
Set<E> rangeByLex(RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands.Limit.getCount()
, starting at
RedisZSetCommands.Limit.getOffset()
with lexicographical ordering having a value between RedisZSetCommands.Range.getMin()
and
RedisZSetCommands.Range.getMax()
.range
- must not be null.limit
- can be null.BoundZSetOperations#rangeByLex(Range, Limit)
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.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.