public int getValue ( String attributeName , int defaultValue ) { A attribute = getAt ( attributeName ) ; Object attributeValue = ( attribute == null ) ? null : attribute . getValue ( ) ; return ( attributeValue == null ) ? defaultValue : Integer . parseInt ( attributeValue . toString ( ) ) ; }
Convenience method to get the value of an attribute if it exists or a default value otherwise .