Trait

play.api.cache.redis

RedisList

Related Doc: package redis

Permalink

trait RedisList[Elem, Result[_]] extends RedisCollection[List[Elem], Result]

Redis Lists are simply lists of strings, sorted by insertion order. It is possible to add elements to a Redis List pushing new elements on the head (on the left) or on the tail (on the right) of the list.

Elem

Data type of the inserted element

Linear Supertypes
RedisCollection[List[Elem], Result], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RedisList
  2. RedisCollection
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait RedisListModification extends AnyRef

    Permalink
  2. trait RedisListView extends AnyRef

    Permalink
  3. type This = RedisList[Elem, Result]

    Permalink
    Definition Classes
    RedisList → RedisCollection

Abstract Value Members

  1. abstract def ++:(elements: Iterable[Elem]): Result[This]

    Permalink

    Insert all the specified values at the head of the list stored at key.

    Insert all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.

    It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the head of the list, from the leftmost element to the rightmost element. So for instance the command LPUSH mylist a b c will result into a list containing c as first element, b as second element and a as third element.

    elements

    element to be prepended

    returns

    this collection to chain commands

  2. abstract def +:(element: Elem): Result[This]

    Permalink

    Insert all the specified values at the head of the list stored at key.

    Insert all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.

    It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the head of the list, from the leftmost element to the rightmost element. So for instance the command LPUSH mylist a b c will result into a list containing c as first element, b as second element and a as third element.

    element

    element to be prepended

    returns

    this collection to chain commands

  3. abstract def :+(element: Elem): Result[This]

    Permalink

    Insert all the specified values at the tail of the list stored at key.

    Insert all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned. * It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element. So for instance the command RPUSH mylist a b c will result into a list containing a as first element, b as second element and c as third element.

    element

    to be apended

    returns

    this collection to chain commands

  4. abstract def :++(elements: Iterable[Elem]): Result[This]

    Permalink

    Insert all the specified values at the tail of the list stored at key.

    Insert all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned. * It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element. So for instance the command RPUSH mylist a b c will result into a list containing a as first element, b as second element and c as third element.

    elements

    to be apended

    returns

    this collection to chain commands

  5. abstract def append(element: Elem): Result[This]

    Permalink

    Insert all the specified values at the tail of the list stored at key.

    Insert all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned. * It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element. So for instance the command RPUSH mylist a b c will result into a list containing a as first element, b as second element and c as third element.

    element

    to be apended

    returns

    this collection to chain commands

  6. abstract def apply(index: Int): Result[Elem]

    Permalink

    Returns the element at index index in the list stored at key.

    Returns the element at index index in the list stored at key. The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth. When the value at key is not a list, an error is returned.

    Time complexity: O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).

    index

    position of the element

    returns

    element at the index or exception

  7. abstract def get(index: Int): Result[Option[Elem]]

    Permalink

    Returns the element at index index in the list stored at key.

    Returns the element at index index in the list stored at key. The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth. When the value at key is not a list, an error is returned.

    Time complexity: O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).

    index

    position of the element

    returns

    Some( element ) at the index, None if no element exists, or exception when the value is not a list

  8. abstract def headPop: Result[Option[Elem]]

    Permalink

    Removes and returns the first element of the list stored at key.

    Removes and returns the first element of the list stored at key.

    Time complexity: O(1)

    returns

    head element if exists

  9. abstract def insertBefore(pivot: Elem, element: Elem): Result[Option[Long]]

    Permalink

    Inserts value in the list stored at key either before the reference value pivot.

    Inserts value in the list stored at key either before the reference value pivot. When key does not exist, it is considered an empty list and no operation is performed. An error is returned when key exists but does not hold a list value.

    Time complexity: O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).

    pivot

    insert before this value

    element

    elements to be inserted

    returns

    new size of the collection or None if pivot not found

  10. abstract def isEmpty: Result[Boolean]

    Permalink
    Definition Classes
    RedisCollection
  11. abstract def modify: RedisListModification

    Permalink

    returns

    write-only operations over the collection, modify data

  12. abstract def nonEmpty: Result[Boolean]

    Permalink
    Definition Classes
    RedisCollection
  13. abstract def prepend(element: Elem): Result[This]

    Permalink

    Insert all the specified values at the head of the list stored at key.

    Insert all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.

    It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the head of the list, from the leftmost element to the rightmost element. So for instance the command LPUSH mylist a b c will result into a list containing c as first element, b as second element and a as third element.

    element

    element to be prepended

    returns

    this collection to chain commands

  14. abstract def remove(element: Elem, count: Int = 1): Result[This]

    Permalink

    Removes first N values equal to the given value from the list.

    Removes first N values equal to the given value from the list.

    Note: If the value is serialized object, it is not proofed that serialized strings will match and the value will be actually deleted. This function is intended to be used with primitive types only.

    Time complexity: O(N)

    element

    element to be removed from the list

    count

    first N occurrences

    returns

    this collection to chain commands

  15. abstract def removeAt(position: Int): Result[This]

    Permalink

    Removes the element at the given position.

    Removes the element at the given position. If the index is out of range, it throws an exception.

    Time complexity: O(N)

    position

    element index to be removed

    returns

    this collection to chain commands

  16. abstract def set(position: Int, element: Elem): Result[This]

    Permalink

    Sets the list element at index to value.

    Sets the list element at index to value. For more information on the index argument, see LINDEX. An error is returned for out of range indexes.

    position

    position to insert at

    element

    elements to be inserted

    returns

    this collection to chain commands

  17. abstract def size: Result[Long]

    Permalink

    Returns the length of the collection stored at key.

    Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.

    Time complexity: O(1)

    returns

    size of the list

    Definition Classes
    RedisCollection
  18. abstract def view: RedisListView

    Permalink

    returns

    read-only operations over the collection, does not modify data

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. def head: Result[Elem]

    Permalink

    returns

    first element of the collection or an exception

  12. def headOption: Result[Option[Elem]]

    Permalink

    returns

    first element of the collection or None

  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def last: Result[Elem]

    Permalink

    returns

    last element of the collection or an exception

  15. def lastOption: Result[Option[Elem]]

    Permalink

    returns

    last element of the collection or None

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toList: Result[Seq[Elem]]

    Permalink

    returns

    Helper to this.view.all returning all object in the list

  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from RedisCollection[List[Elem], Result]

Inherited from AnyRef

Inherited from Any

Ungrouped