public int addAttribute ( String attrId ) { if ( attributeMapper . containsKey ( attrId ) ) { return attributeMapper . get ( attrId ) ; // attribute-id has existed } attributeMapper . put ( attrId , varIdCounter ) ; varIdCounter ++ ; return attributeMapper . get ( attrId ) ; }
Add a new attribute - id to the map return the variable id . If the attribute existed throws exception