org.springframework.datastore.redis.collection
Class RedisList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.springframework.datastore.redis.collection.RedisList
All Implemented Interfaces:
Iterable, Collection, List, RedisCollection

public class RedisList
extends AbstractList
implements List, RedisCollection

Creates a list that is backed onto a Redis list

Since:
1.0

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
RedisList(RedisTemplate redisTemplate, String redisKey)
           
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object e)
           
 boolean contains(Object o)
           
 Object get(int index)
           
 String getRedisKey()
          They key used by the collection
 Iterator iterator()
           
 Set<String> members()
           
 List<String> members(int offset, int max)
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 Object set(int index, Object element)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, addAll, clear, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, removeAll, retainAll, subList, toArray, toArray
 

Constructor Detail

RedisList

public RedisList(RedisTemplate redisTemplate,
                 String redisKey)
Method Detail

get

public Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List
Overrides:
set in class AbstractList

add

public void add(int index,
                Object element)
Specified by:
add in interface List
Overrides:
add in class AbstractList

remove

public Object remove(int index)
Specified by:
remove in interface List
Overrides:
remove in class AbstractList

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class AbstractCollection

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List
Overrides:
iterator in class AbstractList

add

public boolean add(Object e)
Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class AbstractList

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class AbstractCollection

getRedisKey

public String getRedisKey()
Description copied from interface: RedisCollection
They key used by the collection

Specified by:
getRedisKey in interface RedisCollection
Returns:
The redis key

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