Package ca.spatial.table
Class DBFColumnSpec
java.lang.Object
ca.spatial.table.DBFColumnSpec
This object encapsulates the information about a column to be written
to a dBase file. An
ArrayList
of these objects can be
manufactured using the DBFWriterSetup
class. Once created,
they are typically passed to a DBFWriter
object, or to the
AttributeStore.exportDBF(Window,String,ArrayList,int[])
or AttributeStore.exportCSV(String,ArrayList,int[],Observer)
methods.
The object requires the following data items:
Item | Description |
---|---|
source | An expression or column name that defines the data contents for this column. This will be evaluated in the context of a source data table associated with the export method. |
alias | A name to be given to this column. For dBase files the maximum length of the column name is 10 characters. There is no specified maximum column heading size for CSV files (although Excel has a maximum cell size of 32767 characters). |
type | The data type used for the field. The following types are supported:
|
width | The width of the field. For dBase this will strictly limit the number of data characters that can be written to the field. Character values that exceed the length will be right-truncated. Numberic values that cannot fit with the given space (e.g. 9999 in a field width of 3) will store incorrect values. This value is ignored for CSV files. |
dec | The number of places of precision following the decimal place. |
-
Constructor Summary
ConstructorsConstructorDescriptionDBFColumnSpec(String source, String alias, String type, int width, int dec)
Instantiate a column specification -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
Get the column headingint
getDec()
Get the number of places of precision following the decimal placeint
Get the data type code as defined in theAttributeFormat
class.Get the source expressiongetType()
Get the data typeint
getWidth()
Get the field widthSet the alias valuesetDec(int dec)
Set the dec valueSet the source expressionSet the type valuesetWidth(int width)
Set the width value
-
Constructor Details
-
DBFColumnSpec
Instantiate a column specification- Parameters:
source
- an expression that when evaluated will create the data for this columnalias
- the field nametype
- the data typewidth
- the width of the fielddec
- the number of places of precision following the decimal place
-
-
Method Details
-
getSource
Get the source expression -
setSource
Set the source expression -
getAlias
Get the column heading -
setAlias
Set the alias value -
getType
Get the data type -
setType
Set the type value -
getWidth
public int getWidth()Get the field width -
setWidth
Set the width value -
getDec
public int getDec()Get the number of places of precision following the decimal place -
setDec
Set the dec value -
getFormat
public int getFormat()Get the data type code as defined in theAttributeFormat
class.
-