code: public float getAsFloat(String attribute) {
  		String value = getAttribute(attribute);
  		if (value == null) {
  			return 0;
  		}
  		
  		try {
  			return Float.parseFloat(value);
  		} catch (NumberFormatException e) {
  			throw new RuntimeException("Attribute "+attribute+" is not specified as a float:"+getAttribute(attribute));			
  		}
  	}
docs: Get an attribute converted to a float value
  
  @param attribute The attribute to retrieve
  @return The float value derived from the attribute