|
From: <zep...@us...> - 2008-03-18 12:31:12
|
Revision: 398
http://flatpack.svn.sourceforge.net/flatpack/?rev=398&view=rev
Author: zepernick
Date: 2008-03-18 05:31:17 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
added getLong() to DataSet
Modified Paths:
--------------
trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java
trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java
Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java
===================================================================
--- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-03-18 12:30:58 UTC (rev 397)
+++ trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-03-18 12:31:17 UTC (rev 398)
@@ -92,15 +92,26 @@
double getDouble(final String column);
/**
- * Returns the interger value of a specified column
+ * Returns the integer value of a specified column
*
* @param column -
* Name of the column
* @exception NoSuchElementException
* @exception NumberFormatException
- * @return double
+ * @return int
*/
int getInt(final String column);
+
+ /**
+ * Returns the long value of a specified column
+ *
+ * @param column -
+ * Name of the column
+ * @exception NoSuchElementException
+ * @exception NumberFormatException
+ * @return long
+ */
+ long getLong(final String column);
/**
* Returns the date value of a specified column. This assumes the date is in
Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java
===================================================================
--- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-03-18 12:30:58 UTC (rev 397)
+++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-03-18 12:31:17 UTC (rev 398)
@@ -235,7 +235,17 @@
return Integer.parseInt(s);
}
+
+ public long getLong(final String column) {
+ final String s = getStringValue(column);
+ if (!strictNumericParse) {
+ return Long.parseLong(ParserUtils.stripNonLongChars(s));
+ }
+
+ return Long.parseLong(s);
+ }
+
/*
* (non-Javadoc)
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|