public class DbaseFile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DbaseFile.FieldFormatter
Utility for formatting Dbase fields.
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_FIELD_NAME_LENGTH |
Constructor and Description |
---|
DbaseFile(File afile) |
DbaseFile(File afile,
Charset chars) |
DbaseFile(File afile,
Charset chars,
boolean allowDuplicatedFieldNames) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Removes all data from the dataset
|
boolean |
getBooleanFieldValue(int rowIndex,
int fieldId)
DOCUMENT ME!
|
String |
getCharsetName()
Returns the charset used to read/write this dbf.
|
byte |
getCodePage()
Deprecated.
Use
getCodePageInt() instead |
int |
getCodePageInt() |
Charset |
getCurrenCharset() |
int |
getFieldCount()
DOCUMENT ME!
|
int |
getFieldDecimalLength(int inIndex)
Retrieve the location of the decimal point.
|
int |
getFieldIndex(String name) |
int |
getFieldLength(int inIndex)
Retrieve the length of the given column.
|
String |
getFieldName(int inIndex)
Retrieve the name of the given column.
|
char |
getFieldType(int inIndex)
Retrieve the type of the given column.
|
Charset |
getOriginalCharset() |
String |
getOriginalCharsetName()
Returns the charset declared on the dbf file (or the
default one if none is declared)
|
int |
getRecordCount() |
String |
getStringFieldValue(int rowIndex,
int fieldId)
DOCUMENT ME!
|
FileChannel |
getWriteChannel() |
boolean |
isOpen() |
boolean |
isWritable() |
void |
open()
read the DBF file into memory.
|
void |
setCharset(Charset chars) |
void |
setFieldValue(int rowIndex,
int fieldId,
Object obj) |
public static final int MAX_FIELD_NAME_LENGTH
public DbaseFile(File afile)
@Deprecated public byte getCodePage()
getCodePageInt()
insteadpublic int getCodePageInt()
public String getCharsetName()
public String getOriginalCharsetName()
public int getRecordCount()
public int getFieldCount()
public boolean getBooleanFieldValue(int rowIndex, int fieldId)
rowIndex
- DOCUMENT ME!fieldId
- DOCUMENT ME!public String getStringFieldValue(int rowIndex, int fieldId) throws UnsupportedEncodingException
rowIndex
- DOCUMENT ME!fieldId
- DOCUMENT ME!UnsupportedEncodingException
public void setFieldValue(int rowIndex, int fieldId, Object obj) throws UnsupportedEncodingException, WriteException
public String getFieldName(int inIndex)
inIndex
- DOCUMENT ME!public char getFieldType(int inIndex)
inIndex
- DOCUMENT ME!public int getFieldLength(int inIndex)
inIndex
- DOCUMENT ME!public int getFieldDecimalLength(int inIndex)
inIndex
- DOCUMENT ME!public void open() throws FileNotFoundException, UnsupportedVersionException, IOException
file
- DOCUMENT ME!FileNotFoundException
UnsupportedVersionException
IOException
IOException
- DOCUMENT ME!public void close() throws CloseException
CloseException
IOException
- DOCUMENT ME!public FileChannel getWriteChannel()
public boolean isOpen()
public int getFieldIndex(String name)
public Charset getCurrenCharset()
public Charset getOriginalCharset()
public void setCharset(Charset chars)
public boolean isWritable()