public class DefaultDataSet extends Object implements DataSet
Constructor and Description |
---|
DefaultDataSet(MetaData pzMetaData,
Parser pzparser) |
Modifier and Type | Method and Description |
---|---|
void |
absolute(int localPointer)
Sets the absolute position of the record pointer
|
void |
addError(DataError dataError) |
void |
addRow(Row row) |
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(String column)
Does this DataSet contain a column with the given name?
|
BigDecimal |
getBigDecimal(String column)
Returns the BigDecimal value of a specified column
|
BigDecimal |
getBigDecimal(String column,
Supplier<BigDecimal> defaultSupplier)
Returns the BigDecimal value of a specified column
|
String[] |
getColumns()
Returns a String array of column names in the DataSet.
|
String[] |
getColumns(String recordID)
Returns a String array of column names in the DataSet for a given
<RECORD> id
|
Date |
getDate(String column)
Returns the date value of a specified column.
|
Date |
getDate(String column,
SimpleDateFormat sdf)
Returns the date value of a specified column.
|
Date |
getDate(String column,
SimpleDateFormat sdf,
Supplier<Date> defaultSupplier)
Returns the date value of a specified column.
|
Date |
getDate(String column,
Supplier<Date> defaultSupplier)
Returns the date value of a specified column.
|
double |
getDouble(String column)
Returns the double value of a specified column
|
double |
getDouble(String column,
DoubleSupplier defaultSupplier)
Returns the double value of a specified column
|
int |
getErrorCount()
Returns total number of records which contained a parse error in the
file.
|
List<DataError> |
getErrors()
Returns A Collection Of DataErrors that happened during processing
|
int |
getIndex()
Returns the index the pointer is on for the array
|
int |
getInt(String column)
Returns the integer value of a specified column
|
int |
getInt(String column,
IntSupplier defaultSupplier)
Returns the integer value of a specified column
|
LocalDate |
getLocalDate(String column)
Returns the local date value of a specified column.
|
LocalDate |
getLocalDate(String column,
DateTimeFormatter dtf)
Returns the local date value of a specified column.
|
LocalDate |
getLocalDate(String column,
String dateFormat)
Returns the lcoal date value of a specified column.
|
LocalDate |
getLocalDate(String column,
String dateFormat,
Supplier<LocalDate> defaultSupplier)
Returns the local date value of a specified column.
|
LocalDate |
getLocalDate(String column,
Supplier<LocalDate> defaultSupplier)
Returns the date value of a specified column.
|
long |
getLong(String column)
Returns the long value of a specified column
|
long |
getLong(String column,
LongSupplier defaultSupplier)
Returns the long value of a specified column
|
MetaData |
getMetaData() |
Object |
getObject(String column,
Class<?> classToConvertTo)
Returns the value of the column with the type of object specified
|
String |
getRawData() |
Optional<Record> |
getRecord() |
String |
getRecordID()
Show the record ID (default is 'detail')
|
int |
getRowCount()
Returns the total number of rows parsed in from the file
|
int |
getRowNo()
Returns the line number the pointer is on.
|
String |
getString(String column)
Returns the string value of a specified column
|
String |
getString(String column,
Supplier<String> defaultSupplier)
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(String recordID)
Checks to see if the row has the given <RECORD> id
|
boolean |
isRowEmpty()
Checks to see if there was no data on the row which was parsed.
|
boolean |
next()
Returns true if it has one more record.
|
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 |
setMetaData(MetaData metaData) |
protected void |
setPointer(int pointer) |
void |
setPZConvertProps(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(String column,
String value)
Changes the value of the given column only for the
given row which the pointer is currently sitting on.
|
String |
toString() |
public void addRow(Row row)
public void addError(DataError dataError)
public String[] getColumns()
Record
getColumns
in interface Record
public String[] getColumns(String recordID)
Record
getColumns
in interface Record
public Date getDate(String column) throws ParseException
Record
getDate
in interface Record
column
- - Name of the columnParseException
- if date format incorrectpublic Date getDate(String column, SimpleDateFormat sdf) throws ParseException
Record
getDate
in interface Record
column
- - Name of the columnsdf
- - SimpleDateFormat of the dateParseException
- if date format does not match the SimpleDateFormatSimpleDateFormat
public double getDouble(String column)
Record
public BigDecimal getBigDecimal(String column)
Record
getBigDecimal
in interface Record
column
- - Name of the columnpublic Object getObject(String column, Class<?> classToConvertTo)
Record
public BigDecimal getBigDecimal(String column, Supplier<BigDecimal> defaultSupplier)
Record
getBigDecimal
in interface Record
column
- - Name of the columndefaultSupplier
- for default value if result in column is null/emptypublic Date getDate(String column, SimpleDateFormat sdf, Supplier<Date> defaultSupplier) throws ParseException
Record
getDate
in interface Record
column
- - Name of the columnsdf
- - SimpleDateFormat of the datedefaultSupplier
- for default value if result in column is null/emptyParseException
SimpleDateFormat
public Date getDate(String column, Supplier<Date> defaultSupplier) throws ParseException
Record
getDate
in interface Record
column
- - Name of the columndefaultSupplier
- for default value if result in column is null/emptyParseException
- if date format incorectpublic double getDouble(String column, DoubleSupplier defaultSupplier)
Record
public int getInt(String column, IntSupplier defaultSupplier)
Record
public long getLong(String column, LongSupplier defaultSupplier)
Record
public String getString(String column, Supplier<String> defaultSupplier)
Record
public int getErrorCount()
RecordDataSet
getErrorCount
in interface RecordDataSet
public List<DataError> getErrors()
RecordDataSet
getErrors
in interface RecordDataSet
public int getIndex()
DataSet
public int getInt(String column)
Record
public long getLong(String column)
Record
public int getRowCount()
DataSet
getRowCount
in interface DataSet
public int getRowNo()
Record
public String getString(String column)
Record
public void setValue(String column, String value)
DataSet
public void goBottom()
DataSet
public void goTop()
DataSet
public boolean isAnError(int lineNo)
DataSet
public boolean next()
RecordDataSet
next
in interface RecordDataSet
public Optional<Record> getRecord()
getRecord
in interface RecordDataSet
public void orderRows(OrderBy ob)
DataSet
orderRows
in interface DataSet
ob
- -
OrderBy objectOrderBy
,
OrderColumn
public boolean previous()
DataSet
public void setLowerCase()
setLowerCase
in interface DataSet
public void setUpperCase()
setUpperCase
in interface DataSet
public boolean isRecordID(String recordID)
isRecordID
in interface Record
recordID
- record to checkpublic String getRecordID()
Record
getRecordID
in interface Record
public void absolute(int localPointer)
absolute
in interface DataSet
localPointer
- - intIndexOutOfBoundsException
- if wrong indexpublic void setStrictNumericParse(boolean strictNumericParse)
setStrictNumericParse
in interface DataSet
strictNumericParse
- The strictNumericParse to set.public void remove()
DataSet
public void setPZConvertProps(Properties props)
DataSet
setPZConvertProps
in interface DataSet
props
- Property mapping for String to Object conversionprotected void setPointer(int pointer)
pointer
- the pointer to setpublic void clearRows()
DataSet
public void clearAll()
DataSet
public void clearErrors()
DataSet
clearErrors
in interface DataSet
public MetaData getMetaData()
public void setMetaData(MetaData metaData)
public boolean contains(String column)
Record
public boolean isRowEmpty()
Record
isRowEmpty
in interface Record
FPInvalidUsageException
- Parser.isFlagEmptyRows() must be set to true before using
thisFPException
- if cursor is on an invalid rowpublic String getRawData()
getRawData
in interface Record
FPInvalidUsageException
FPException
- if cursor is on an invalid rowpublic LocalDate getLocalDate(String column, Supplier<LocalDate> defaultSupplier) throws ParseException
Record
getLocalDate
in interface Record
column
- - Name of the columndefaultSupplier
- for default value if result in column is null/emptyParseException
- if date format does not matchpublic LocalDate getLocalDate(String column) throws ParseException
Record
getLocalDate
in interface Record
column
- - Name of the columnParseException
- if date format does not matchpublic LocalDate getLocalDate(String column, DateTimeFormatter dtf) throws ParseException
Record
getLocalDate
in interface Record
column
- - Name of the column
formatter
- formatter for the date parsingParseException
- if date format does not matchpublic LocalDate getLocalDate(String column, String dateFormat, Supplier<LocalDate> defaultSupplier) throws ParseException
Record
getLocalDate
in interface Record
column
- - Name of the columndateFormat
- - dateFormat of the datedefaultSupplier
- for default value if result in column is null/emptyParseException
- if date format does not matchSimpleDateFormat
public LocalDate getLocalDate(String column, String dateFormat) throws ParseException
Record
getLocalDate
in interface Record
column
- - Name of the columndateFormat
- - dateFormat of the dateParseException
- if date format does not matchSimpleDateFormat
Copyright © 2006–2021 Appendium - Portfolio Financing Platform. All rights reserved.