From: <pat...@us...> - 2010-01-06 21:18:16
|
Revision: 1011 http://cishell.svn.sourceforge.net/cishell/?rev=1011&view=rev Author: pataphil Date: 2010-01-06 21:18:10 +0000 (Wed, 06 Jan 2010) Log Message: ----------- * Moved IntegerParserWithDefault out of edu.iu.scipolicy.loader.isi.db.utilities.parser and into org.cishell.utilities. Added Paths: ----------- trunk/core/org.cishell.utilities/src/org/cishell/utilities/IntegerParserWithDefault.java Added: trunk/core/org.cishell.utilities/src/org/cishell/utilities/IntegerParserWithDefault.java =================================================================== --- trunk/core/org.cishell.utilities/src/org/cishell/utilities/IntegerParserWithDefault.java (rev 0) +++ trunk/core/org.cishell.utilities/src/org/cishell/utilities/IntegerParserWithDefault.java 2010-01-06 21:18:10 UTC (rev 1011) @@ -0,0 +1,13 @@ +package org.cishell.utilities; + +public class IntegerParserWithDefault { + public static final int DEFAULT = -1; + + public static int parse(String target) { + try { + return Integer.parseInt(target); + } catch (Exception e) { + return DEFAULT; + } + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |