Spring Data Key-Value

org.springframework.data.keyvalue.redis.support.collections
Class DefaultRedisSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection<E>
          extended by org.springframework.data.keyvalue.redis.support.collections.DefaultRedisSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, KeyBound<String>, RedisCollection<E>, RedisSet<E>, RedisStore

public class DefaultRedisSet<E>
extends AbstractRedisCollection<E>
implements RedisSet<E>

Default implementation for RedisSet.

Author:
Costin Leau

Field Summary
 
Fields inherited from class org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection
ENCODING
 
Constructor Summary
DefaultRedisSet(BoundSetOperations<String,E> boundOps)
          Constructs a new DefaultRedisSet instance.
DefaultRedisSet(String key, RedisOperations<String,E> operations)
          Constructs a new DefaultRedisSet instance.
 
Method Summary
 boolean add(E e)
           
 void clear()
           
 boolean contains(Object o)
           
 Set<E> diff(Collection<? extends RedisSet<?>> sets)
           
 RedisSet<E> diffAndStore(String destKey, Collection<? extends RedisSet<?>> sets)
           
 Set<E> intersect(Collection<? extends RedisSet<?>> sets)
           
 RedisSet<E> intersectAndStore(String destKey, Collection<? extends RedisSet<?>> sets)
           
 Iterator<E> iterator()
           
 boolean remove(Object o)
           
 int size()
           
 Set<E> union(Collection<? extends RedisSet<?>> sets)
           
 RedisSet<E> unionAndStore(String destKey, Collection<? extends RedisSet<?>> 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

DefaultRedisSet

public DefaultRedisSet(String key,
                       RedisOperations<String,E> operations)
Constructs a new DefaultRedisSet instance.

Parameters:
key -
operations -

DefaultRedisSet

public DefaultRedisSet(BoundSetOperations<String,E> boundOps)
Constructs a new DefaultRedisSet instance.

Parameters:
boundOps -
Method Detail

diff

public Set<E> diff(Collection<? extends RedisSet<?>> sets)
Specified by:
diff in interface RedisSet<E>

diffAndStore

public RedisSet<E> diffAndStore(String destKey,
                                Collection<? extends RedisSet<?>> sets)
Specified by:
diffAndStore in interface RedisSet<E>

intersect

public Set<E> intersect(Collection<? extends RedisSet<?>> sets)
Specified by:
intersect in interface RedisSet<E>

intersectAndStore

public RedisSet<E> intersectAndStore(String destKey,
                                     Collection<? extends RedisSet<?>> sets)
Specified by:
intersectAndStore in interface RedisSet<E>

union

public Set<E> union(Collection<? extends RedisSet<?>> sets)
Specified by:
union in interface RedisSet<E>

unionAndStore

public RedisSet<E> unionAndStore(String destKey,
                                 Collection<? extends RedisSet<?>> sets)
Specified by:
unionAndStore in interface RedisSet<E>

add

public boolean add(E e)
Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Specified by:
add in class AbstractRedisCollection<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>
Specified by:
clear in class AbstractRedisCollection<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>
Overrides:
contains in class AbstractCollection<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>
Specified by:
iterator in class AbstractCollection<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>
Specified by:
remove in class AbstractRedisCollection<E>

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>
Specified by:
size in class AbstractCollection<E>

Spring Data Key-Value

Copyright © 2010-2011 SpringSource. All Rights Reserved.