addAttribute(attr, order) {
    if (this.getAttribute(attr.name))
      throw new Error("An attribute with the name " + attr.name + " is already declared.");

    if(attr.order == null) {
      order = typeof order == 'undefined'? this.declaredAttributes.length: order;
    } else {
      order = attr.order;
    }
    attr.init(this, order);

    this.declaredAttributes.push(attr);
    if (this._typeConstructor && this.name != 'Object')
      this._enhancer.enhanceProperty(this._typeConstructor, attr);
  }
/**
   * Adds an attribute to this type
   * @param {metamodel.Attribute} attr The attribute to add
   * @param {number=} order Position of the attribute
   */
Adds an attribute to this type
@param {metamodel.Attribute} attr The attribute to add
@param {number=} order Position of the attribute
Adds an attribute to this type @param { metamodel . Attribute } attr The attribute to add @param { number = } order Position of the attribute
addAttribute(attr, order) {
    if (this.getAttribute(attr.name))
      throw new Error("An attribute with the name " + attr.name + " is already declared.");
    if(attr.order == null) {
      order = typeof order == 'undefined'? this.declaredAttributes.length: order;
    } else {
      order = attr.order;
    }
    attr.init(this, order);
    this.declaredAttributes.push(attr);
    if (this._typeConstructor && this.name != 'Object')
      this._enhancer.enhanceProperty(this._typeConstructor, attr);
  }
addAttribute ( attr , order ) { if ( this . getAttribute ( attr . name ) ) throw new Error ( "An attribute with the name " + attr . name + " is already declared." ) ; if ( attr . order == null ) { order = typeof order == 'undefined' ? this . declaredAttributes . length : order ; } else { order = attr . order ; } attr . init ( this , order ) ; this . declaredAttributes . push ( attr ) ; if ( this . _typeConstructor && this . name != 'Object' ) this . _enhancer . enhanceProperty ( this . _typeConstructor , attr ) ; }
Adds an attribute to this type
 @param {metamodel.Attribute} attr The attribute to add
 @param {number=} order Position of the attribute
Adds an attribute to this type @param { metamodel . Attribute } attr The attribute to add @param { number = } order Position of the attribute