org.h2gis.drivers.dbf.internal
Class DBFDriver

java.lang.Object
  extended by org.h2gis.drivers.dbf.internal.DBFDriver
All Implemented Interfaces:
FileDriver

public class DBFDriver
extends Object
implements FileDriver

Manage DBFReader and DBFWriter

Author:
Nicolas Fortin

Constructor Summary
DBFDriver()
           
 
Method Summary
 void close()
          Close the file, free resources.
 DbaseFileHeader getDbaseFileHeader()
           
 File getDbfFile()
           
 int getFieldCount()
           
 Object[] getRow(long rowId)
           
 long getRowCount()
           
 void initDriver(File dbfFile, DbaseFileHeader dbaseHeader)
           
 void initDriverFromFile(File dbfFile)
          Init file header for DBF File
 void initDriverFromFile(File dbfFile, String forceEncoding)
          Init file header for DBF File
 void insertRow(Object[] values)
          Write a row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBFDriver

public DBFDriver()
Method Detail

initDriverFromFile

public void initDriverFromFile(File dbfFile)
                        throws IOException
Init file header for DBF File

Parameters:
dbfFile - DBF File path
Throws:
IOException

initDriverFromFile

public void initDriverFromFile(File dbfFile,
                               String forceEncoding)
                        throws IOException
Init file header for DBF File

Parameters:
dbfFile - DBF File path
forceEncoding - File encoding to use, null will use the file encoding provided in the file header
Throws:
IOException

initDriver

public void initDriver(File dbfFile,
                       DbaseFileHeader dbaseHeader)
                throws IOException
Throws:
IOException

insertRow

public void insertRow(Object[] values)
               throws IOException
Write a row

Parameters:
values - Content, must be of the same type as declared in the header
Throws:
IOException

getDbfFile

public File getDbfFile()
Returns:
DBF File path

getDbaseFileHeader

public DbaseFileHeader getDbaseFileHeader()
Returns:
The DBF file header

close

public void close()
           throws IOException
Description copied from interface: FileDriver
Close the file, free resources.

Specified by:
close in interface FileDriver
Throws:
IOException

getRowCount

public long getRowCount()
Specified by:
getRowCount in interface FileDriver
Returns:
Row count

getFieldCount

public int getFieldCount()
Returns:
Column count

getRow

public Object[] getRow(long rowId)
                throws IOException
Specified by:
getRow in interface FileDriver
Parameters:
rowId - Row index [0-getRowCount()[
Returns:
The row content
Throws:
IOException - Read error


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.