Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HashSet<T>

Type parameters

  • T

Hierarchy

  • HashSet

Index

Constructors

constructor

  • new HashSet(hash: (value: T) => string): HashSet
  • Parameters

    • hash: (value: T) => string
        • (value: T): string
        • Parameters

          • value: T

          Returns string

    Returns HashSet

Accessors

size

  • get size(): number
  • Returns number

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<T>
  • Returns IterableIterator<T>

add

  • add(...values: T[]): this
  • Parameters

    • Rest ...values: T[]

    Returns this

addAll

  • addAll(...valuesIterables: Array<Iterable<T> | Falsy>): this
  • Parameters

    • Rest ...valuesIterables: Array<Iterable<T> | Falsy>

    Returns this

clear

  • clear(): this
  • Returns this

entries

  • entries(): IterableIterator<[string, T]>
  • Returns IterableIterator<[string, T]>

entryStream

  • entryStream()

forEach

  • forEach(consumer: (value: T, key: string) => any): void
  • Parameters

    • consumer: (value: T, key: string) => any
        • (value: T, key: string): any
        • Parameters

          • value: T
          • key: string

          Returns any

    Returns void

get

  • get(hash: string): undefined | T
  • Parameters

    • hash: string

    Returns undefined | T

has

  • has(...values: T[]): boolean
  • Parameters

    • Rest ...values: T[]

    Returns boolean

hasAll

  • hasAll(...valuesIterables: Array<Iterable<T> | Falsy>): boolean
  • Parameters

    • Rest ...valuesIterables: Array<Iterable<T> | Falsy>

    Returns boolean

intersects

  • intersects(set: HashSet<T>): boolean
  • Parameters

    Returns boolean

keyStream

  • keyStream(): Stream<string>
  • Returns Stream<string>

keys

  • keys(): IterableIterator<string>
  • Returns IterableIterator<string>

remove

  • remove(...values: T[]): boolean
  • Parameters

    • Rest ...values: T[]

    Returns boolean

removeAll

  • removeAll(...valuesIterables: Array<Iterable<T> | Falsy>): boolean
  • Parameters

    • Rest ...valuesIterables: Array<Iterable<T> | Falsy>

    Returns boolean

replace

  • replace(...values: T[]): this
  • Adds the given values to the set, first removing any values that share the same hashes.

    Parameters

    • Rest ...values: T[]

    Returns this

replaceAll

  • replaceAll(...valuesIterables: Array<Iterable<T> | Falsy>): this
  • Adds the given values to the set, first removing any values that share the same hashes.

    Parameters

    • Rest ...valuesIterables: Array<Iterable<T> | Falsy>

    Returns this

retainNot

  • retainNot(value: T): boolean
  • Parameters

    • value: T

    Returns boolean

toArray

  • toArray(): T[]
  • Returns T[]

toggle

  • toggle(has: boolean, ...values: T[]): this
  • Parameters

    • has: boolean
    • Rest ...values: T[]

    Returns this

toggleAll

  • toggleAll(has: boolean, ...valuesIterables: Array<Iterable<T> | Falsy>): this
  • Parameters

    • has: boolean
    • Rest ...valuesIterables: Array<Iterable<T> | Falsy>

    Returns this

valueStream

  • valueStream(): Stream<T>
  • Returns Stream<T>

values

  • values(): IterableIterator<T>
  • Returns IterableIterator<T>

Generated using TypeDoc