net.sf.flatpack
Interface DataSet

All Known Implementing Classes:
BuffReaderDataSet, DefaultDataSet

public interface DataSet


Method Summary
 void absolute(int localPointer)
          Sets the absolute position of the record pointer
 void clearAll()
          Clears both the errors and rows from memory
 void clearErrors()
          Clears out the parse errors from memory
 void clearRows()
          Clears out the rows in memory from the last parse.
 boolean contains(java.lang.String column)
          Does this DataSet contain a column with the given name?
 java.math.BigDecimal getBigDecimal(java.lang.String column)
          Returns the BigDecimal value of a specified column
 java.lang.String[] getColumns()
          Returns a String array of column names in the DataSet.
 java.lang.String[] getColumns(java.lang.String recordID)
          Returns a String array of column names in the DataSet for a given id
 java.util.Date getDate(java.lang.String column)
          Returns the date value of a specified column.
 java.util.Date getDate(java.lang.String column, java.text.SimpleDateFormat sdf)
          Returns the date value of a specified column.
 double getDouble(java.lang.String column)
          Returns the double value of a specified column
 int getErrorCount()
          Returns total number of records which contained a parse error in the file.
 java.util.List getErrors()
          Returns A Collection Of DataErrors that happened during processing
 int getIndex()
          Returns the index the pointer is on for the array
 int getInt(java.lang.String column)
          Returns the interger value of a specified column
 long getLong(java.lang.String column)
          Returns the long value of a specified column
 java.lang.Object getObject(java.lang.String column, java.lang.Class classToConvertTo)
          Returns the value of the column with the type of object specified
 java.lang.String getRawData()
           
 int getRowCount()
          Returns the total number of rows parsed in from the file
 int getRowNo()
          Returns the line number the pointer is on.
 java.lang.String getString(java.lang.String column)
          Returns the string value of a specified column
 void goBottom()
          Goes to the last record in the dataset
 void goTop()
          Goes to the top of the data set.
 boolean isAnError(int lineNo)
          Returns true or false as to whether or not the line number contains an error.
 boolean isRecordID(java.lang.String recordID)
          Checks to see if the row has the given id
 boolean isRowEmpty()
          Checks to see if there was no data on the row which was parsed.
 boolean next()
          Moves to the next record in the set.
 void orderRows(OrderBy ob)
          Orders the data by column(s) specified.
 boolean previous()
          Moves back to the previous record in the set return true if move was a success, false if not
 void remove()
          Removes a row from the dataset.
 void setLowerCase()
          Sets data in the DataSet to lowercase
 void setPZConvertProps(java.util.Properties props)
          Sets the properties from the pzconvert.properties file.
 void setStrictNumericParse(boolean strictNumericParse)
          Setting this to True will parse text as is and throw a NumberFormatException.
 void setUpperCase()
          Sets data in the DataSet to uppercase
 void setValue(java.lang.String column, java.lang.String value)
          Changes the value of the given column only for the given row which the pointer is currently sitting on.
 

Method Detail

goTop

void goTop()
Goes to the top of the data set. This will put the pointer one record before the first in the set. Next() will have to be called to get the first record after this call.


goBottom

void goBottom()
Goes to the last record in the dataset


next

boolean next()
Moves to the next record in the set. Returns true if move was a success, false if not

Returns:
boolean

previous

boolean previous()
Moves back to the previous record in the set return true if move was a success, false if not

Returns:
boolean

getString

java.lang.String getString(java.lang.String column)
Returns the string value of a specified column

Parameters:
column - - Name of the column
Returns:
String
Throws:
java.util.NoSuchElementException

getDouble

double getDouble(java.lang.String column)
Returns the double value of a specified column

Parameters:
column - - Name of the column
Returns:
double
Throws:
java.util.NoSuchElementException
java.lang.NumberFormatException

getBigDecimal

java.math.BigDecimal getBigDecimal(java.lang.String column)
Returns the BigDecimal value of a specified column

Parameters:
column - - Name of the column
Returns:
BigDecimal
Throws:
java.util.NoSuchElementException
java.lang.NumberFormatException

getInt

int getInt(java.lang.String column)
Returns the interger value of a specified column

Parameters:
column - - Name of the column
Returns:
double
Throws:
java.util.NoSuchElementException
java.lang.NumberFormatException

getLong

long getLong(java.lang.String column)
Returns the long value of a specified column

Parameters:
column - - Name of the column
Returns:
long
Throws:
java.util.NoSuchElementException
java.lang.NumberFormatException

getDate

java.util.Date getDate(java.lang.String column)
                       throws java.text.ParseException
Returns the date value of a specified column. This assumes the date is in yyyyMMdd. If your date is not in this format, see getDate(String,SimpleDateFormat) Will return "null" on empty Strings

