Class: ReplicatedSet

akkaserverless.replicatedentity. ReplicatedSet

A Replicated Set data type.

A ReplicatedSet is a set of module:akkaserverless.Serializable values. Elements can be added and removed.

Members


<readonly> size :number

The number of elements in this set.

Type:
  • number

Methods


add(element)

Add an element to this set.

Parameters:
Name Type Description
element module:akkaserverless.Serializable

The element to add.

Returns:

This set.

Type
module:akkaserverless.replicatedentity.ReplicatedSet

addAll(elements)

Add multiple elements to this set.

Parameters:
Name Type Description
elements Iterator.<module:akkaserverless.Serializable>

The elements to add.

Returns:

This set.

Type
module:akkaserverless.replicatedentity.ReplicatedSet

clear()

Remove all elements from this set.

Returns:

This set.

Type
module:akkaserverless.replicatedentity.ReplicatedSet

delete(element)

Remove an element from this set.

Parameters:
Name Type Description
element module:akkaserverless.Serializable

The element to delete.

Returns:

This set.

Type
module:akkaserverless.replicatedentity.ReplicatedSet

elements()

Get a copy of the current elements as a Set.

Returns:
Type
Set.<module:akkaserverless.Serializable>

forEach(callback)

Execute the given callback for each element.

Parameters:
Name Type Description
callback module:akkaserverless.replicatedentity.ReplicatedSet~forEachCallback

The callback to handle each element.


has(element)

Does this set contain the given element?

Parameters:
Name Type Description
element module:akkaserverless.Serializable

The element to check.

Returns:

True if the set contains the element.

Type
boolean

iterator()

Create an iterator for this set.

Returns:
Type
Iterator.<module:akkaserverless.Serializable>

Type Definitions


forEachCallback(element)

Callback for handling elements iterated through by module:akkaserverless.replicatedentity.ReplicatedSet#forEach.

Parameters:
Name Type Description
element module:akkaserverless.Serializable

The element.