HED JavaScript Library
    Preparing search index...

    A parsed HED tag.

    Hierarchy (View Summary)

    Index
    • Constructor.

      Parameters

      • tagSpec: TagSpec

        The token for this tag.

      • hedSchemas: Schemas

        The collection of HED schemas.

      Returns default

      If tag conversion or parsing fails.

    canonicalTag: string

    The canonical form of the HED tag.

    formattedTag: string

    The formatted canonical version of the HED tag.

    originalBounds: number[]

    The bounds of the HED tag in the original HED string.

    originalTag: string

    The original pre-parsed version of the HED tag.

    schema: Schema

    The HED schema this tag belongs to.

    • get hasUnitClass(): boolean

      Checks if this HED tag has the unitClass attribute.

      The unit classes belong to the value-taking form of the tag, which keeps them as entries rather than as an attribute, so hasAttribute('unitClass') is false for every tag.

      Returns boolean

      Whether this HED tag has the unitClass attribute.

    • get normalized(): string

      Return the normalized version of this tag.

      Returns string

      The normalized version of this tag.

    • get remainder(): string

      The remaining part of the tag after the portion actually in the schema.

      Returns string

    • get schemaTag(): SchemaTag

      Get the schema tag object for this tag.

      Returns SchemaTag

      The schema tag object for this tag.

    • get splitValue(): string | null

      The part of a two-part value after the name (the "#" or value of Definition, Def and Def-expand), or null.

      A tag without a value never sets the backing field, so this returns null for it, as declared.

      Returns string | null

    • get takesValue(): boolean

      Checks if this HED tag has the takesValue attribute.

      Returns boolean

      Whether this HED tag has the takesValue attribute.

    • get unitClasses(): SchemaUnitClass[]

      Get the unit classes for this HED tag.

      Returns SchemaUnitClass[]

      The unit classes for this HED tag.

    • get value(): string

      The value of the tag, or an empty string for a tag without a value.

      A tag without a value never sets the backing field, so this returns '' for it, as declared.

      Returns string

    • Split the value of a tag whose value has two parts (the valueForms of the reserved-tag file).

      Parameters

      • remainder: string

        The remainder of the tag string after schema tag.

      • reserved: ReservedChecker

        The reserved-tag checker.

      Returns any[]

      • [string, string|null] the name and the part after it, or [remainder, null] for other tags.
    • Separate the remainder of the tag into three parts.

      Parameters

      • schemaTag: SchemaTag

        The part of the tag that is in the schema.

      • remainder: string

        The leftover part.

      Returns any[]

      • [SchemaUnit, string, string] representing the actual Unit, the unit string and the value string.
      • If parsing the remainder section fails.
    • Check if value is a valid value for this tag.

      Parameters

      • value: string

        The value to be checked.

      Returns string

      An empty string if value is value, otherwise an indication of failure.

    • Determine if this HED tag is equivalent to another HED tag.

      Note: HED tags are deemed equivalent if they have the same schema and normalized tag string.

      Parameters

      • other: default

        A HED tag to compare with this one.

      Returns boolean

      Whether the other tag is equivalent to this HED tag.

    • Nicely format this tag.

      Parameters

      • long: boolean = true

        Whether the tags should be in long form.

      Returns string

      • The nicely formatted version of this tag.
    • Determine whether this tag has a given attribute.

      Parameters

      • attribute: string

        An attribute name.

      Returns boolean

      Whether this tag has the named attribute.

    • Convert this tag's value to the default unit of its unit class.

      A value written without a unit is taken to be in the default unit already; a numeric value of a tag that has no unit class is returned unchanged. A placeholder with unitClass=anyUnits has no default unit, so its value converts only when a unit is written.

      In a unit class none of whose units has a conversionFactor (timeUnits in HED 8.0.0), an unmodified form of the default unit or of an SI unit of the class (s, second, seconds) converts with factor 1 (specification 3.2.8.4); a modified form (ms) or another unit (minute) does not convert.

      Returns number | null

      The value in default units, or null if the tag takes no value, the value is not numeric, the unit is invalid, the unit has no conversionFactor (such as month or year), or the value is a bare number on an anyUnits placeholder.