Java Doc for DbfFile.java in  » GIS » openjump » org » geotools » dbffile » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » openjump » org.geotools.dbffile 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.dbffile.DbfFile

DbfFile
public class DbfFile implements DbfConsts(Code)
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.



author:
   Ian Turton Centre for
author:
   Computaional Geography, University of Leeds, LS2 9JT, 1998.

Inner Class :class DbfFileHeader

Field Summary
final public static  SimpleDateFormatDATE_PARSER
    
final static  booleanDEBUG
    
public  EndianDataInputStreamdFile
    
 intdata_offset
    
 intdbf_id
    
public  DbfFieldDef[]fielddef
    
 intfilesize
    
 booleanhasmemo
    
 intlast_rec
    
 intlast_update_d
    
 intlast_update_m
    
 intlast_update_y
    
 intnumfields
    
 RandomAccessFilerFile
    
 intrec_size
    

Constructor Summary
protected  DbfFile()
    
public  DbfFile(String file)
     Constructor, opens the file and reads the header infomation.

Method Summary
public  StringBufferGetDbfRec(int row)
    
public  StringBufferGetNextDbfRec()
     gets the next record and returns it as a string.
public  VectorParseDbfRecord(int row)
     fetches the rowth row of the file and parses it into an vector of objects.
public  VectorParseRecord(StringBuffer rec)
    
public  ObjectParseRecordColumn(StringBuffer rec, int wantedCol)
    
public  voidclose()
    
public  StringgetFieldName(int row)
    
public  StringgetFieldType(int row)
    
public  intgetFileSize()
     Returns the size of the database file.
public  Double[]getFloatCol(int col)
     Fetches a column of Double from the database file.
public  Double[]getFloatCol(int col, int start, int end)
     Fetches a part column of Double from the database file.
public  Integer[]getIntegerCol(int col)
     Fetches a column of Integers from the database file.
public  Integer[]getIntegerCol(int col, int start, int end)
     Fetches a part column of Integers from the database file.
public  intgetLastRec()
     Returns the number of records in the database file.
public  StringgetLastUpdate()
     Returns the date of the last update of the file as a string.
public  intgetNumFields()
     Returns the number of fields in the records in the database file.
public  intgetRecSize()
     Returns the size of the records in the database file.
public  String[]getStringCol(int col)
     Fetches a column of Strings from the database file.
public  String[]getStringCol(int col, int start, int end)
     Fetches a part column of Strings from the database file.
public static  voidmain(String[] args)
    
protected  DateparseDate(String s)
    

Field Detail
DATE_PARSER
final public static SimpleDateFormat DATE_PARSER(Code)



DEBUG
final static boolean DEBUG(Code)



dFile
public EndianDataInputStream dFile(Code)



data_offset
int data_offset(Code)



dbf_id
int dbf_id(Code)



fielddef
public DbfFieldDef[] fielddef(Code)



filesize
int filesize(Code)



hasmemo
boolean hasmemo(Code)



last_rec
int last_rec(Code)



last_update_d
int last_update_d(Code)



last_update_m
int last_update_m(Code)



last_update_y
int last_update_y(Code)



numfields
int numfields(Code)



rFile
RandomAccessFile rFile(Code)



rec_size
int rec_size(Code)




Constructor Detail
DbfFile
protected DbfFile()(Code)



DbfFile
public DbfFile(String file) throws java.io.IOException, DbfFileException(Code)
Constructor, opens the file and reads the header infomation.
Parameters:
  file - The file to be opened, includes path and .dbf
exception:
  java.io.IOException - If the file can't be opened.
exception:
  DbfFileException - If there is an error reading header.




Method Detail
GetDbfRec
public StringBuffer GetDbfRec(int row) throws java.io.IOException(Code)
fetches the rowth row of the file
Parameters:
  row - - the row to fetch
exception:
  java.io.IOException - on read error.



GetNextDbfRec
public StringBuffer GetNextDbfRec() throws java.io.IOException(Code)
gets the next record and returns it as a string. This method works on a sequential stream and can not go backwards. Only useful if you want to read the whole file in one.
exception:
  java.io.IOException - on read error.



ParseDbfRecord
public Vector ParseDbfRecord(int row) throws java.io.IOException(Code)
fetches the rowth row of the file and parses it into an vector of objects.
Parameters:
  row - - the row to fetch
exception:
  java.io.IOException - on read error.



ParseRecord
public Vector ParseRecord(StringBuffer rec)(Code)
Parses the record stored in the StringBuffer rec into a vector of objects
Parameters:
  rec - the record to be parsed.



ParseRecordColumn
public Object ParseRecordColumn(StringBuffer rec, int wantedCol) throws Exception(Code)



close
public void close() throws IOException(Code)



getFieldName
public String getFieldName(int row)(Code)



getFieldType
public String getFieldType(int row)(Code)



getFileSize
public int getFileSize()(Code)
Returns the size of the database file.



getFloatCol
public Double[] getFloatCol(int col) throws DbfFileException, java.io.IOException(Code)
Fetches a column of Double from the database file.
Parameters:
  col - - the column to fetch
exception:
  java.io.IOException - - on read error
exception:
  DbfFileException - - column is not an Integer.



getFloatCol
public Double[] getFloatCol(int col, int start, int end) throws DbfFileException, java.io.IOException(Code)
Fetches a part column of Double from the database file.
Parameters:
  col - - the column to fetch
Parameters:
  start - - the row to start fetching from
Parameters:
  end - - the row to stop fetching at.
exception:
  java.io.IOException - - on read error
exception:
  DbfFileException - - column is not an Integer.



getIntegerCol
public Integer[] getIntegerCol(int col) throws java.io.IOException, DbfFileException(Code)
Fetches a column of Integers from the database file.
Parameters:
  col - - the column to fetch
exception:
  java.io.IOException - - on read error
exception:
  DbfFileException - - column is not an Integer.



getIntegerCol
public Integer[] getIntegerCol(int col, int start, int end) throws java.io.IOException, DbfFileException(Code)
Fetches a part column of Integers from the database file.
Parameters:
  col - - the column to fetch
Parameters:
  start - - the row to start fetching from
Parameters:
  end - - the row to stop fetching at.
exception:
  java.io.IOException - - on read error
exception:
  DbfFileException - - column is not an Integer.



getLastRec
public int getLastRec()(Code)
Returns the number of records in the database file.



getLastUpdate
public String getLastUpdate()(Code)
Returns the date of the last update of the file as a string.



getNumFields
public int getNumFields()(Code)
Returns the number of fields in the records in the database file.



getRecSize
public int getRecSize()(Code)
Returns the size of the records in the database file.



getStringCol
public String[] getStringCol(int col) throws DbfFileException, java.io.IOException(Code)
Fetches a column of Strings from the database file.
Parameters:
  col - - the column to fetch
exception:
  java.io.IOException - - on read error
exception:
  DbfFileException - - column is not an Integer.



getStringCol
public String[] getStringCol(int col, int start, int end) throws DbfFileException, java.io.IOException(Code)
Fetches a part column of Strings from the database file. int col - the column to fetch int start - the row to start fetching from int end - the row to stop fetching at.
exception:
  java.io.IOException - - on read error
exception:
  DbfFileException - - column is not an Integer.



main
public static void main(String[] args) throws Exception(Code)



parseDate
protected Date parseDate(String s) throws ParseException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.