Java tutorial
//package com.java2s; import org.xml.sax.Attributes; public class Main { public static final float getFloatAttribute(final Attributes pAttributes, final String pAttributeName, final float pDefaultValue) { final String value = pAttributes.getValue("", pAttributeName); return (value != null) ? Float.parseFloat(value) : pDefaultValue; } }