QidMap
Class in @bimworks/jssdk.
API catalogue · @bimworks/jssdk · Class
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#
constructor()Create a new QidMap
Type parameters#
| Name | Constraint | Description |
|---|---|---|
V |
`` |
constructor#
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#
size#
size(): numberReturns#
The amount of mappings in this QidMap
[iterator]#
clear#
clear(): voidThe clear() method of QidMap instances removes all Qid mappings from this map.
delete#
The delete() method of QidMap instances removes the specified Qid mapping from this map by qid.
Parameters#
| Name | Type | Description |
|---|---|---|
qid |
Qid |
entries#
forEach#
forEach(callbackFn: (value: V, qid: Qid, set: QidSet) => boolean, thisArg?: unknown): voidParameters#
| Name | Type | Description |
|---|---|---|
callbackFn |
(value: V, qid: Qid, set: QidSet) => boolean |
|
thisArg |
unknown |
get#
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#
getByVidOid(vid: string, oid: number): VParameters#
| Name | Type | Description |
|---|---|---|
vid |
string |
|
oid |
number |
has#
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#
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#
setByVidOid(vid: string, oid: number, value: V): booleanThe 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#
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#
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#
ofIterable#
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]> |