com.linuxense.javadbf
Class DBFReader

java.lang.Object
  |
  +--com.linuxense.javadbf.DBFBase
        |
        +--com.linuxense.javadbf.DBFReader

public class DBFReader
extends DBFBase

DBFReader class can creates objects to represent DBF data. This Class is used to read data from a DBF file. Meta data and records can be queried against this document.

DBFReader cannot write anythng to a DBF file. For creating DBF files use DBFWriter.

Fetching rocord is possible only in the forward direction and cannot re-wound. In such situation, a suggested approach is to reconstruct the object.

The nextRecord() method returns an array of Objects and the types of these Object are as follows:
xBase TypeJava Type
CString
NInteger
FDouble
LBoolean
Djava.util.Date


Field Summary
 
Fields inherited from class com.linuxense.javadbf.DBFBase
characterSetName, END_OF_DATA
 
Constructor Summary
DBFReader(java.io.InputStream in)
          Initializes a DBFReader object.
 
Method Summary
 DBFField getField(int index)
          Returns the asked Field.
 int getFieldCount()
          Returns the number of field in the DBF.
 int getRecordCount()
          Returns the number of records in the DBF.
 java.lang.Object[] nextRecord()
          Reads the returns the next row in the DBF stream.
 java.lang.String toString()
           
 
Methods inherited from class com.linuxense.javadbf.DBFBase
getCharactersetName, setCharactersetName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBFReader

public DBFReader(java.io.InputStream in)
          throws DBFException
Initializes a DBFReader object. When this constructor returns the object will have completed reading the hader (meta date) and header information can be quried there on. And it will be ready to return the first row.

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRecordCount

public int getRecordCount()
Returns the number of records in the DBF.


getField

public DBFField getField(int index)
                  throws DBFException
Returns the asked Field. In case of an invalid index, it returns a ArrayIndexOutofboundsException.

DBFException

getFieldCount

public int getFieldCount()
                  throws DBFException
Returns the number of field in the DBF.

DBFException

nextRecord

public java.lang.Object[] nextRecord()
                              throws DBFException
Reads the returns the next row in the DBF stream.

DBFException