Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IList<E>

Concurrent and distributed list.

Methods that require serialization/deserialization may throw RangeError, e.g when there is no suitable serializer for a certain type.

Type parameters

  • E

Hierarchy

Index

Methods

add

  • add(element: E): Promise<boolean>
  • Appends the specified element to the end of the list.

    Parameters

    • element: E

      element to be added

    Returns Promise<boolean>

    true if this list has changed as a result of this operation, false otherwise.

addAll

  • addAll(elements: E[]): Promise<boolean>
  • Appends all elements in the specified array to the end of this list, keeping the order of the array.

    Parameters

    • elements: E[]

      array to be appended

    Returns Promise<boolean>

    true if this list has changed as a result of this operation, false otherwise.

addAllAt

  • addAllAt(index: number, elements: E[]): Promise<boolean>
  • Inserts all elements in the specified array at specified index, keeping the order of the array. Shifts the subsequent elements to the right.

    Parameters

    • index: number

      position at which the array's elements should be inserted

    • elements: E[]

      array to be inserted

    Returns Promise<boolean>

    true if this list has changed as a result of this operation, false otherwise.

addAt

  • addAt(index: number, element: E): Promise<void>
  • Inserts the specified element at the specified index. Shifts the subsequent elements to the right.

    Parameters

    • index: number

      position at which the element should be inserted

    • element: E

      element to be inserted

    Returns Promise<void>

addItemListener

  • addItemListener(listener: ItemListener<E>, includeValue: boolean): Promise<string>
  • Adds an item listener for this list. Listener will be invoked whenever an item is added to or removed from this list.

    Parameters

    • listener: ItemListener<E>

      object with listener functions

    • includeValue: boolean

      true if updated item should be included in the event.

    Returns Promise<string>

    registration ID of the listener.

clear

  • clear(): Promise<void>
  • Removes all of the elements from this list.

    Returns Promise<void>

contains

  • contains(element: E): Promise<boolean>
  • Checks if the list contains the given element.

    Parameters

    • element: E

    Returns Promise<boolean>

    true if this list contains the specified element, false otherwise.

containsAll

  • containsAll(elements: E[]): Promise<boolean>
  • Checks if the list contains all of the elements of the specified array.

    Parameters

    • elements: E[]

      elements to be checked for presence in this list.

    Returns Promise<boolean>

    true if this list contains all of the elements of the specified array, false otherwise.

destroy

  • destroy(): Promise<void>
  • Destroys this object cluster-wide. Clears all resources taken for this object.

    Returns Promise<void>

get

  • get(index: number): Promise<E>
  • Returns the element at the specified position in this list.

    Parameters

    • index: number

      index of the element to return.

    Returns Promise<E>

getName

  • getName(): string
  • Returns the unique name of this object.

    Returns string

getPartitionKey

  • getPartitionKey(): string
  • Returns the key of the partition that this DistributedObject is assigned to. For a partitioned data structure, the returned value will not be null, but otherwise undefined.

    Returns string

getServiceName

  • getServiceName(): string

indexOf

  • indexOf(element: E): Promise<number>
  • Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

    Parameters

    • element: E

      element to search for

    Returns Promise<number>

isEmpty

  • isEmpty(): Promise<boolean>
  • Checks if this list is empty.

    Returns Promise<boolean>

    true if this list contains no elements, false otherwise.

lastIndexOf

  • lastIndexOf(element: E): Promise<number>
  • Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

    Parameters

    • element: E

    Returns Promise<number>

remove

  • remove(element: E): Promise<boolean>
  • Removes the first occurrence of the specified element from this list, if it is present.

    Parameters

    • element: E

      element to be removed

    Returns Promise<boolean>

    true if this list has changed as a result of this operation, false otherwise.

removeAll

  • removeAll(elements: E[]): Promise<boolean>
  • Removes from this list all of its elements that are contained in the specified array.

    Parameters

    • elements: E[]

      elements to be removed

    Returns Promise<boolean>

    true if this list has changed as a result of this operation, false otherwise.

removeAt

  • removeAt(index: number): Promise<E>
  • Removes the element at the specified position in this list.

    Parameters

    • index: number

      index of the element to be removed.

    Returns Promise<E>

    the removed element.

removeItemListener

  • removeItemListener(listenerId: string): Promise<boolean>
  • Removes an ItemListener from this list.

    Parameters

    • listenerId: string

      registration ID of the listener to be removed.

    Returns Promise<boolean>

    true if the item listener was successfully removed, false otherwise.

retainAll

  • retainAll(elements: E[]): Promise<boolean>
  • Retains only the elements in this list that are contained in the specified array.

    Parameters

    • elements: E[]

      elements to retain

    Returns Promise<boolean>

    true if this list has changed as a result of this operation, false otherwise.

set

  • set(index: number, element: E): Promise<E>
  • Replaces the element at the specified position in this list with the specified element.

    Parameters

    • index: number

      position of the element to be replaced

    • element: E

      replacement element

    Returns Promise<E>

    previous element at the given index.

size

  • size(): Promise<number>
  • Returns the number of elements in this list.

    Returns Promise<number>

subList

  • subList(start: number, end: number): Promise<ReadOnlyLazyList<E>>
  • Returns a view of this list that contains elements between index numbers from start (inclusive) to end (exclusive)

    Parameters

    • start: number

      start of the view

    • end: number

      end of the view

    Returns Promise<ReadOnlyLazyList<E>>

    a view of the list

toArray

  • toArray(): Promise<E[]>
  • Returns an array that contains all elements of this list in proper sequence (from first to last element).

    Returns Promise<E[]>

Generated using TypeDoc