anl.repast.gis.data.dbf
Class DBFWriter

java.lang.Object
  extended by anl.repast.gis.data.dbf.DBFWriter

public class DBFWriter
extends java.lang.Object

Title: JDBF

Description: Used to write database (DBF) files.
Create a DBFWriter passing a file name and a list of fields, then add the records one by one, and close it. Make sure you always close your DBF files, even if there is an error writing some of the records.

Copyright : Copyright (c) 2004

Société : FUCaM-GTM

Version:
1.0
Author:
Bart Jourquin, adapted from original free lib by SV Consulting (http://www.svcon.com/)

Constructor Summary
DBFWriter(java.io.OutputStream outputstream, JDBField[] ajdbfield)
          Opens an output stream for writing.
DBFWriter(java.lang.String s, JDBField[] ajdbfield)
          Opens a DBF file for writing.
DBFWriter(java.lang.String s, JDBField[] ajdbfield, java.lang.String s1)
          Opens a DBF file for writing, bytes in DBF will be converted from UNICODE to national charset.
 
Method Summary
 void addRecord(java.lang.Object[] aobj)
          Writes a record to the DBF file.
 void close()
          Closes the DBF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBFWriter

public DBFWriter(java.lang.String s,
                 JDBField[] ajdbfield)
          throws JDBFException
Opens a DBF file for writing.

Parameters:
s - String
ajdbfield - JDBField[]
Throws:
JDBFException

DBFWriter

public DBFWriter(java.io.OutputStream outputstream,
                 JDBField[] ajdbfield)
          throws JDBFException
Opens an output stream for writing.

Parameters:
outputstream - OutputStream
ajdbfield - JDBField[]
Throws:
JDBFException

DBFWriter

public DBFWriter(java.lang.String s,
                 JDBField[] ajdbfield,
                 java.lang.String s1)
          throws JDBFException
Opens a DBF file for writing, bytes in DBF will be converted from UNICODE to national charset.

Parameters:
s - String
ajdbfield - JDBField[]
s1 - String
Throws:
JDBFException
Method Detail

addRecord

public void addRecord(java.lang.Object[] aobj)
               throws JDBFException
Writes a record to the DBF file.

Parameters:
aobj - Object[]
Throws:
JDBFException

close

public void close()
           throws JDBFException
Closes the DBF file.

Throws:
JDBFException