Class DbaseFile
java.lang.Object
org.gvsig.fmap.dal.store.dbf.utils.DbaseFile
- All Implemented Interfaces:
Closeable,AutoCloseable
Class to read and write data to a dbase III format file. Creation date:
(5/15/2001 5:15:13 PM)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Removes all data from the datasetbooleangetBooleanFieldValue(long rowIndex, int fieldId) byte[]getBytesFieldValue(long rowIndex, int fieldId) Returns the charset used to read/write this dbf.intintintgetFieldIndex(String name) Returns the charset declared on the dbf file (or the default one if none is declared)intgetStringFieldValue(long rowIndex, int fieldId) booleanisOpen()booleanvoidopen()read the DBF file into memory.voidsetCharset(Charset chars) voidsetFieldValue(long rowIndex, int fieldId, Object obj)
-
Field Details
-
MAX_FIELD_NAME_LENGTH
public static final int MAX_FIELD_NAME_LENGTH- See Also:
-
-
Constructor Details
-
DbaseFile
-
DbaseFile
-
DbaseFile
-
-
Method Details
-
getHeader
-
getCodePageInt
public int getCodePageInt() -
getCharsetName
Returns the charset used to read/write this dbf. Maybe different from the declared in the file if we have forced a different one -
getOriginalCharsetName
Returns the charset declared on the dbf file (or the default one if none is declared) -
getRecordCount
public int getRecordCount() -
getFieldCount
public int getFieldCount() -
getBooleanFieldValue
public boolean getBooleanFieldValue(long rowIndex, int fieldId) -
getBytesFieldValue
public byte[] getBytesFieldValue(long rowIndex, int fieldId) throws org.gvsig.fmap.dal.exception.UnsupportedEncodingException - Throws:
org.gvsig.fmap.dal.exception.UnsupportedEncodingException
-
getStringFieldValue
public String getStringFieldValue(long rowIndex, int fieldId) throws org.gvsig.fmap.dal.exception.UnsupportedEncodingException - Throws:
org.gvsig.fmap.dal.exception.UnsupportedEncodingException
-
setFieldValue
public void setFieldValue(long rowIndex, int fieldId, Object obj) throws org.gvsig.fmap.dal.exception.UnsupportedEncodingException, org.gvsig.fmap.dal.exception.WriteException - Throws:
org.gvsig.fmap.dal.exception.UnsupportedEncodingExceptionorg.gvsig.fmap.dal.exception.WriteException
-
open
public void open() throws org.gvsig.fmap.dal.exception.FileNotFoundException, org.gvsig.fmap.dal.exception.UnsupportedVersionException, IOException, org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeNotSuportedExceptionread the DBF file into memory.- Throws:
org.gvsig.fmap.dal.exception.FileNotFoundExceptionorg.gvsig.fmap.dal.exception.UnsupportedVersionExceptionIOExceptionorg.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeNotSuportedException
-
close
Removes all data from the dataset- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getWriteChannel
-
isOpen
public boolean isOpen() -
getFieldIndex
-
getCurrenCharset
-
getOriginalCharset
-
setCharset
-
isWritable
public boolean isWritable()
-