public AttributeNode < AttributeMetadata , AttributeId > addChild ( AttributeId attribute ) { AttributeNode < AttributeMetadata , AttributeId > child ; if ( children == null ) { children = new HashMap <> ( ) ; child = new AttributeNode <> ( attribute , this ) ; children . put ( attribute , child ) ; rebuildChildrenArray ( ) ; } else { child = children . get ( attribute ) ; if ( child == null ) { child = new AttributeNode <> ( attribute , this ) ; children . put ( attribute , child ) ; rebuildChildrenArray ( ) ; } } return child ; }
Add a child node . If the child already exists it just increments its usage counter and returns the existing child .