public class DefaultFieldSet extends Object implements FieldSet
FieldSet using Java using Java primitive
 and standard types and utilities. Strings are trimmed before parsing by
 default, and so are plain String values.| Constructor and Description | 
|---|
| DefaultFieldSet(String[] tokens)Create a FieldSet with anonymous tokens. | 
| DefaultFieldSet(String[] tokens,
               String[] names)Create a FieldSet with named tokens. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object object) | 
| 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() | 
| int | hashCode() | 
| boolean | hasNames()Check if there are names defined for the fields. | 
| protected int | indexOf(String name)Read and trim the  Stringvalue from column with given 'name. | 
| protected String | readAndTrim(int index)Read and trim the  Stringvalue at 'index'. | 
| BigDecimal | readBigDecimal(int index)Read the  BigDecimalvalue at index 'index'. | 
| BigDecimal | readBigDecimal(int index,
              BigDecimal defaultValue)Read the  BigDecimalvalue at index 'index',
 returning the supplieddefaultValueif the trimmed string
 value at index 'index' is blank. | 
| BigDecimal | readBigDecimal(String name)Read the  BigDecimalvalue from column with given 'name. | 
| BigDecimal | readBigDecimal(String name,
              BigDecimal defaultValue)Read the  BigDecimalvalue from column with given 'name,
 returning the supplieddefaultValueif 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.Datevalue in default format at
 designated columnindex. | 
| Date | readDate(int index,
        Date defaultValue)Read the  java.util.Datevalue in default format at
 designated columnindex. | 
| Date | readDate(int index,
        String pattern)Read the  java.util.Datevalue in default format at
 designated columnindex. | 
| Date | readDate(int index,
        String pattern,
        Date defaultValue)Read the  java.util.Datevalue in default format at
 designated columnindex. | 
| Date | readDate(String name)Read the  java.sql.Datevalue in given format from column
 with givenname. | 
| Date | readDate(String name,
        Date defaultValue)Read the  java.sql.Datevalue in given format from column
 with givenname. | 
| Date | readDate(String name,
        String pattern)Read the  java.sql.Datevalue in given format from column
 with givenname. | 
| Date | readDate(String name,
        String pattern,
        Date defaultValue)Read the  java.sql.Datevalue in given format from column
 with givenname. | 
| 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 supplieddefaultValueif 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 supplieddefaultValueif 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 supplieddefaultValueif 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 supplieddefaultValueif the field value is
 blank. | 
| String | readRawString(int index)Read the  Stringvalue at index 'index' including
 trailing whitespace (don't trim). | 
| String | readRawString(String name)Read the  Stringvalue 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  Stringvalue at index 'index'. | 
| String | readString(String name)Read the  Stringvalue from column with given 'name'. | 
| void | setDateFormat(DateFormat dateFormat)The  DateFormatto use for parsing numbers. | 
| void | setNumberFormat(NumberFormat numberFormat)The  NumberFormatto use for parsing numbers. | 
| String | toString() | 
public DefaultFieldSet(String[] tokens)
tokens - the token valuesFieldSet.readString(int)public DefaultFieldSet(String[] tokens, String[] names)
tokens - the token valuesnames - the names of the tokensFieldSet.readString(String)public final void setNumberFormat(NumberFormat numberFormat)
NumberFormat to use for parsing numbers. If unset the US
 locale will be used ('.' as decimal place).numberFormat - the NumberFormat to use for number parsingpublic void setDateFormat(DateFormat dateFormat)
DateFormat to use for parsing numbers. If unset the default
 pattern is ISO standard yyyy/MM/dd.dateFormat - the DateFormat to use for date parsingpublic String[] getNames()
FieldSetpublic boolean hasNames()
FieldSetpublic String[] getValues()
public String readString(int index)
FieldSetString value at index 'index'.readString in interface FieldSetindex - the field index.public String readString(String name)
FieldSetString value from column with given 'name'.readString in interface FieldSetname - the field name.public String readRawString(int index)
FieldSetString value at index 'index' including
 trailing whitespace (don't trim).readRawString in interface FieldSetindex - the field index.public String readRawString(String name)
FieldSetString value from column with given 'name'
 including trailing whitespace (don't trim).readRawString in interface FieldSetname - the field name.public boolean readBoolean(int index)
FieldSetboolean' value at index 'index'.readBoolean in interface FieldSetindex - the field index.public boolean readBoolean(String name)
FieldSetboolean' value from column with given 'name'.readBoolean in interface FieldSetname - the field name.public boolean readBoolean(int index,
                  String trueValue)
FieldSetboolean' value at index 'index'.readBoolean in interface FieldSetindex - the field index.trueValue - the value that signifies true;
 case-sensitive.public boolean readBoolean(String name, String trueValue)
FieldSetboolean' value from column with given 'name'.readBoolean in interface FieldSetname - the field name.trueValue - the value that signifies true;
 case-sensitive.public char readChar(int index)
FieldSetchar' value at index 'index'.public char readChar(String name)
FieldSetchar' value from column with given 'name'.public byte readByte(int index)
FieldSetbyte' value at index 'index'.public byte readByte(String name)
FieldSetbyte' value from column with given 'name'.public short readShort(int index)
FieldSetshort' value at index 'index'.public short readShort(String name)
FieldSetshort' value from column with given 'name'.public int readInt(int index)
FieldSetint' value at index 'index'.public int readInt(String name)
FieldSetint' value from column with given 'name'.public int readInt(int index,
          int defaultValue)
FieldSetint' value at index 'index',
 using the supplied defaultValue if the field value is
 blank.public int readInt(String name, int defaultValue)
FieldSetint' value from column with given 'name',
 using the supplied defaultValue if the field value is
 blank.public long readLong(int index)
FieldSetlong' value at index 'index'.public long readLong(String name)
FieldSetlong' value from column with given 'name'.public long readLong(int index,
            long defaultValue)
