org.opengts.extra.shapefile
Class DBFParser

java.lang.Object
  extended by org.opengts.extra.shapefile.DBFParser

public class DBFParser
extends java.lang.Object


Field Summary
static int END_OF_DATA
           
static int TERMINATOR
           
static int VERSION
           
 
Constructor Summary
DBFParser()
          Default constuctor
DBFParser(byte[] dbfData)
          DBF file parser constuctor
DBFParser(DBFParser other)
          Copy constuctor
DBFParser(java.io.File dbfFile)
          DBF file parser constuctor
DBFParser(java.util.List<Field> fields)
          Constuctor
 
Method Summary
 void addField(Field fld)
          Adds a new field to the end of the list
 void addRecord(java.lang.String[] rcd)
          Adds a new record to the end of the list
 Field getFieldAt(int ndx)
          Return the field at the specified index
 int getFieldCount()
          Return number of fields
 java.lang.String getFieldNameAt(int ndx)
          Return the field name at the specified index
 java.util.List<Field> getFields()
          Return list of fields
 int getFileLength()
           
 java.lang.String getHeaderInfo()
          Gets a String representation of the header information for this instance
 java.lang.StringBuffer getHeaderInfo(java.lang.StringBuffer sb)
          Gets a String representation of the header information for this instance
 int getHeaderSize()
           
 RTProperties getPropertiesAt(int ndx, boolean ignoreCase)
          Return the record at the specified index
 java.lang.String[] getRecordAt(int ndx)
          Get record at index
 int getRecordCount()
          Return number of records
 int getRecordSize()
          Return the full record length
 boolean hasFields()
          Returns true if fields/columns are present
 boolean hasRecords()
          Returns true if this instance contains records
static void main(java.lang.String[] argv)
           
 void setUpdateTime(DateTime updateTime)
           
 void setUpdateTime(int updYYYY, int updMM, int updDD)
           
 java.lang.String toString()
          Gets a String representation of this instance
 Payload write(Payload p)
          Write header/data to Payload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final int VERSION
See Also:
Constant Field Values

TERMINATOR

public static final int TERMINATOR
See Also:
Constant Field Values

END_OF_DATA

public static final int END_OF_DATA
See Also:
Constant Field Values
Constructor Detail

DBFParser

public DBFParser()
Default constuctor


DBFParser

public DBFParser(DBFParser other)
Copy constuctor

Parameters:
other - The DBFParser instance to copy

DBFParser

public DBFParser(java.util.List<Field> fields)
Constuctor

Parameters:
fields - The defined fields

DBFParser

public DBFParser(byte[] dbfData)
          throws java.io.IOException
DBF file parser constuctor

Parameters:
dbfData - The byte array containing the dbf data to parse
Throws:
java.io.IOException

DBFParser

public DBFParser(java.io.File dbfFile)
          throws java.io.IOException
DBF file parser constuctor

Parameters:
dbfFile - The file containing the dbf data to parse
Throws:
java.io.IOException
Method Detail

setUpdateTime

public void setUpdateTime(DateTime updateTime)

setUpdateTime

public void setUpdateTime(int updYYYY,
                          int updMM,
                          int updDD)

getFieldCount

public int getFieldCount()
Return number of fields


hasFields

public boolean hasFields()
Returns true if fields/columns are present

Returns:
True if fields/columns are present

getFields

public java.util.List<Field> getFields()
Return list of fields


addField

public void addField(Field fld)
Adds a new field to the end of the list


getFieldAt

public Field getFieldAt(int ndx)
Return the field at the specified index


getFieldNameAt

public java.lang.String getFieldNameAt(int ndx)
Return the field name at the specified index


getRecordSize

public int getRecordSize()
Return the full record length


addRecord

public void addRecord(java.lang.String[] rcd)
Adds a new record to the end of the list


getRecordCount

public int getRecordCount()
Return number of records


hasRecords

public boolean hasRecords()
Returns true if this instance contains records


getRecordAt

public java.lang.String[] getRecordAt(int ndx)
Get record at index

Parameters:
ndx - The Index
Returns:
The record

getPropertiesAt

public RTProperties getPropertiesAt(int ndx,
                                    boolean ignoreCase)
Return the record at the specified index


getHeaderSize

public int getHeaderSize()

getFileLength

public int getFileLength()

write

public Payload write(Payload p)
Write header/data to Payload


getHeaderInfo

public java.lang.StringBuffer getHeaderInfo(java.lang.StringBuffer sb)
Gets a String representation of the header information for this instance


getHeaderInfo

public java.lang.String getHeaderInfo()
Gets a String representation of the header information for this instance


toString

public java.lang.String toString()
Gets a String representation of this instance

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)