BIM.works SDKs - v3.0.0-b.115
    Preparing search index...

    QidSet represents a Set of Qid. The main reasons why this class exists and should be used are:

    • A regular Set can not handle custom objects such as Qid
    • The internal implementation of QidSet is a lot more efficient than a generic Set object (it can do so because it is aware of what type is stored)

    This object is Set-like (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects)

    The methods on this class are also as much as possible identical to that of the built-in Set class.

    Index

    Constructors

    • Returns QidSet

    • Parameters

      • iterable: Iterable<Qid>

      Returns QidSet

    Accessors

    • get first(): Qid

      Returns Qid

      The first Qid in this QidSet. Keep in mind that order in a QidSet is not guaranteed thus this method really should only be used in cases where the QidSet is of size 1

    • get size(): number

      Returns number

      The current size of this QidSet (number of Qids in it)

    • get empty(): QidSet

      Returns a reference to an empty QidSet which should be regarded a unmodifiable. This can be used to avoid allocations.

      Returns QidSet

    Methods

    • Returns IterableIterator<Qid>

    • Add a Qid to this set

      Parameters

      • qid: Qid

        The Qid to add

      Returns boolean

      Whether the Qid was added, only returns false when the Qid was already in the set

    • Add all the Qids of the given QidSet to this QidSet

      Parameters

      Returns number

      The number of Qids that were added (already existing ones not counted)

    • Add a Qid to this set. This method does the same thing as the add(qid) method but can be slightly more efficient in cases where no Qid is available

      Parameters

      • vid: string

        The Vid (Version UUID)

      • oid: number

        The Oid (Object ID)

      Returns boolean

      Whether the Qid was added, only returns false when the Qid was already in the set

    • Remove all Qids from this QidSet

      Returns void

    • A copy of this set

      Returns QidSet

    • Remove a Qid from this QidSet

      Parameters

      • qid: Qid

        The Qid to remove

      Returns boolean

      Whether the Qid was removed, returns false when the Qid did not exist in the QidSet

    • The difference() method of QidSet instances takes a QidSet and returns a new QidSet containing elements in this QidSet but not in the given QidSet.

      Parameters

      • other: QidSet

        The other QidSet to subtract

      Returns QidSet

    • Releases the bitmap memory (WebAssembly) behind this set; the set must not be used afterwards

      Returns void

    • The entries() method of QidSet instances returns a new set iterator object that contains an array of [qid, qid] for each element in this set. For QidSet objects there is no key like in QidMap objects. However, to keep the API similar to the QidMap object, each entry has the same value for its key and value here, so that an array [qid, qid] is returned.

      Returns Iterator<Qid, Qid, QidSet>

    • Create a new QidSet by filtering the current QidSet.

      Parameters

      • OptionalcallbackFn: (qid: Qid) => boolean

        A function that should return true for elements that should be included, when no callbackFn is passed all Qids will be included

      Returns QidSet

      A new QidSet with the filtered Qids

    • The forEach() method of QidSet instances executes a provided function once for each Qid in this set

      Parameters

      • callbackFn: (qid: Qid) => boolean
      • OptionalthisArg: unknown

      Returns void

    • A convenience method that extracts all the unique Vid's of the Qids in this QidSet

      Returns Set<string>

      A Set containing the unqiue Vid's in this QidSet

    • Check whether this QidSet contains the given Qid

      Parameters

      • qid: Qid

        The Qid to check

      Returns boolean

      Whether this QidSet contains the given Qid

    • Whether the set holds the object oid of version vid

      Parameters

      • vid: string
      • oid: number

      Returns boolean

    • Calculate the intersection of two QidSets; All Qid's that are in both QidSet.

      Parameters

      • other: QidSet

        The other QidSet

      Returns QidSet

      A new QidSet with the intersection of this QidSet and the other QidSet

    • Returns boolean

    • The keys() method of QidSet instances is an alias for the values() method.

      Returns Iterator<Qid, Qid, QidSet>

    • Moves the objects of version oldVid to newVid, for example after a version was replaced by its successor

      Parameters

      • oldVid: string
      • newVid: string

      Returns void

    • This set split per version: each subset holds only that version's objects

      Returns Map<string, QidSet>

    • The plain-JSON form the server binds as a query parameter (see QueryHelper.toParameterValues)

      Returns { oids: number[]; vid: string }[]

    • Generate a string that can be used in a BQL condition

      Example use: "buildingStorey.qid " + floorQids.toQidCondition() + " AND type != IFCSPACE"

      Returns string

    • Generates a string representation of this QidSet in the form of a comma-separated and per-Qid double-quoted string

      Example: A QidSet with 2 QIDs would be represented as: "227e071d-4909-4b5c-8d48-46f44d027c46-1", "227e071d-4909-4b5c-8d48-46f44d027c46-2"

      The returned String is usually used to plug into a String representation of a BQL (BIM.works Query Language) query, for example:

      GET attribute.Name WHERE qid IN ("227e071d-4909-4b5c-8d48-46f44d027c46-1", "227e071d-4909-4b5c-8d48-46f44d027c46-2")

      When allowCompact is enabled the same QidSet would be represented as: "227e071d-4909-4b5c-8d48-46f44d027c46"[1, 2], which is also valid in a BQL query

      Parameters

      • OptionalallowCompact: boolean

        Whether the implementation is allowed to use the compact representation, defaults to true

      Returns string

      A String representation of this QidSet

    • Union two QidSets

      Parameters

      Returns QidSet

      A new QidSet object containing elements which are in either this QidSet or in the other QidSet.

    • Union two QidSets, this QidSet is modified

      Parameters

      Returns QidSet

      This QidSet object containing elements which are in either this QidSet or in the other QidSet.

    • The values() method of QidSet instances returns a new set iterator object that contains the values for each element in this set.

      Returns Iterator<Qid, Qid, QidSet>

    • A new set holding one Qid

      Parameters

      • qid: string | Qid

      Returns QidSet

    • A set of the objects given per model, {versionUuid: oids}: the form API results (a BVL result's show, hide, select ...) send object sets in

      Parameters

      • qids: { [versionUuid: string]: Iterable<number, any, any> }

      Returns QidSet

    • Create a new QidSet by providing an Iterable, the values in the Iterable must be either:

      • Valid Qid Strings
      • Qid instances
      • JS Objects that have both the vid:string and oid:number properties

      Parameters

      • iterable: Iterable<string | object | Qid>

      Returns QidSet

      A QidSet of all the Qids in the Iterable