Parameters:
column - - Name of the column
Returns:
Date
Throws:
java.text.ParseException

getDate

java.util.Date getDate(java.lang.String column,
                       java.text.SimpleDateFormat sdf)
                       throws java.text.ParseException
Returns the date value of a specified column. This should be used if the date is NOT in yyyyMMdd format. The SimpleDateFormat object will specify what kind of format the date is in. Will return "null" on empty Strings

Parameters:
column - - Name of the column
sdf - - SimpleDateFormat of the date
Returns:
Date
Throws:
java.text.ParseException
See Also:
SimpleDateFormat

getObject

java.lang.Object getObject(java.lang.String column,
                           java.lang.Class classToConvertTo)
Returns the value of the column with the type of object specified

Parameters:
column - Name of the column
classToConvertTo - Class type to convert to
Returns:
Object Value of the column in the specified object

getColumns

java.lang.String[] getColumns()
Returns a String array of column names in the DataSet. This will assume 'detail' ID.

Returns:
String[]

getColumns

java.lang.String[] getColumns(java.lang.String recordID)
Returns a String array of column names in the DataSet for a given id

Parameters:
recordID -
Returns:
String[]

getRowNo

int getRowNo()
Returns the line number the pointer is on. These are the actual line numbers from the flat file, before any sorting.

Returns:
int
Throws:
java.util.NoSuchElementException
java.lang.NumberFormatException

getErrors

java.util.List getErrors()
Returns A Collection Of DataErrors that happened during processing

Returns:
Vector

remove

void remove()
Removes a row from the dataset. Once the row is removed the pointer will be sitting on the record previous to the deleted row.


getIndex

int getIndex()
Returns the index the pointer is on for the array

Returns:
int

getRowCount

int getRowCount()
Returns the total number of rows parsed in from the file

Returns:
int - Row Count

getErrorCount

int getErrorCount()
Returns total number of records which contained a parse error in the file.

Returns:
int - Record Error Count

isAnError

boolean isAnError(int lineNo)
Returns true or false as to whether or not the line number contains an error. The import will skip the line if it contains an error and it will not be processed

Parameters:
lineNo - - int line number
Returns:
boolean

orderRows

void orderRows(OrderBy ob)
Orders the data by column(s) specified. This will reposition the cursor to the top of the DataSet when executed. This is currently not supported when specying elements in the mapping. An exception will be thrown if this situation occurs

Parameters:
ob - - OrderBy object
See Also:
OrderBy, OrderColumn

setLowerCase

void setLowerCase()
Sets data in the DataSet to lowercase


setUpperCase

void setUpperCase()
Sets data in the DataSet to uppercase


isRecordID

boolean isRecordID(java.lang.String recordID)
Checks to see if the row has the given id

Parameters:
recordID -
Returns:
boolean

absolute

void absolute(int localPointer)
Sets the absolute position of the record pointer

Parameters:
localPointer - - int
Throws:
java.lang.IndexOutOfBoundsException

setStrictNumericParse

void setStrictNumericParse(boolean strictNumericParse)
Setting this to True will parse text as is and throw a NumberFormatException. Setting to false, which is the default, will remove any non numeric character from the field. The remaining numeric chars's will be returned. If it is an empty string,or there are no numeric chars, 0 will be returned for getInt() and getDouble()

Parameters:
strictNumericParse - The strictNumericParse to set.

setPZConvertProps

void setPZConvertProps(java.util.Properties props)
Sets the properties from the pzconvert.properties file. This file specifies the PZConverter implementation to use for a particular class

Parameters:
props - Property mapping for String to Object conversion

setValue

void setValue(java.lang.String column,
              java.lang.String value)
Changes the value of the given column only for the given row which the pointer is currently sitting on.

Parameters:
column - Column name to set the value for
value - Value to change the column to

clearRows

void clearRows()
Clears out the rows in memory from the last parse.


clearErrors

void clearErrors()
Clears out the parse errors from memory


clearAll

void clearAll()
Clears both the errors and rows from memory


contains

boolean contains(java.lang.String column)
Does this DataSet contain a column with the given name?

Parameters:
column - Column name to check for
Returns:
boolean

isRowEmpty

boolean isRowEmpty()
Checks to see if there was no data on the row which was parsed. This will thrown an exception if Parser.FlagEmptyRows() is not set to true.

Returns:

getRawData

java.lang.String getRawData()
Returns:
the raw data used to create this Row in the DataSet. Parser.setStoreRawDataToDataSet(true) must be specified before calling this method.


Copyright © 2006-2011 Appendium - Portfolio Financing Platform. All Rights Reserved.