gistoolkit.datasources.shapefile
Class DbaseFileHeader

java.lang.Object
  extended bygistoolkit.datasources.shapefile.DbaseFileHeader

public class DbaseFileHeader
extends java.lang.Object

Class to represent the header of a Dbase III file. Creation date: (5/15/2001 5:15:30 PM)


Nested Class Summary
(package private)  class DbaseFileHeader.DbaseFieldDescriptor
          Class for holding the information assicated with a record.
 
Constructor Summary
DbaseFileHeader()
          DbaseFileHreader constructor comment.
 
Method Summary
 void addColumn(java.lang.String inFieldName, char inFieldType, int inFieldLength, int inDecimalCount)
          Add a column to this DbaseFileHeader.
 int getFieldDecimalCount(int inIndex)
           
 DbaseFileHeader.DbaseFieldDescriptor getFieldDescription(int inIndex)
          Return the Field Descriptor for the given field.
 int getFieldLength(int inIndex)
           
 java.lang.String getFieldName(int inIndex)
           
 char getFieldType(int inIndex)
           
 int getHeaderLength()
          Return the length of the header
 java.util.Date getLastUpdateDate()
          Return the date this file was last updated.
 int getNumFields()
          Return the number of fields in the records.
 int getNumRecords()
          Return the number of records in the file
 int getRecordLength()
          Return the length of the records in bytes.
 void readHeader(LEDataInputStream in)
          Read the header data from the DBF file.
 int removeColumn(java.lang.String inFieldName)
          Remove a column from this DbaseFileHeader.
protected  void setNumRecords(int inNumRecords)
          Set the number of records in the file
 void setWarnings(boolean inWarning)
          Print warnings to system.out.
 void writeHeader(LEDataOutputStream out)
          Write the header data to the DBF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbaseFileHeader

public DbaseFileHeader()
DbaseFileHreader constructor comment.

Method Detail

setWarnings

public void setWarnings(boolean inWarning)
Print warnings to system.out.


addColumn

public void addColumn(java.lang.String inFieldName,
                      char inFieldType,
                      int inFieldLength,
                      int inDecimalCount)
               throws java.lang.Exception
Add a column to this DbaseFileHeader. The type is one of (C N L or D) character, number, logical(true/false), or date. The Field length is the total length in bytes reserved for this column. The decimal count only applies to numbers(N), and floating point values (F), and refers to the number of characters to reserve after the decimal point.

Throws:
java.lang.Exception

removeColumn

public int removeColumn(java.lang.String inFieldName)
Remove a column from this DbaseFileHeader.

Returns:
index of the removed column, -1 if no found

getFieldDescription

public DbaseFileHeader.DbaseFieldDescriptor getFieldDescription(int inIndex)
Return the Field Descriptor for the given field.


getFieldLength

public int getFieldLength(int inIndex)

getFieldDecimalCount

public int getFieldDecimalCount(int inIndex)

getFieldName

public java.lang.String getFieldName(int inIndex)

getFieldType

public char getFieldType(int inIndex)

getLastUpdateDate

public java.util.Date getLastUpdateDate()
Return the date this file was last updated.


getNumFields

public int getNumFields()
Return the number of fields in the records.


getNumRecords

public int getNumRecords()
Return the number of records in the file


getRecordLength

public int getRecordLength()
Return the length of the records in bytes.


getHeaderLength

public int getHeaderLength()
Return the length of the header


readHeader

public void readHeader(LEDataInputStream in)
                throws java.lang.Exception
Read the header data from the DBF file.

Throws:
java.lang.Exception

setNumRecords

protected void setNumRecords(int inNumRecords)
Set the number of records in the file


writeHeader

public void writeHeader(LEDataOutputStream out)
                 throws java.lang.Exception
Write the header data to the DBF file.

Throws:
java.lang.Exception