Add ability to parse floats.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@643 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -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;
|
package com.samskivert.util;
|
||||||
|
|
||||||
@@ -62,10 +62,10 @@ public class ValueMarshaller
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// and integers
|
// and floats
|
||||||
_parsers.put(Integer.class, new Parser() {
|
_parsers.put(Float.TYPE, new Parser() {
|
||||||
public Object parse (String source) throws Exception {
|
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
|
// and int arrays
|
||||||
_parsers.put(INT_ARRAY_PROTOTYPE.getClass(), new Parser() {
|
_parsers.put(INT_ARRAY_PROTOTYPE.getClass(), new Parser() {
|
||||||
public Object parse (String source) throws Exception {
|
public Object parse (String source) throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user