Package ca.spatial.table
Class DBFWriter
java.lang.Object
ca.spatial.table.DBFWriter
A class to export a table to a DBF file.
The prefered use of this class is to use the export(java.lang.String, ca.spatial.table.AttributeStore, int, java.lang.String)
method.
-
Constructor Summary
ConstructorsConstructorDescriptionDBFWriter(AttributeStore source, ArrayList<DBFColumnSpec> defs, String filename)
Set up an new DBF writing object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the DBF file.static void
export(String name, AttributeStore source, int period, String reselect)
Export the table to a DBF file of the given name.static void
export(String name, AttributeStore source, String[] columns, int[] remap, int period, String reselect)
Export the table to a DBF file of the given name.static void
export(String filename, AttributeStore source, String[] columns, int[] remap, int period, String reselect, Observer obs)
static void
export(String filename, AttributeStore source, ArrayList<DBFColumnSpec> defs, int[] remap, int period, String reselect, Observer obs)
static DBFWriter
getDBFWriter(String filename, AttributeStore source)
static boolean
validateDef(AttributeStore source, DBFColumnSpec d)
static boolean
validateDefs(AttributeStore source, ArrayList<DBFColumnSpec> defs)
void
write(int row, int period)
Write the next sequential row out to the DBF file.
-
Constructor Details
-
DBFWriter
public DBFWriter(AttributeStore source, ArrayList<DBFColumnSpec> defs, String filename) throws IOException, ParseExceptionSet up an new DBF writing object. This can then be used with thewrite(int, int)
method to populate a DBF file.- Parameters:
source
- A schema for the attributes to be copied.defs
- A list of columns to be copied.filename
- The file name to be given to the output DBF file.- Throws:
IOException
ParseException
-
-
Method Details
-
getDBFWriter
public static DBFWriter getDBFWriter(String filename, AttributeStore source) throws IOException, ParseException- Throws:
IOException
ParseException
-
export
public static void export(String name, AttributeStore source, int period, String reselect) throws IOException, ParseExceptionExport the table to a DBF file of the given name.- Throws:
IOException
ParseException
-
export
public static void export(String name, AttributeStore source, String[] columns, int[] remap, int period, String reselect) throws IOException, ParseExceptionExport the table to a DBF file of the given name.- Throws:
IOException
ParseException
-
export
public static void export(String filename, AttributeStore source, String[] columns, int[] remap, int period, String reselect, Observer obs) throws IOException, ParseException- Throws:
IOException
ParseException
-
export
public static void export(String filename, AttributeStore source, ArrayList<DBFColumnSpec> defs, int[] remap, int period, String reselect, Observer obs) throws IOException, ParseException- Throws:
IOException
ParseException
-
write
Write the next sequential row out to the DBF file. The values for the row will be taken from the attribute store at the specified row and time period.- Throws:
IOException
-
close
Close the DBF file.- Throws:
IOException
-
validateDefs
-
validateDef
-