nl.javel.gisbeans.io.esri
Class DbfReader

java.lang.Object
  extended by nl.javel.gisbeans.io.esri.DbfReader
All Implemented Interfaces:
Serializable

public class DbfReader
extends Object
implements Serializable

This class reads a dbf file (dBaseIII) used in Esri ShapeFiles

Since:
JDK 1
Version:
1
Author:
Paul Jacobs
Peter Jacobs
See Also:
Serialized Form

Constructor Summary
DbfReader(URL dbfFile)
          constructs a DbfReader
 
Method Summary
 String[] getColumnNames()
          returns the columnNames
 String[] getRow(int rowNumber)
          returns the row
 int[] getRowNumbers(String attribute, String columnName)
          returns the array of rowNumbers belonging to a attribute/column pair
 String[][] getRows()
          returns a table of all attributes stored for the particular dbf-file
 boolean isCache()
          may we cache parsed data for a session.
 void setCache(boolean cache)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbfReader

public DbfReader(URL dbfFile)
          throws IOException
constructs a DbfReader

Parameters:
dbfFile - the URL of the dbfFile
Throws:
IOException - whenever url does not occur to exist.
Method Detail

getColumnNames

public String[] getColumnNames()
returns the columnNames

Returns:
String[] the columnNames

getRow

public String[] getRow(int rowNumber)
                throws IOException,
                       IndexOutOfBoundsException
returns the row

Parameters:
rowNumber - the rowNumber
Returns:
String[] the attributes of the row
Throws:
IOException
IndexOutOfBoundsException - whenever the rowNumber > numRecords

getRows

public String[][] getRows()
                   throws IOException
returns a table of all attributes stored for the particular dbf-file

Returns:
String[][] a table of attributes
Throws:
IOException - an IOException

getRowNumbers

public int[] getRowNumbers(String attribute,
                           String columnName)
                    throws IOException
returns the array of rowNumbers belonging to a attribute/column pair

Parameters:
attribute - the attribute value
columnName - the name of the column
Returns:
int[] the array of shape numbers.
Throws:
IOException

isCache

public boolean isCache()
may we cache parsed data for a session. If false, every getRows results in IO activity. If true data is stored inMemory

Returns:
Returns the cache.

setCache

public void setCache(boolean cache)
Parameters:
cache - The cache to set.