|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection<E> org.springframework.data.keyvalue.redis.support.collections.DefaultRedisZSet<E>
public class DefaultRedisZSet<E>
Default implementation for RedisZSet
.
Field Summary |
---|
Fields inherited from class org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection |
---|
ENCODING |
Constructor Summary | |
---|---|
DefaultRedisZSet(BoundZSetOperations<String,E> boundOps)
Constructs a new DefaultRedisZSet instance with a default score of '1'. |
|
DefaultRedisZSet(BoundZSetOperations<String,E> boundOps,
double defaultScore)
Constructs a new DefaultRedisZSet instance. |
|
DefaultRedisZSet(String key,
RedisOperations<String,E> operations)
Constructs a new DefaultRedisZSet instance with a default score of '1'. |
|
DefaultRedisZSet(String key,
RedisOperations<String,E> operations,
double defaultScore)
Constructs a new DefaultRedisSortedSet instance. |
Method Summary | |
---|---|
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. |
void |
clear()
|
boolean |
contains(Object o)
|
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(String destKey,
Collection<? extends RedisZSet<?>> sets)
|
Iterator<E> |
iterator()
|
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)
|
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)
|
boolean |
remove(Object o)
|
RedisZSet<E> |
removeByScore(double min,
double max)
|
Set<E> |
reverseRange(long start,
long end)
|
Long |
reverseRank(Object o)
Returns the rank (position) of the given element in the set, in descending order. |
Double |
score(Object o)
Returns the score of the given element. |
int |
size()
|
RedisZSet<E> |
unionAndStore(String destKey,
Collection<? extends RedisZSet<?>> sets)
|
Methods inherited from class org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection |
---|
addAll, containsAll, equals, getKey, getOperations, hashCode, removeAll, retainAll, toString |
Methods inherited from class java.util.AbstractCollection |
---|
isEmpty, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.data.keyvalue.redis.support.collections.RedisStore |
---|
getOperations |
Methods inherited from interface org.springframework.data.keyvalue.redis.core.KeyBound |
---|
getKey |
Methods inherited from interface java.util.Set |
---|
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public DefaultRedisZSet(String key, RedisOperations<String,E> operations)
DefaultRedisZSet
instance with a default score of '1'.
key
- operations
- public DefaultRedisZSet(String key, RedisOperations<String,E> operations, double defaultScore)
DefaultRedisSortedSet
instance.
key
- operations
- defaultScore
- public DefaultRedisZSet(BoundZSetOperations<String,E> boundOps)
DefaultRedisZSet
instance with a default score of '1'.
boundOps
- public DefaultRedisZSet(BoundZSetOperations<String,E> boundOps, double defaultScore)
DefaultRedisZSet
instance.
boundOps
- defaultScore
- Method Detail |
---|
public RedisZSet<E> intersectAndStore(String destKey, Collection<? extends RedisZSet<?>> sets)
intersectAndStore
in interface RedisZSet<E>
public Set<E> range(long start, long end)
range
in interface RedisZSet<E>
public Set<E> reverseRange(long start, long end)
reverseRange
in interface RedisZSet<E>
public Set<E> rangeByScore(double min, double max)
rangeByScore
in interface RedisZSet<E>
public RedisZSet<E> remove(long start, long end)
remove
in interface RedisZSet<E>
public RedisZSet<E> removeByScore(double min, double max)
removeByScore
in interface RedisZSet<E>
public RedisZSet<E> unionAndStore(String destKey, Collection<? extends RedisZSet<?>> sets)
unionAndStore
in interface RedisZSet<E>
public boolean add(E e)
RedisZSet
add(e, getDefaultScore())
.
The score value is implementation specific.
add
in interface Collection<E>
add
in interface Set<E>
add
in interface RedisZSet<E>
add
in class AbstractRedisCollection<E>
public boolean add(E e, double score)
RedisZSet
add
in interface RedisZSet<E>
e
- element to addscore
- element score
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractRedisCollection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractCollection<E>
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface Set<E>
iterator
in class AbstractCollection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractRedisCollection<E>
public int size()
size
in interface Collection<E>
size
in interface Set<E>
size
in class AbstractCollection<E>
public Double getDefaultScore()
RedisZSet
getDefaultScore
in interface RedisZSet<E>
public E first()
RedisZSet
first
in interface RedisZSet<E>
public E last()
RedisZSet
last
in interface RedisZSet<E>
public Long rank(Object o)
RedisZSet
rank
in interface RedisZSet<E>
o
- object
public Long reverseRank(Object o)
RedisZSet
reverseRank
in interface RedisZSet<E>
o
- object
public Double score(Object o)
RedisZSet
score
in interface RedisZSet<E>
o
- object
|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |