Reference·JavaScript · @bimworks/jssdkJavaScript

QidMap

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class QidMap<V>

QidMap represents a Set of mappings from Qid to some other object. It is like JavaScript Map, but specifically for keys of the Qid

Type parameters#

Name Constraint Description
V ``

Members#

Member Kind Description
constructor Method Create a new QidMap
constructor Method Create a new QidMap by providing an existing mapping
keys Method
size Method
[iterator] Method
clear Method The clear() method of QidMap instances removes all Qid mappings from this map.
delete Method The delete() method of QidMap instances removes the specified Qid mapping from this map by qid.
entries Method
forEach Method
get Method
getByVidOid Method
has Method The has() method of QidMap instances returns a boolean indicating whether an element with the specified qid exists in this map or not.
set Method The set() method of QidMap instances adds or updates an entry in this map with a specified Qid and a value.
setByVidOid Method The setByVidOid() method of QidMap instances adds or updates an entry in this map with a specified Qid (given as Vid + Oid) and a value. This method should o…
union Method Combine two QidMaps, when duplicate Qid entries exist in both QidMap, the values of other are used
unionInline Method Combine two QidMaps, when duplicate Qid entries exist in both QidMap, the values of other are used
values Method
ofIterable Method

constructor#

TypeScript#
constructor()

Create a new QidMap

Type parameters#

Name Constraint Description
V ``

constructor#

TypeScript#
constructor(iterable: Iterable<[string | Qid | { oid: number; vid: string }, V]>)

Create a new QidMap by providing an existing mapping

Type parameters#

Name Constraint Description
V ``

Parameters#

Name Type Description
iterable Iterable<[string | Qid | { oid: number; vid: string }, V]>

keys#

TypeScript#
keys(): Iterator<Qid, V, QidMap<V>>

size#

TypeScript#
size(): number

Returns#

The amount of mappings in this QidMap

[iterator]#

TypeScript#
[iterator](): IterableIterator<[Qid, V]>

clear#

TypeScript#
clear(): void

The clear() method of QidMap instances removes all Qid mappings from this map.

delete#

TypeScript#
delete(qid: Qid): boolean

The delete() method of QidMap instances removes the specified Qid mapping from this map by qid.

Parameters#

Name Type Description
qid Qid

entries#

TypeScript#
entries(): Iterator<Qid, V, QidMap<V>>

forEach#

TypeScript#
forEach(callbackFn: (value: V, qid: Qid, set: QidSet) => boolean, thisArg?: unknown): void

Parameters#

Name Type Description
callbackFn (value: V, qid: Qid, set: QidSet) => boolean
thisArg unknown

get#

TypeScript#
get(qid: Qid): V

Parameters#

Name Type Description
qid Qid The Qid to get the value for

Returns#

The linked object or null when there is no mapping for the Qid

getByVidOid#

TypeScript#
getByVidOid(vid: string, oid: number): V

Parameters#

Name Type Description
vid string
oid number

has#

TypeScript#
has(qid: Qid): boolean

The has() method of QidMap instances returns a boolean indicating whether an element with the specified qid exists in this map or not.

Parameters#

Name Type Description
qid Qid

set#

TypeScript#
set(qid: Qid, value: V): boolean

The set() method of QidMap instances adds or updates an entry in this map with a specified Qid and a value.

Parameters#

Name Type Description
qid Qid The Qid for which to set the value
value V The value to set

setByVidOid#

TypeScript#
setByVidOid(vid: string, oid: number, value: V): boolean

The setByVidOid() method of QidMap instances adds or updates an entry in this map with a specified Qid (given as Vid + Oid) and a value. This method should only be used when no Qid is available, and in those cases it will be slighly faster than first creating a Qid

Parameters#

Name Type Description
vid string The Vid for which to set the value
oid number The Oid for which to set the value
value V The value to set

union#

TypeScript#
union(other: QidMap<V>): QidMap<V>

Combine two QidMaps, when duplicate Qid entries exist in both QidMap, the values of other are used

Parameters#

Name Type Description
other QidMap<V>

Returns#

A new QidMap

unionInline#

TypeScript#
unionInline(other: QidMap<V>): QidMap<V>

Combine two QidMaps, when duplicate Qid entries exist in both QidMap, the values of other are used

Parameters#

Name Type Description
other QidMap<V>

Returns#

This QidMap, with the entries from other QidMap added (and overriding any keys of this)

values#

TypeScript#
values(): Iterator<Qid, Qid, QidMap<V>>

ofIterable#

TypeScript#
static ofIterable<V>(iterable: Iterable<[string | Qid | { oid: number; vid: string }, V]>): QidMap<V>

Type parameters#

Name Constraint Description
V ``

Parameters#

Name Type Description
iterable Iterable<[string | Qid | { oid: number; vid: string }, V]>