Class DBFDriver
- java.lang.Object
-
- org.h2gis.functions.io.dbf.internal.DBFDriver
-
- All Implemented Interfaces:
org.h2gis.api.FileDriver
public class DBFDriver extends Object implements org.h2gis.api.FileDriver
Manage DBFReader and DBFWriter- Author:
- Nicolas Fortin
-
-
Field Summary
Fields Modifier and Type Field Description protected DbaseFileReaderdbaseFileReaderprotected DbaseFileWriterdbaseFileWriter
-
Constructor Summary
Constructors Constructor Description DBFDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()DbaseFileHeadergetDbaseFileHeader()DbaseFileReadergetDbaseFileReader()Get the file readerFilegetDbfFile()intgetEstimatedRowSize(long rowId)org.h2.value.ValuegetField(long rowId, int columnId)intgetFieldCount()longgetRowCount()voidinitDriver(File dbfFile, DbaseFileHeader dbaseHeader)voidinitDriverFromFile(File dbfFile)Init file header for DBF FilevoidinitDriverFromFile(File dbfFile, String forceEncoding)Init file header for DBF FilevoidinsertRow(Object[] values)Write a row
-
-
-
Field Detail
-
dbaseFileReader
protected DbaseFileReader dbaseFileReader
-
dbaseFileWriter
protected DbaseFileWriter dbaseFileWriter
-
-
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 pathforceEncoding- 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- Specified by:
insertRowin interfaceorg.h2gis.api.FileDriver- 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- Specified by:
closein interfaceorg.h2gis.api.FileDriver- Throws:
IOException
-
getRowCount
public long getRowCount()
- Specified by:
getRowCountin interfaceorg.h2gis.api.FileDriver
-
getFieldCount
public int getFieldCount()
- Specified by:
getFieldCountin interfaceorg.h2gis.api.FileDriver- Returns:
- Column count
-
getEstimatedRowSize
public int getEstimatedRowSize(long rowId)
- Specified by:
getEstimatedRowSizein interfaceorg.h2gis.api.FileDriver
-
getField
public org.h2.value.Value getField(long rowId, int columnId) throws IOException- Specified by:
getFieldin interfaceorg.h2gis.api.FileDriver- Throws:
IOException
-
getDbaseFileReader
public DbaseFileReader getDbaseFileReader()
Get the file reader- Returns:
-
-