Class SortedMap<K, V>

A SortedMap is a map that holds key value pairs ordered by keys. Any primitive value (and objects that implement Comparable or Ordered interfaces) can be used as keys or values.

See

Template

V

Type Parameters

  • K

  • V

Hierarchy

Constructors

  • Creates a new SortedMap object.

    Type Parameters

    • K

    • V

    Parameters

    • Optional iterable: Iterable<[K, V]>

      Initialize the map with entries.

    • Optional compareFn: any

      The compare function to sort keys.

    Returns SortedMap<K, V>

Accessors

  • get size(): number
  • Returns the total key/value pairs in the tree.

    Returns

    Returns number

Methods

  • Returns true if the key existed in the map and was removed.

    Returns

    true if key was removed, otherwise false.

    Parameters

    • item: K

    Returns boolean

  • Returns true if the key exists in the map.

    Returns

    true if key is found, otherwise false.

    Parameters

    • key: K

    Returns boolean

Generated using TypeDoc