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>>
- All Known Implementing Classes:
RedissonBlockingDeque
,RedissonBlockingQueue
,RedissonBoundedBlockingQueue
,RedissonDeque
,RedissonList
,RedissonListMultimapValues
,RedissonPriorityBlockingDeque
,RedissonPriorityBlockingQueue
,RedissonPriorityDeque
,RedissonPriorityQueue
,RedissonQueue
,RedissonRingBuffer
,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 TypeMethodDescriptionint
Addelement
afterelementToFind
int
Addelement
beforeelementToFind
int
addListener
(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.void
fastRemove
(int index) Remove object by specified indexvoid
Setelement
atindex
.get
(int... indexes) Loads elements by specifiedindexes
<KOut,
VOut>
RCollectionMapReduce<V,KOut, VOut> ReturnsRMapReduce
object associated with this maprange
(int toIndex) Returns range of values from 0 index totoIndex
.range
(int fromIndex, int toIndex) Returns range of values fromfromIndex
totoIndex
index including.readAll()
Read all elements at onceboolean
Removes up tocount
occurrences ofelement
subList
(int fromIndex, int toIndex) void
trim
(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, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArray
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RListAsync
addAfterAsync, addAllAsync, addAsync, addBeforeAsync, addListenerAsync, fastRemoveAsync, fastSetAsync, getAsync, getAsync, indexOfAsync, lastIndexOfAsync, rangeAsync, rangeAsync, readAllAsync, removeAsync, removeAsync, setAsync, trimAsync
Methods 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, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
Methods inherited from interface org.redisson.api.RSortable
readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
Methods 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:
count
- batch sizeiteratorName
- redis object name to which cursor will be saved- Returns:
- shared elements iterator
-
mapReduce
ReturnsRMapReduce
object associated with this map- Type Parameters:
KOut
- output keyVOut
- output value- Returns:
- MapReduce instance
-
addAfter
Addelement
afterelementToFind
- Parameters:
elementToFind
- - object to findelement
- - object to add- Returns:
- new list size
-
addBefore
Addelement
beforeelementToFind
- 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.-1
means the last element,-2
means penultimate and so on.- Parameters:
toIndex
- - end index- Returns:
- elements
-
range
Returns range of values fromfromIndex
totoIndex
index including. Indexes are zero based.-1
means the last element,-2
means 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 tocount
occurrences ofelement
- Parameters:
element
- - element to findcount
- - amount occurrences- Returns:
true
if at least one element removed; orfalse
if element isn't found
-
addListener
Adds object event listener- Specified by:
addListener
in interfaceRObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-