From: Erik V. <ev...@us...> - 2009-08-30 18:13:57
|
Update of /cvsroot/rails/18xx/rails/util In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13009/rails/util Modified Files: Tag.java Log Message: Add floating point parsing Index: Tag.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Tag.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Tag.java 24 Dec 2008 14:51:39 -0000 1.9 --- Tag.java 30 Aug 2009 18:13:48 -0000 1.10 *************** *** 131,139 **** } ! public int getAttributeAsInteger(String name) throws ConfigurationException { ! return getAttributeAsInteger(name, 0); } public int[] getAttributeAsIntegerArray(String name, int[] defaultArray) throws ConfigurationException { --- 131,159 ---- } ! public float getAttributeAsFloat(String name) throws ConfigurationException { ! return getAttributeAsFloat(name, 0.0f); ! } ! ! public float getAttributeAsFloat(String name, float defaultValue) ! throws ConfigurationException { ! ! if (!parsed) parse(element); ! ! String value = attributes.get(name); ! if (value == null) return defaultValue; ! try { ! return Float.parseFloat(value); ! } catch (Exception e) { ! throw new ConfigurationException("Invalid floating point value: " + value, ! e); ! } } + public int getAttributeAsInteger(String name) throws ConfigurationException { + + return getAttributeAsInteger(name, 0); + } + public int[] getAttributeAsIntegerArray(String name, int[] defaultArray) throws ConfigurationException { |