Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISet<E>

Concurrent and distributed set.

Type parameters

  • E

Hierarchy

  • DistributedObject
    • ISet

Index

Methods

add

  • add(entry: E): Promise<boolean>
  • Adds the specified element to this set if not already present.

    throws

    {Error} if entry is null or undefined.

    Parameters

    • entry: E

    Returns Promise<boolean>

    a promise to be resolved to true if this set did not contain the element.

addAll

  • addAll(items: E[]): Promise<boolean>
  • Adds the elements in the array items to this set if not already present. At the end, the set contains all elements of items array and its previous elements.

    throws

    {Error} if collection or one of its elements is null or undefined.

    Parameters

    • items: E[]

    Returns Promise<boolean>

    true if this set changed, false otherwise.

addItemListener

  • addItemListener(listener: ItemListener<E>, includeValue: boolean): Promise<string>
  • Adds an item listener for this set. Listener will be invoked for any add/remove item events.

    Parameters

    • listener: ItemListener<E>
    • 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 set.

    Returns Promise<void>

contains

  • contains(entry: E): Promise<boolean>
  • Checks whether this set contains the given element.

    throws

    {Error} if entry is null.

    Parameters

    • entry: E

    Returns Promise<boolean>

    true if this set contains the given element, false otherwise.

containsAll

  • containsAll(items: E[]): Promise<boolean>
  • Checks whether this set contains all elements of given array.

    throws

    {Error} if collection or one of its elements is null or undefined.

    Parameters

    • items: E[]

    Returns Promise<boolean>

    true if this set contains all elments of given collection, false otherwise.

destroy

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

    Returns Promise<void>

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
  • Returns the service name for this object.

    Returns string

isEmpty

  • isEmpty(): Promise<boolean>
  • Returns Promise<boolean>

    true if this set does n Checks if this set has any elements.ot have any elements, false otherwise.

remove

  • remove(entry: E): Promise<boolean>
  • Removes given entry from this set.

    throws

    {Error} if entry is null or undefined.

    Parameters

    • entry: E

    Returns Promise<boolean>

    true if this set actually had given element, false otherwise.

removeAll

  • removeAll(items: E[]): Promise<boolean>
  • Removes all elements of given array from this set.

    throws

    {Error} if collection or one of its elements is null or undefined.

    Parameters

    • items: E[]

    Returns Promise<boolean>

    true if this set changed.

removeItemListener

  • removeItemListener(registrationId: string): Promise<boolean>
  • Removes an item listener for this set.

    Parameters

    • registrationId: string

      Registration id of the listener to be removed.

    Returns Promise<boolean>

    true if the item listener is removed, false otherwise.

retainAll

  • retainAll(items: E[]): Promise<boolean>
  • Removes all elements from this set except the elements of given array.

    throws

    {Error} if collection or one of its elements is null or undefined.

    Parameters

    • items: E[]

    Returns Promise<boolean>

    true if this set changed.

size

  • size(): Promise<number>
  • Returns the size of this set.

    Returns Promise<number>

    number of elements in this set.

toArray

  • toArray(): Promise<E[]>
  • Returns an array containing all of the elements in the set.

    Returns Promise<E[]>

    An array of items.

Generated using TypeDoc