Class CoordinateSet

data-structure-typed

Author

Tyler Zeng

Copyright

Copyright (c) 2022 Tyler Zeng zrwusa@gmail.com

License

MIT License

Hierarchy

  • Set<any>
    • CoordinateSet

Constructors

Properties

[toStringTag]: string
_joint: string = '_'
size: number

Returns

the number of (unique) elements in Set.

[species]: SetConstructor

Accessors

Methods

  • Iterates over values in the set.

    Returns IterableIterator<any>

  • The "add" function overrides the parent class's "add" function by joining the elements of the input array with a specified delimiter before calling the parent class's "add" function.

    Parameters

    • value: number[]

      An array of numbers

    Returns CoordinateSet

    The overridden add method is returning the result of calling the add method of the superclass (super.add) with the joined string representation of the value array (value.join(this._joint)).

  • Returns void

  • The function overrides the delete method and deletes an element from a Set by joining the elements of the input array with a specified joint and then calling the delete method of the parent class.

    Parameters

    • value: number[]

      An array of numbers

    Returns boolean

    The delete method is returning the result of calling the delete method of the superclass, with the value array joined together using the _joint property.

  • Returns an iterable of [v,v] pairs for every value v in the set.

    Returns IterableIterator<[any, any]>

  • Executes a provided function once per each value in the Set object, in insertion order.

    Parameters

    • callbackfn: ((value, value2, set) => void)
        • (value, value2, set): void
        • Parameters

          • value: any
          • value2: any
          • set: Set<any>

          Returns void

    • Optional thisArg: any

    Returns void

  • The "has" function overrides the "has" method of the superclass and checks if a value exists in an array after joining its elements with a specified separator.

    Parameters

    • value: number[]

      The parameter "value" is an array of numbers.

    Returns boolean

    The overridden has method is returning the result of calling the has method of the superclass, passing in the joined value as an argument.

  • Despite its name, returns an iterable of the values in the set.

    Returns IterableIterator<any>

  • Returns an iterable of values in the set.

    Returns IterableIterator<any>

Generated using TypeDoc