HED JavaScript Library
    Preparing search index...

    A schema unit class.

    Hierarchy (View Summary)

    Index
    • Constructor.

      Parameters

      • name: string

        The name of this unit class.

      • description: string | undefined

        The description of this unit class.

      • booleanAttributes: Set<SchemaAttribute>

        The boolean attributes for this unit class.

      • valueAttributes: Map<SchemaAttribute, string[]>

        The value attributes for this unit class.

      • units: Map<string, SchemaUnit>

        The units for this unit class.

      Returns default

    _description: string | undefined

    The description of this schema entry.

    _name: string

    The name of this schema entry.

    _units: Map<string, SchemaUnit>

    The units for this unit class.

    booleanAttributeNames: Set<string>

    The set of boolean attribute names this schema entry has.

    booleanAttributes: Set<SchemaAttribute>

    The set of boolean attributes this schema entry has.

    valueAttributeNames: Map<string, string[]>

    The collection of value attribute names this schema entry has.

    valueAttributes: Map<SchemaAttribute, string[]>

    The collection of value attributes this schema entry has.

    IGNORED_ATTRIBUTES: Set<string> = ...

    The attributes ignored when comparing two declarations of an element: inLibrary names the declaring library and hedId differs between schemas by construction.

    • get defaultUnit(): any

      Get the default unit for this unit class.

      A listed unit wins; otherwise the unit that the default derives from (A for mA, Ohm for kOhm) is matched.

      Returns any

    • get description(): string | undefined

      The description of this schema entry.

      Returns string | undefined

    • get hasConversionFactors(): boolean

      Whether any unit of this unit class has a conversionFactor (none of the timeUnits of HED 8.0.0 does).

      Returns boolean

    • Determine if this schema unit class is equivalent to another schema unit class.

      The units are not compared: two declarations of a unit class may list different units, which are merged, and the units themselves are compared one by one by the parser.

      Parameters

      • other: any

        A schema unit class to compare with this one.

      Returns boolean

      Whether the other unit class is equivalent to this schema unit class.

    • Extract the unit class and remainder.

      Parameters

      • value: string

        The value part of a tag, possibly ending in a unit.

      • listedOnly: boolean = false

        Whether to match only unit names as listed in the schema (no plurals or modifiers).

      Returns [any, string | null, string]

      A tuple with the unit, unit string, and value string.

    • Retrieve a single value of a value attribute (by name) on this schema entry, throwing an error if more than one value exists.

      Parameters

      • attributeName: string

        The attribute whose value should be returned.

      Returns string | undefined

      The value of the attribute.

      If the attribute has more than one value.