Package org.redisson.api
Interface RList<V>
- Type Parameters:
V- the type of elements held in this collection
- All Superinterfaces:
Collection<V>,Iterable<V>,List<V>,RandomAccess,RCollectionAsync<V>,RExpirable,RExpirableAsync,RListAsync<V>,RObject,RObjectAsync,RSortable<List<V>>,RSortableAsync<List<V>>,SequencedCollection<V>
- All Known Implementing Classes:
RedissonList,RedissonListMultimapValues,RedissonSubList
public interface RList<V>
extends List<V>, RExpirable, RListAsync<V>, RSortable<List<V>>, RandomAccess
Distributed and concurrent implementation of
List- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionintAddelementafterelementToFindintAddelementbeforeelementToFindintaddListener(ObjectListener listener) Adds object event listenerdistributedIterator(int count) Returns element iterator that can be shared across multiple applications.distributedIterator(String iteratorName, int count) Returns iterator over elements that match specified pattern.voidfastRemove(int index) Remove object by specified indexvoidSetelementatindex.get(int... indexes) Loads elements by specifiedindexes<KOut,VOut>
RCollectionMapReduce<V, KOut, VOut> ReturnsRMapReduceobject associated with this maprange(int toIndex) Returns range of values from 0 index totoIndex.range(int fromIndex, int toIndex) Returns range of values fromfromIndextotoIndexindex including.readAll()Read all elements at oncebooleanRemoves up tocountoccurrences ofelementsubList(int fromIndex, int toIndex) voidtrim(int fromIndex, int toIndex) Trim list and remains elements only in specified rangefromIndex, inclusive, andtoIndex, inclusive.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, toArray, toArrayMethods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsyncMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RListAsync
addAfterAsync, addAllAsync, addAsync, addBeforeAsync, addListenerAsync, fastRemoveAsync, fastSetAsync, getAsync, getAsync, indexOfAsync, lastIndexOfAsync, rangeAsync, rangeAsync, readAllAsync, removeAsync, removeAsync, setAsync, trimAsyncMethods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RSortable
readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, sortTo, sortTo, sortTo, sortTo, sortTo, sortToMethods inherited from interface org.redisson.api.RSortableAsync
readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync
-
Method Details
-
get
Loads elements by specifiedindexes- Parameters:
indexes- of elements- Returns:
- list of elements
-
distributedIterator
Returns element iterator that can be shared across multiple applications. Creating multiple iterators on the same object with this method will result in a single shared iterator. See distributedIterator(String, int) for creating different iterators.- Parameters:
count- batch size- Returns:
- shared elements iterator
-
distributedIterator
Returns iterator over elements that match specified pattern. Iterator can be shared across multiple applications. Creating multiple iterators on the same object with this method will result in a single shared iterator. Iterator name must be resolved to the same hash slot as list name.- Parameters:
iteratorName- redis object name to which cursor will be savedcount- batch size- Returns:
- shared elements iterator
-
mapReduce
ReturnsRMapReduceobject associated with this map- Type Parameters:
KOut- output keyVOut- output value- Returns:
- MapReduce instance
-
addAfter
AddelementafterelementToFind- Parameters:
elementToFind- - object to findelement- - object to add- Returns:
- new list size
-
addBefore
AddelementbeforeelementToFind- Parameters:
elementToFind- - object to findelement- - object to add- Returns:
- new list size
-
fastSet
- Parameters:
index- - index of objectelement- - object to set
-
subList
-
readAll
Read all elements at once- Returns:
- list of values
-
trim
void trim(int fromIndex, int toIndex) Trim list and remains elements only in specified rangefromIndex, inclusive, andtoIndex, inclusive.- Parameters:
fromIndex- - from indextoIndex- - to index
-
range
Returns range of values from 0 index totoIndex. Indexes are zero based.-1means the last element,-2means penultimate and so on.- Parameters:
toIndex- - end index- Returns:
- elements
-
range
Returns range of values fromfromIndextotoIndexindex including. Indexes are zero based.-1means the last element,-2means penultimate and so on.- Parameters:
fromIndex- - start indextoIndex- - end index- Returns:
- elements
-
fastRemove
void fastRemove(int index) Remove object by specified index- Parameters:
index- - index of object
-
remove
Removes up tocountoccurrences ofelement- Parameters:
element- - element to findcount- - amount occurrences- Returns:
trueif at least one element removed; orfalseif element isn't found
-
addListener
Adds object event listener- Specified by:
addListenerin interfaceRObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-