Java Doc for Dbf.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.Dbf

Dbf
public class Dbf implements DbfConsts(Code)
This class represents a DBF (or DBase) file.

Construct it with a URL or File (including the .dbf) this causes the header and field definitions to be read.

Later queries return rows or columns of the database.

If a URL is specified then the whole file is read into memory
if a file is specified then a randomAccess system is used.



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

author:
   mod to getStringCol by James Macgill.

Inner Class :class DbfFileHeader

Field Summary
final static  StringDBC
    
final static  booleanDEBUG
    
 EndianDataInputStreamdFile
    
 intdata_offset
    
 intdbf_id
    
public  DbfFieldDeffielddef
    
 intfilesizenumfields
    
 booleanhasmemo
    
 booleanisFile
    
 intlast_rec
    
 intlast_update_dlast_update_mlast_update_y
    
 intposition
    
 RandomAccessFilerFile
    
 intrec_size
    
 StringBufferrecords
    

Constructor Summary
public  Dbf(URL url)
     Constructor, opens the file and reads the header infomation.
public  Dbf(InputStream in)
    
public  Dbf(String name)
    
public  Dbf(File file)
    

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  StringBuffergetFieldName(int col)
    
public  intgetFieldNumber(String name)
    
public  chargetFieldType(int col)
    
public  intgetFileSize()
     Returns the size of the database file.
public  Float[]getFloatCol(int col)
     Fetches a column of Floats from the database file.
public  Float[]getFloatCol(int col, int start, int end)
     Fetches a part column of Floats 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.

Field Detail
DBC
final static String DBC(Code)



DEBUG
final static boolean DEBUG(Code)



dFile
EndianDataInputStream dFile(Code)



data_offset
int data_offset(Code)



dbf_id
int dbf_id(Code)



fielddef
public DbfFieldDef fielddef(Code)



filesizenumfields
int filesizenumfields(Code)



hasmemo
boolean hasmemo(Code)



isFile
boolean isFile(Code)



last_rec
int last_rec(Code)



last_update_dlast_update_mlast_update_y
int last_update_dlast_update_mlast_update_y(Code)



position
int position(Code)



rFile
RandomAccessFile rFile(Code)



rec_size
int rec_size(Code)



records
StringBuffer records(Code)




Constructor Detail
Dbf
public Dbf(URL url) throws java.io.IOException, DbfFileException(Code)
Constructor, opens the file and reads the header infomation.
Parameters:
  url - the url to be opened
exception:
  java.io.IOException - If the file can't be opened.
exception:
  DbfFileException - If there is an error reading header.



Dbf
public Dbf(InputStream in) throws java.io.IOException, DbfFileException(Code)



Dbf
public Dbf(String name) throws java.io.IOException, DbfFileException(Code)



Dbf
public Dbf(File file) throws java.io.IOException, DbfFileException(Code)




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.



getFieldName
public StringBuffer getFieldName(int col)(Code)



getFieldNumber
public int getFieldNumber(String name)(Code)
looks up the field number for the given named column
Parameters:
  name - A String for the name to look up int The col number for the field, -1 if field could not be found



getFieldType
public char getFieldType(int col)(Code)



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



getFloatCol
public Float[] getFloatCol(int col) throws DbfFileException, java.io.IOException(Code)
Fetches a column of Floats 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 Float[] getFloatCol(int col, int start, int end) throws DbfFileException, java.io.IOException(Code)
Fetches a part column of Floats 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. int 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.
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.



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.