A class for holding a single cell of data for a CSV delimited document.
This class holds a single cell of data for a CSV delimited document.
In the event that a cell contains more than one data item (byte[], int[], etc)
the value will be the concatenation of the encoded string values
for all the data items.
All binary values will be encoded using the "0x;" XML-compatible encoding.
BOOLEAN
public static final int BOOLEAN
BYTE
public static final int BYTE
BYTEARRAY
public static final int BYTEARRAY
CHAR
public static final int CHAR
CHARARRAY
public static final int CHARARRAY
DATE
public static final int DATE
DOUBLE
public static final int DOUBLE
DOUBLEARRAY
public static final int DOUBLEARRAY
FLOAT
public static final int FLOAT
FLOATARRAY
public static final int FLOATARRAY
INT
public static final int INT
INTARRAY
public static final int INTARRAY
LONG
public static final int LONG
LONGARRAY
public static final int LONGARRAY
STRING
public static final int STRING
STRINGARRAY
public static final int STRINGARRAY
JSCSVCell
public JSCSVCell()
Creates a new default empty instance of JSCSVCell.
JSCSVCell
public JSCSVCell(GregorianCalendar dateentry)
Creates a new instance of JSCSVCell from a GregorianCalendar value.
dateentry - GregorianCalendar value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(String value)
Creates a new instance of JSCSVCell from the value given.
value - Value of JSCSVCell instance (encoded if necessary)
JSCSVCell
public JSCSVCell(String value,
int newtype)Creates a new instance of JSCSVCell from an unparsed String and the datatype.
value - Value of JSCSVCell instance (encoded if binary)newtype - Type of data contained in the cell
JSCSVCell
public JSCSVCell(boolean value)
Creates a new instance of JSCSVCell from a boolean value.
value - boolean value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(byte value)
Creates a new instance of JSCSVCell from a byte value.
value - byte value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(char value)
Creates a new instance of JSCSVCell from a char value.
value - char value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(double value)
Creates a new instance of JSCSVCell from a double value.
value - double value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(float value)
Creates a new instance of JSCSVCell from a float value.
value - float value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(int value)
Creates a new instance of JSCSVCell from a int value.
value - int value for new JSCSVCell instance, encoded if necessary.
JSCSVCell
public JSCSVCell(long value)
Creates a new instance of JSCSVCell from a long value.
value - long value for new JSCSVCell instance, encoded if necessary.
escape
public String escape(String in)
Escapes the value in the input string.
in - String to be escaped
escape
public String escape(boolean in)
Escapes the value in the input boolean.
escape
public String escape(byte in)
Escapes the value in the input byte.
escape
public String escape(char in)
Escapes the value in the input char.
escape
public String escape(double in)
Escapes the value in the input double.
escape
public String escape(float in)
Escapes the value in the input float.
escape
public String escape(int in)
Escapes the value in the input integer.
escape
public String escape(long in)
Escapes the value in the input long.
getDataDescr
public String getDataDescr(int datatype)
Get Description string of given datatype index.
datatype - Identifier of data type.
- String value of Data Description
getDefaultValueseparator
public static String getDefaultValueseparator()
Getter for the default value separator.
- Value of the default value separator.
getType
public int getType()
Get int value for property type.
getValue
public String getValue()
Getter for property value.
- String Value of property value.
getValueseparator
public String getValueseparator()
Getter for property valueseparator.
- Value of property valueseparator.
setDefaultValueseparator
public static void setDefaultValueseparator(String valueseparator)
Setter for property valueseparator.
valueseparator - New String value of property valueseparator.
setType
public void setType(int type)
Set int value of property type.
type - New int value of property type.
setValue
public void setValue(String value)
Setter for property value.
value - New String value of property value.
setValueseparator
public void setValueseparator(String valueseparator)
Setter for property valueseparator.
valueseparator - New String value of property valueseparator.
unescapeBoolean
public boolean unescapeBoolean()
throws IllegalArgumentExceptionUnescapes the value of the cell content to a boolean type.
- boolean Boolean value of the cell
unescapeByte
public byte unescapeByte()
throws NumberFormatExceptionUnescapes the value of the current JSCSVCell.
- byte byte value of the cell
unescapeByte
public static byte unescapeByte(String input)
throws NumberFormatExceptionUnescapes the value of the given String.
input - String value to be handled.
- byte byte value of the cell
unescapeChar
public char unescapeChar()
Unescapes the value of the cell to a char type.
- char Char value of the cell
unescapeChar
public static char unescapeChar(String input)
Unescapes the value of the given String to a char type.
input - String value to be handled.
- char Char value of the cell
unescapeDouble
public double unescapeDouble()
throws NumberFormatExceptionUnescapes the value of the cell content to a double type.
- double Double value of the cell
unescapeDouble
public static double unescapeDouble(String input)
throws NumberFormatExceptionUnescapes the value of the given String to a double type.
input - String value to be handled.
- double Double value of the cell
unescapeFloat
public float unescapeFloat()
throws NumberFormatExceptionUnescapes the value of the cell content to a float type.
- float Float value of the cell
unescapeFloat
public static float unescapeFloat(String input)
throws NumberFormatExceptionUnescapes the value of the given String to a float type.
input - String value to be handled.
- float Float value of the cell
unescapeInt
public int unescapeInt()
throws NumberFormatExceptionUnescapes the value of the cell content to a int type.
- Integer value of the cell
unescapeInt
public static int unescapeInt(String input)
throws NumberFormatExceptionUnescapes the value of the given String to a int type.
input - String value to be handled.
- int Integer value of the cell
unescapeLong
public long unescapeLong()
throws NumberFormatExceptionUnescapes the value of the cell content to a long type.
- long Long value of the cell
unescapeLong
public static long unescapeLong(String input)
throws NumberFormatExceptionUnescapes the value of the given String to a long type.
input - String value to be handled.
- long Long value of the cell
unescapeString
public String unescapeString()
Unescapes the String value of the cell.
unescapeString
public static String unescapeString(String input)
Unescapes the String value given.
input - String value to be handled.
write
public void write(java.io.BufferedWriter output)
throws IOExceptionWrites the cell to the BufferedWriter output stream.
output - BufferedOutput stream to be written to.