org.springframework.datastore.redis.collection
Class RedisSet

java.lang.Object
  extended by org.springframework.datastore.redis.collection.AbstractRedisCollection
      extended by org.springframework.datastore.redis.collection.RedisSet
All Implemented Interfaces:
Iterable, Collection, Set, RedisCollection

public class RedisSet
extends AbstractRedisCollection
implements Set

A Java set implementation that backs onto a Redis set


Field Summary
 
Fields inherited from class org.springframework.datastore.redis.collection.AbstractRedisCollection
redisKey, redisTemplate
 
Constructor Summary
RedisSet(RedisTemplate redisTemplate, String redisKey)
           
 
Method Summary
 boolean add(Object o)
           
 boolean contains(Object o)
           
 Iterator iterator()
           
 Set<String> members()
           
 List<String> members(int offset, int max)
           
 String pop()
           
 String random()
           
 boolean remove(Object o)
           
 int size()
           
 
Methods inherited from class org.springframework.datastore.redis.collection.AbstractRedisCollection
addAll, clear, containsAll, getRedisKey, isEmpty, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

RedisSet

public RedisSet(RedisTemplate redisTemplate,
                String redisKey)
Method Detail

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Set

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface Set

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Set

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface Set

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface Set

members

public Set<String> members()
Specified by:
members in interface RedisCollection

members

public List<String> members(int offset,
                            int max)
Specified by:
members in interface RedisCollection

random

public String random()

pop

public String pop()