public Attribute addAttribute ( QuotedID id , int type , String typeName , boolean canNull ) { Attribute att = new Attribute ( this , new QualifiedAttributeID ( getID ( ) , id ) , attributes . size ( ) + 1 , type , typeName , canNull , typeMapper . getTermType ( type , typeName ) ) ; //check for duplicate names (put returns the previous value) Attribute prev = attributeMap . put ( id , att ) ; if ( prev != null ) throw new IllegalArgumentException ( "Duplicate attribute names" ) ; attributes . add ( att ) ; return att ; }
creates a new attribute