Options
All
  • Public
  • Public/Protected
  • All
Menu

A replicated map of counters.

Type Parameters

Hierarchy

  • ReplicatedCounterMap

Implements

Index

Constructors

Methods

  • get(key: Key): undefined | number
  • Get the value at the given key.

    Parameters

    • key: Key

      The key to get

    Returns undefined | number

    The counter value, or undefined if no value is defined at that key

  • getLong(key: Key): undefined | Long
  • Get the value as a long at the given key.

    Parameters

    • key: Key

      The key to get

    Returns undefined | Long

    The counter value as a long, or undefined if no value is defined at that key

  • Increment the counter at the given key by the given number.

    Parameters

    • key: Key

      The key for the counter to increment

    • increment: number | Long

      The amount to increment the counter by. If negative, it will be decremented instead

    Returns ReplicatedCounterMap<Key>

    This counter map

  • Decrement the counter at the given key by the given number.

    Parameters

    • key: Key

      The key for the counter to decrement

    • decrement: number | Long

      The amount to decrement the counter by. If negative, it will be incremented instead.

    Returns ReplicatedCounterMap<Key>

    This counter map

  • has(key: Key): boolean
  • Check whether this map contains a value of the given key.

    Parameters

    • key: Key

      The key to check

    Returns boolean

    True if this counter map contains a value for the given key

  • keys(): IterableIterator<Key>
  • toString(): string

Accessors

  • get size(): number

Generated using TypeDoc