Class CharMap<T>

A map from characters to generic values.

The map guarantees that there are no adjacent character ranges that map to the equal values, will always be iterated as one character range. The equality of values is given by JavaScript's strict equality operator (===).

Type Parameters

  • T

Hierarchy

  • CharMap

Implements

Constructors

Accessors

Methods

  • Returns IterableIterator<[CharRange, T]>

  • Deletes all entries in the map.

    Returns void

  • Parameters

    Returns boolean

  • Deletes all characters in the given range.

    This is equivalent to [...range].forEach(char => this.delete(char)).

    Parameters

    Returns void

  • Returns the value associated with the given character of undefined if the character is not key in the map.

    Parameters

    Returns undefined | T

  • Returns whether the given character is a key in the map.

    Parameters

    Returns boolean

  • Returns whether every character in the given range is a key in the map.

    This is equivalent to: [...chars].every(char => this.has(char)).

    Parameters

    Returns boolean

  • Returns whether some character in the given range is a key in the map.

    This is equivalent to: [...chars].some(char => this.has(char)).

    Parameters

    Returns boolean

  • Parameters

    • char: Char
    • value: T

    Returns void

  • Sets the value for all characters in the given character set.

    This is equivalent to [...charSet.characters()].forEach(char => this.set(char, value)).

    Parameters

    Returns void

  • Sets the value for all characters in the given range.

    This is equivalent to [...chars].forEach(char => this.set(char, value)).

    Parameters

    Returns void