Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AttributeCollection

Describes an accessible collection of attributes, that is attached to an item that implements IAttributeItem. The collection offers a wide range of helper functions to allow a type safe access to the attributes values. You can iterate over the collection with a for ... of loop.

Hierarchy

  • AttributeCollection

Index

Constructors

constructor

Properties

_attributes

_attributes: Map<number, Attribute>

Accessors

keys

  • get keys(): Iter<number>
  • Gets an iterator over the available keys in the collection.

    Returns Iter<number>

length

  • get length(): number
  • Gets the number of attributes stored in the collection.

    Returns number

Methods

__@iterator

  • Returns an iterator over all attributes.

    Returns Iterator<Attribute>

getAttribute

  • getAttribute(key: number): Attribute | undefined
  • Returns the attribute with the specified key, or undefined in case there is no attribute with this key.

    Parameters

    • key: number

      The key of the attribute.

    Returns Attribute | undefined

getCatalogIndex

  • getCatalogIndex(key: number): number | undefined
  • Returns the value of the attribute with the specified key as integral number, representing the key of a catalog entry, or undefined in case there is no attribute with this key or the attributes value can't be converted into an integral number representation.

    Parameters

    • key: number

      The key of the attribute.

    Returns number | undefined

getDateValue

  • getDateValue(key: number): Date | undefined
  • Returns the value of the attribute with the specified key as Date, or undefined in case there is no attribute with this key or the attributes value can't be converted into a Date representation.

    Parameters

    • key: number

      The key of the attribute.

    Returns Date | undefined

getFloatValue

  • getFloatValue(key: number): number | undefined
  • Returns the value of the attribute with the specified key as floating point number, or undefined in case there is no attribute with this key or the attributes value can't be converted into a floating point number representation.

    Parameters

    • key: number

      The key of the attribute.

    Returns number | undefined

getIntegerValue

  • getIntegerValue(key: number): number | undefined
  • Returns the value of the attribute with the specified key as integral number, or undefined in case there is no attribute with this key or the attributes value can't be converted into an integral number representation.

    Parameters

    • key: number

      The key of the attribute.

    Returns number | undefined

getNumericValue

  • getNumericValue(key: number): number | undefined
  • Returns the value of the attribute with the specified key as number, or undefined in case there is no attribute with this key or the attributes value can't be converted into a number representation.

    Parameters

    • key: number

      The key of the attribute.

    Returns number | undefined

getStringValue

  • getStringValue(key: number): string | undefined
  • Returns the value of the attribute with the specified key as string, or undefined in case there is no attribute with this key.

    Parameters

    • key: number

      The key of the attribute.

    Returns string | undefined

getValue

  • getValue(key: number): string | number | Date | undefined
  • Returns the value of the attribute with the specified key, or undefined in case there is no attribute with this key.

    Parameters

    • key: number

      The key of the attribute.

    Returns string | number | Date | undefined

iter

  • Returns an iter over all attributes.

    Returns Iter<Attribute>

Generated using TypeDoc