Skip to main content

HashMap

Defined in: structs/hashMap.ts:4

Simple bidirectional map used to translate between indexes and values.

Constructors

Constructor

new HashMap(raw): HashMap

Defined in: structs/hashMap.ts:13

Create a new map from an array of values.

Parameters

raw

(string | undefined)[]

Array where the index represents the lookup index.

Returns

HashMap

Accessors

length

Get Signature

get length(): number

Defined in: structs/hashMap.ts:51

Number of items stored in the map.

Returns

number

Methods

getIndex()

getIndex(value): number

Defined in: structs/hashMap.ts:37

Retrieve an index by value.

Parameters

value

string

Returns

number


getValue()

getValue(index): string | undefined

Defined in: structs/hashMap.ts:30

Retrieve a value by index.

Parameters

index

number

Returns

string | undefined


includes()

includes(value): boolean

Defined in: structs/hashMap.ts:44

Test if a value exists within the map.

Parameters

value

string

Returns

boolean


toString()

toString(): string

Defined in: structs/hashMap.ts:58

Convert the map to a string representation.

Returns

string