|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FieldSet
Interface used by flat file input sources to encapsulate concerns of
converting an array of Strings to Java native types. A bit like the role
played by ResultSet in JDBC, clients will know the name or position
of strongly typed fields that they want to extract.
| Method Summary | |
|---|---|
int |
getFieldCount()
Return the number of fields in this ' FieldSet'. |
String[] |
getNames()
Accessor for the names of the fields. |
Properties |
getProperties()
Construct name-value pairs from the field names and string values. |
String[] |
getValues()
|
boolean |
hasNames()
Check if there are names defined for the fields. |
BigDecimal |
readBigDecimal(int index)
Read the BigDecimal value at index 'index'. |
BigDecimal |
readBigDecimal(int index,
BigDecimal defaultValue)
Read the BigDecimal value at index 'index',
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank. |
BigDecimal |
readBigDecimal(String name)
Read the BigDecimal value from column with given 'name. |
BigDecimal |
readBigDecimal(String name,
BigDecimal defaultValue)
Read the BigDecimal value from column with given 'name,
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank. |
boolean |
readBoolean(int index)
Read the ' boolean' value at index 'index'. |
boolean |
readBoolean(int index,
String trueValue)
Read the ' boolean' value at index 'index'. |
boolean |
readBoolean(String name)
Read the ' boolean' value from column with given 'name'. |
boolean |
readBoolean(String name,
String trueValue)
Read the ' boolean' value from column with given 'name'. |
byte |
readByte(int index)
Read the ' byte' value at index 'index'. |
byte |
readByte(String name)
Read the ' byte' value from column with given 'name'. |
char |
readChar(int index)
Read the ' char' value at index 'index'. |
char |
readChar(String name)
Read the ' char' value from column with given 'name'. |
Date |
readDate(int index)
Read the java.util.Date value in default format at
designated column index. |
Date |
readDate(int index,
String pattern)
Read the java.util.Date value in default format at
designated column index. |
Date |
readDate(String name)
Read the java.sql.Date value in given format from column
with given name. |
Date |
readDate(String name,
String pattern)
Read the java.sql.Date value in given format from column
with given name. |
double |
readDouble(int index)
Read the ' double' value at index 'index'. |
double |
readDouble(String name)
Read the ' double' value from column with given 'name. |
float |
readFloat(int index)
Read the ' float' value at index 'index'. |
float |
readFloat(String name)
Read the ' float' value from column with given 'name. |
int |
readInt(int index)
Read the ' int' value at index 'index'. |
int |
readInt(int index,
int defaultValue)
Read the ' int' value at index 'index',
using the supplied defaultValue if the field value is
blank. |
int |
readInt(String name)
Read the ' int' value from column with given 'name'. |
int |
readInt(String name,
int defaultValue)
Read the ' int' value from column with given 'name',
using the supplied defaultValue if the field value is
blank. |
long |
readLong(int index)
Read the ' long' value at index 'index'. |
long |
readLong(int index,
long defaultValue)
Read the ' long' value at index 'index',
using the supplied defaultValue if the field value is
blank. |
long |
readLong(String name)
Read the ' long' value from column with given 'name'. |
long |
readLong(String name,
long defaultValue)
Read the ' long' value from column with given 'name',
using the supplied defaultValue if the field value is
blank. |
String |
readRawString(int index)
Read the String value at index 'index' including
trailing whitespace (don't trim). |
String |
readRawString(String name)
Read the String value from column with given 'name'
including trailing whitespace (don't trim). |
short |
readShort(int index)
Read the ' short' value at index 'index'. |
short |
readShort(String name)
Read the ' short' value from column with given 'name'. |
String |
readString(int index)
Read the String value at index 'index'. |
String |
readString(String name)
Read the String value from column with given 'name'. |
| Method Detail |
|---|
String[] getNames()
IllegalStateException - if the names are not definedboolean hasNames()
String[] getValues()
FieldSet' instance as
String values.String readString(int index)
String value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.String readString(String name)
String value from column with given 'name'.
name - the field name.String readRawString(int index)
String value at index 'index' including
trailing whitespace (don't trim).
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.String readRawString(String name)
String value from column with given 'name'
including trailing whitespace (don't trim).
name - the field name.boolean readBoolean(int index)
boolean' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.boolean readBoolean(String name)
boolean' value from column with given 'name'.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.
boolean readBoolean(int index,
String trueValue)
boolean' value at index 'index'.
index - the field index.trueValue - the value that signifies true;
case-sensitive.
IndexOutOfBoundsException - if the index is out of bounds, or if
the supplied trueValue is null.
boolean readBoolean(String name,
String trueValue)
boolean' value from column with given 'name'.
name - the field name.trueValue - the value that signifies true;
case-sensitive.
IllegalArgumentException - if a column with given name is not
defined, or if the supplied trueValue is null.char readChar(int index)
char' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.char readChar(String name)
char' value from column with given 'name'.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.byte readByte(int index)
byte' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.byte readByte(String name)
byte' value from column with given 'name'.
name - the field name.short readShort(int index)
short' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.short readShort(String name)
short' value from column with given 'name'.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.int readInt(int index)
int' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.int readInt(String name)
int' value from column with given 'name'.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.
int readInt(int index,
int defaultValue)
int' value at index 'index',
using the supplied defaultValue if the field value is
blank.
index - the field index..
IndexOutOfBoundsException - if the index is out of bounds.
int readInt(String name,
int defaultValue)
int' value from column with given 'name',
using the supplied defaultValue if the field value is
blank.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.long readLong(int index)
long' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.long readLong(String name)
long' value from column with given 'name'.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.
long readLong(int index,
long defaultValue)
long' value at index 'index',
using the supplied defaultValue if the field value is
blank.
index - the field index..
IndexOutOfBoundsException - if the index is out of bounds.
long readLong(String name,
long defaultValue)
long' value from column with given 'name',
using the supplied defaultValue if the field value is
blank.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.float readFloat(int index)
float' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.float readFloat(String name)
float' value from column with given 'name.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.double readDouble(int index)
double' value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.double readDouble(String name)
double' value from column with given 'name.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.BigDecimal readBigDecimal(int index)
BigDecimal value at index 'index'.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.BigDecimal readBigDecimal(String name)
BigDecimal value from column with given 'name.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.
BigDecimal readBigDecimal(int index,
BigDecimal defaultValue)
BigDecimal value at index 'index',
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.
BigDecimal readBigDecimal(String name,
BigDecimal defaultValue)
BigDecimal value from column with given 'name,
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.Date readDate(int index)
java.util.Date value in default format at
designated column index.
index - the field index.
IndexOutOfBoundsException - if the index is out of bounds.Date readDate(String name)
java.sql.Date value in given format from column
with given name.
name - the field name.
IllegalArgumentException - if a column with given name is not
defined.
Date readDate(int index,
String pattern)
java.util.Date value in default format at
designated column index.
index - the field index.pattern - the pattern describing the date and time format
IndexOutOfBoundsException - if the index is out of bounds.
IllegalArgumentException - if the date cannot be parsed.
Date readDate(String name,
String pattern)
java.sql.Date value in given format from column
with given name.
name - the field name.pattern - the pattern describing the date and time format
IllegalArgumentException - if a column with given name is not
defined or if the specified field cannot be parsedint getFieldCount()
FieldSet'.
Properties getProperties()
IllegalStateException - if the field name meta data is not
available.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||