Options
All
  • Public
  • Public/Protected
  • All
Menu

HashSet

Hash Set - set uses Hashable.hashCode() to differentiate/distinguish elements. Also, depending on hashCode type (number or string) set uses either number comparison either string comparison (String.localeCompare)

This is extended, experimental version of Set implementing Observer pattern (Observable elements notify this - Observer Set about important changes which may affect order of elements or just structure of this Set)

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private _comparator

_comparator: Comparator<T>

_comparator

param
param

Protected _elements

_elements: T[] = []

_elements

Protected initialized

initialized: boolean = false

initialized

Static Readonly ACTION_ADD

ACTION_ADD: "ACTION_ADD" = "ACTION_ADD"

Types of actions

Static Readonly ACTION_CLEAR

ACTION_CLEAR: "ACTION_CLEAR" = "ACTION_CLEAR"

Static Readonly ACTION_DELETE

ACTION_DELETE: "ACTION_DELETE" = "ACTION_DELETE"

Static Readonly ACTION_REPLACE

ACTION_REPLACE: "ACTION_REPLACE" = "ACTION_REPLACE"

Accessors

elements

  • get elements(): T[]
  • set elements(elements: T[]): void

Methods

[Symbol.iterator]

  • [Symbol.iterator](): any

Protected actionAdd

  • actionAdd(elements: T[]): void

Protected actionClear

  • actionClear(): this

Protected actionDelete

  • actionDelete(elements: T[]): void

add

  • add(...element: T[]): this

Protected afterAction

  • afterAction(fName: string, elements: T | T[]): void

Protected beforeAction

  • beforeAction(fName: string, elements?: T | T[]): void

clear

  • clear(): this

delete

  • delete(...elements: T[]): this

has

  • has(element: T): boolean

hasAll

  • hasAll(...element: T[]): boolean

hasNot

  • hasNot(element: T): boolean

Protected initComparator

  • initComparator(element: T): void

Protected isUnique

  • isUnique(element: T): boolean

refresh

  • refresh(): void

Protected replaceAndPreventHook

  • replaceAndPreventHook(elements: T[]): void

Protected replaceWithHook

  • replaceWithHook(elements: T[]): void

size

  • size(): number

toString

  • toString(): string

update

  • update(element: T): void

Static isHashableNumType

  • isHashableNumType(value: any): value is HashableReturnNum

Static isHashableStrType

  • isHashableStrType(value: any): value is HashableReturnStr

Legend

  • Constructor
  • Method
  • Accessor
  • Inherited constructor
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Static property
  • Static method
  • Method
  • Private property

Generated using TypeDoc