From d9f21d2b20957c462b25f20dc9220857a13da79a Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 8 Mar 2002 06:13:21 +0000 Subject: [PATCH] Add ability to parse floats. git-svn-id: https://samskivert.googlecode.com/svn/trunk@643 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/util/ValueMarshaller.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/ValueMarshaller.java b/projects/samskivert/src/java/com/samskivert/util/ValueMarshaller.java index 33663d30..bd680790 100644 --- a/projects/samskivert/src/java/com/samskivert/util/ValueMarshaller.java +++ b/projects/samskivert/src/java/com/samskivert/util/ValueMarshaller.java @@ -1,5 +1,5 @@ // -// $Id: ValueMarshaller.java,v 1.4 2002/03/08 02:40:02 mdb Exp $ +// $Id: ValueMarshaller.java,v 1.5 2002/03/08 06:13:21 mdb Exp $ package com.samskivert.util; @@ -62,10 +62,10 @@ public class ValueMarshaller } }); - // and integers - _parsers.put(Integer.class, new Parser() { + // and floats + _parsers.put(Float.TYPE, new Parser() { public Object parse (String source) throws Exception { - return Integer.valueOf(source); + return Float.valueOf(source); } }); @@ -76,6 +76,13 @@ public class ValueMarshaller } }); + // and integers + _parsers.put(Integer.class, new Parser() { + public Object parse (String source) throws Exception { + return Integer.valueOf(source); + } + }); + // and int arrays _parsers.put(INT_ARRAY_PROTOTYPE.getClass(), new Parser() { public Object parse (String source) throws Exception {