|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.geotools.dbffile.DbfFile
public class DbfFile
This class represents a DBF (or DBase) file.
Construct it with a filename (including the .dbf) this causes the header and field definitions to be read.
Later queries return rows or columns of the database.
| Constructor Summary | |
|---|---|
protected |
DbfFile()
|
|
DbfFile(java.lang.String file)
Constructor, opens the file and reads the header infomation. |
| Method Summary | |
|---|---|
void |
close()
|
byte[] |
GetDbfRec(int row)
fetches the rowth row of the file |
java.lang.String |
getFieldName(int row)
|
java.lang.String |
getFieldType(int row)
|
int |
getFileSize()
Returns the size of the database file. |
java.lang.Double[] |
getFloatCol(int col)
Fetches a column of Double from the database file. |
java.lang.Double[] |
getFloatCol(int col,
int start,
int end)
Fetches a part column of Double from the database file. |
java.lang.Integer[] |
getIntegerCol(int col)
Fetches a column of Integers from the database file. |
java.lang.Integer[] |
getIntegerCol(int col,
int start,
int end)
Fetches a part column of Integers from the database file. |
int |
getLastRec()
Returns the number of records in the database file. |
java.lang.String |
getLastUpdate()
Returns the date of the last update of the file as a string. |
java.lang.StringBuffer |
GetNextDbfRec()
gets the next record and returns it as a string. |
int |
getNumFields()
Returns the number of fields in the records in the database file. |
int |
getRecSize()
Returns the size of the records in the database file. |
java.lang.String[] |
getStringCol(int col)
Fetches a column of Strings from the database file. |
java.lang.String[] |
getStringCol(int col,
int start,
int end)
Fetches a part column of Strings from the database file. |
static void |
main(java.lang.String[] args)
|
protected java.util.Date |
parseDate(java.lang.String s)
|
java.util.Vector |
ParseDbfRecord(int row)
fetches the rowth row of the file and parses it into an vector of objects. |
java.util.Vector |
ParseRecord(byte[] rec)
Parses the record stored in the StringBuffer rec into a vector of objects |
java.lang.Object |
ParseRecordColumn(byte[] rec,
int wantedCol)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public EndianDataInputStream dFile
public DbfFieldDef[] fielddef
public static final java.text.SimpleDateFormat DATE_PARSER
public static final int DBF_CENTURY
public static final int DBF_MAXLEN
public static final int DBF_NAMELEN
public static final int DBF3_MAXFIELDS
public static final int DBF4_MAXFIELDS
public static final int DBF_MAXFIELDS
public static final int DBF_BUFFSIZE
public static final int DBF_END_OF_DEFS
public static final int DBF_OK
public static final int DBF_READ_HEAD
public static final int DBF_BAD_DBFID
public static final int DBF_WRITE_HEAD
public static final int DBF_READ_DEFS
public static final int DBF_TOO_MANY_FIELDS
public static final int DBF_NO_FIELDS
public static final int DBF_BAD_EODEFS
public static final int DBF_WRITE_DEFS
public static final int DBF_BAD_ITYPE
public static final int DBF_CANNOT_DO_MEMO
public static final int DBF_BAD_INT_WIDTH
public static final int DBF_BAD_OFFSET
public static final int DBF_FLOATING_N
public static final int DBF_READ_DATA
public static final int DBF_UNPRINT_DATA
public static final int DBF_WRITE_DATA
public static final int DBF_INT_EXP
public static final int DBF_INT_REAL
public static final int DBF_INT_JUNK
public static final int DBF_REC_DELETED
public static final int DBF_ALL_DELETED
public static final int DBF_BAD_SIZEOF
public static final int DBF_REC_TOO_LONG
public static final int DBF_TOO_WIDE_FOR_INF
public static final int DBF_MALLOC_FIELD
public static final int DBF_MALLOC
public static final int DBF_GET_DATE
| Constructor Detail |
|---|
protected DbfFile()
public DbfFile(java.lang.String file)
throws java.io.IOException,
DbfFileException
file - The file to be opened, includes path and .dbf
java.io.IOException - If the file can't be opened.
DbfFileException - If there is an error reading header.| Method Detail |
|---|
public java.lang.String getLastUpdate()
public int getLastRec()
public int getRecSize()
public int getNumFields()
public java.lang.String getFieldName(int row)
public java.lang.String getFieldType(int row)
public int getFileSize()
public java.lang.StringBuffer GetNextDbfRec()
throws java.io.IOException
java.io.IOException - on read error.
public byte[] GetDbfRec(int row)
throws java.io.IOException
row - - the row to fetch
java.io.IOException - on read error.
public java.util.Vector ParseDbfRecord(int row)
throws java.io.IOException
row - - the row to fetch
java.io.IOException - on read error.
public java.lang.Object ParseRecordColumn(byte[] rec,
int wantedCol)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Vector ParseRecord(byte[] rec)
rec - the record to be parsed.
public java.lang.Integer[] getIntegerCol(int col)
throws java.io.IOException,
DbfFileException
col - - the column to fetch
java.io.IOException - - on read error
DbfFileException - - column is not an Integer.
public java.lang.Integer[] getIntegerCol(int col,
int start,
int end)
throws java.io.IOException,
DbfFileException
col - - the column to fetchstart - - the row to start fetching fromend - - the row to stop fetching at.
java.io.IOException - - on read error
DbfFileException - - column is not an Integer.
public java.lang.Double[] getFloatCol(int col)
throws DbfFileException,
java.io.IOException
col - - the column to fetch
java.io.IOException - - on read error
DbfFileException - - column is not an Integer.
public java.lang.Double[] getFloatCol(int col,
int start,
int end)
throws DbfFileException,
java.io.IOException
col - - the column to fetchstart - - the row to start fetching fromend - - the row to stop fetching at.
java.io.IOException - - on read error
DbfFileException - - column is not an Integer.
public java.lang.String[] getStringCol(int col)
throws DbfFileException,
java.io.IOException
col - - the column to fetch
java.io.IOException - - on read error
DbfFileException - - column is not an Integer.
public java.lang.String[] getStringCol(int col,
int start,
int end)
throws DbfFileException,
java.io.IOException
col - - the column to fetchstart - - the row to start fetching fromend - - the row to stop fetching at.
java.io.IOException - - on read error
DbfFileException - - column is not an Integer.
public void close()
throws java.io.IOException
java.io.IOException
protected java.util.Date parseDate(java.lang.String s)
throws java.text.ParseException
java.text.ParseException
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||