private void initAttributes ( final AbstractAttribute ... attributes ) { if ( attributes == null || attributes . length == 0 ) { return ; } // initial capacity must be greater than 1 instead of 1 // because the load factor is 0.75f // possible initial attributes on a tag may be maximum 8 // they may be id, name, class, value, style, onchange, placeholder attributesMap = new ConcurrentHashMap <> ( 8 ) ; for ( final AbstractAttribute attribute : attributes ) { attributesMap . put ( attribute . getAttributeName ( ) , attribute ) ; } this . attributes = new AbstractAttribute [ attributesMap . size ( ) ] ; attributesMap . values ( ) . toArray ( this . attributes ) ; }
initializes attributes in this . attributes and also in attributesMap . this should be called only once per object .