FieldSetlong' value at index 'index',
 using the supplied defaultValue if the field value is
 blank.public long readLong(String name, long defaultValue)
FieldSetlong' value from column with given 'name',
 using the supplied defaultValue if the field value is
 blank.public float readFloat(int index)
FieldSetfloat' value at index 'index'.public float readFloat(String name)
FieldSetfloat' value from column with given 'name.public double readDouble(int index)
FieldSetdouble' value at index 'index'.readDouble in interface FieldSetindex - the field index.public double readDouble(String name)
FieldSetdouble' value from column with given 'name.readDouble in interface FieldSetname - the field name.public BigDecimal readBigDecimal(int index)
FieldSetBigDecimal value at index 'index'.readBigDecimal in interface FieldSetindex - the field index.public BigDecimal readBigDecimal(String name)
FieldSetBigDecimal value from column with given 'name.readBigDecimal in interface FieldSetname - the field name.public BigDecimal readBigDecimal(int index, BigDecimal defaultValue)
FieldSetBigDecimal value at index 'index',
 returning the supplied defaultValue if the trimmed string
 value at index 'index' is blank.readBigDecimal in interface FieldSetindex - the field index.public BigDecimal readBigDecimal(String name, BigDecimal defaultValue)
FieldSetBigDecimal value from column with given 'name,
 returning the supplied defaultValue if the trimmed string
 value at index 'index' is blank.readBigDecimal in interface FieldSetname - the field name.defaultValue - the default value to use if the field is blankpublic Date readDate(int index)
FieldSetjava.util.Date value in default format at
 designated column index.public Date readDate(int index, Date defaultValue)
FieldSetjava.util.Date value in default format at
 designated column index.public Date readDate(String name)
FieldSetjava.sql.Date value in given format from column
 with given name.public Date readDate(String name, Date defaultValue)
FieldSetjava.sql.Date value in given format from column
 with given name.public Date readDate(int index, String pattern)
FieldSetjava.util.Date value in default format at
 designated column index.public Date readDate(int index, String pattern, Date defaultValue)
FieldSetjava.util.Date value in default format at
 designated column index.public Date readDate(String name, String pattern)
FieldSetjava.sql.Date value in given format from column
 with given name.public Date readDate(String name, String pattern, Date defaultValue)
FieldSetjava.sql.Date value in given format from column
 with given name.public int getFieldCount()
FieldSetFieldSet'.getFieldCount in interface FieldSetprotected int indexOf(String name)
String value from column with given '
 name.IllegalArgumentException - if a column with given name is not
 defined.public boolean equals(Object object)
equals in class ObjectObject.equals(java.lang.Object)public Properties getProperties()
FieldSetgetProperties in interface FieldSetCopyright © 2014 Pivotal. All rights reserved.