📄 dbasefileheader.html
字号:
</TR></TABLE><A NAME="getFieldClass(int)"><!-- --></A><H3>getFieldClass</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> <B>getFieldClass</B>(int i)</PRE><DL><DD>Determine the most appropriate Java Class for representing the data in the field. <PRE> All packages are java.lang unless otherwise specified. C (Character) -> String N (Numeric) -> Integer or Double (depends on field's decimal count) F (Floating) -> Double L (Logical) -> Boolean D (Date) -> java.util.Date Unknown -> String </PRE><P><DD><DL><DT><B>Parameters:</B><DD><CODE>i</CODE> - The index of the field, from 0 to <CODE>getNumFields() - 1</CODE> .<DT><B>Returns:</B><DD>A Class which closely represents the dbase field type.</DL></DD></DL><HR><A NAME="addColumn(java.lang.String, char, int, int)"><!-- --></A><H3>addColumn</H3><PRE>public void <B>addColumn</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> inFieldName, char inFieldType, int inFieldLength, int inDecimalCount) throws <A HREF="../../../../../org/geotools/data/shapefile/dbf/DbaseFileException.html" title="class in org.geotools.data.shapefile.dbf">DbaseFileException</A></PRE><DL><DD>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. <B>Don't expect miracles from this...</B> <PRE> Field Type MaxLength ---------- --------- C 254 D 8 F 20 N 18 </PRE><P><DD><DL><DT><B>Parameters:</B><DD><CODE>inFieldName</CODE> - The name of the new field, must be less than 10 characters or it gets truncated.<DD><CODE>inFieldType</CODE> - A character representing the dBase field, ( see above ). Case insensitive.<DD><CODE>inFieldLength</CODE> - The length of the field, in bytes ( see above )<DD><CODE>inDecimalCount</CODE> - For numeric fields, the number of decimal places to track.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/geotools/data/shapefile/dbf/DbaseFileException.html" title="class in org.geotools.data.shapefile.dbf">DbaseFileException</A></CODE> - If the type is not recognized.</DL></DD></DL><HR><A NAME="removeColumn(java.lang.String)"><!-- --></A><H3>removeColumn</H3><PRE>public int <B>removeColumn</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> inFieldName)</PRE><DL><DD>Remove a column from this DbaseFileHeader.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inFieldName</CODE> - The name of the field, will ignore case and trim.<DT><B>Returns:</B><DD>index of the removed column, -1 if no found</DL></DD></DL><HR><A NAME="getFieldLength(int)"><!-- --></A><H3>getFieldLength</H3><PRE>public int <B>getFieldLength</B>(int inIndex)</PRE><DL><DD>Returns the field length in bytes.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inIndex</CODE> - The field index.<DT><B>Returns:</B><DD>The length in bytes.</DL></DD></DL><HR><A NAME="getFieldDecimalCount(int)"><!-- --></A><H3>getFieldDecimalCount</H3><PRE>public int <B>getFieldDecimalCount</B>(int inIndex)</PRE><DL><DD>Get the decimal count of this field.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inIndex</CODE> - The field index.<DT><B>Returns:</B><DD>The decimal count.</DL></DD></DL><HR><A NAME="getFieldName(int)"><!-- --></A><H3>getFieldName</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getFieldName</B>(int inIndex)</PRE><DL><DD>Get the field name.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inIndex</CODE> - The field index.<DT><B>Returns:</B><DD>The name of the field.</DL></DD></DL><HR><A NAME="getFieldType(int)"><!-- --></A><H3>getFieldType</H3><PRE>public char <B>getFieldType</B>(int inIndex)</PRE><DL><DD>Get the character class of the field.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inIndex</CODE> - The field index.<DT><B>Returns:</B><DD>The dbase character representing this field.</DL></DD></DL><HR><A NAME="getLastUpdateDate()"><!-- --></A><H3>getLastUpdateDate</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> <B>getLastUpdateDate</B>()</PRE><DL><DD>Get the date this file was last updated.<P><DD><DL><DT><B>Returns:</B><DD>The Date last modified.</DL></DD></DL><HR><A NAME="getNumFields()"><!-- --></A><H3>getNumFields</H3><PRE>public int <B>getNumFields</B>()</PRE><DL><DD>Return the number of fields in the records.<P><DD><DL><DT><B>Returns:</B><DD>The number of fields in this table.</DL></DD></DL><HR><A NAME="getNumRecords()"><!-- --></A><H3>getNumRecords</H3><PRE>public int <B>getNumRecords</B>()</PRE><DL><DD>Return the number of records in the file<P><DD><DL><DT><B>Returns:</B><DD>The number of records in this table.</DL></DD></DL><HR><A NAME="getRecordLength()"><!-- --></A><H3>getRecordLength</H3><PRE>public int <B>getRecordLength</B>()</PRE><DL><DD>Get the length of the records in bytes.<P><DD><DL><DT><B>Returns:</B><DD>The number of bytes per record.</DL></DD></DL><HR><A NAME="getHeaderLength()"><!-- --></A><H3>getHeaderLength</H3><PRE>public int <B>getHeaderLength</B>()</PRE><DL><DD>Get the length of the header<P><DD><DL><DT><B>Returns:</B><DD>The length of the header in bytes.</DL></DD></DL><HR><A NAME="readHeader(java.nio.channels.ReadableByteChannel)"><!-- --></A><H3>readHeader</H3><PRE>public void <B>readHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/nio/channels/ReadableByteChannel.html" title="class or interface in java.nio.channels">ReadableByteChannel</A> channel) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Read the header data from the DBF file.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>channel</CODE> - A readable byte channel. If you have an InputStream you need to use, you can call java.nio.Channels.getChannel(InputStream in).<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If errors occur while reading.</DL></DD></DL><HR><A NAME="getLargestFieldSize()"><!-- --></A><H3>getLargestFieldSize</H3><PRE>public int <B>getLargestFieldSize</B>()</PRE><DL><DD>Get the largest field size of this table.<P><DD><DL><DT><B>Returns:</B><DD>The largt field size iiin bytes.</DL></DD></DL><HR><A NAME="setNumRecords(int)"><!-- --></A><H3>setNumRecords</H3><PRE>public void <B>setNumRecords</B>(int inNumRecords)</PRE><DL><DD>Set the number of records in the file<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inNumRecords</CODE> - The number of records.</DL></DD></DL><HR><A NAME="writeHeader(java.nio.channels.WritableByteChannel)"><!-- --></A><H3>writeHeader</H3><PRE>public void <B>writeHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/nio/channels/WritableByteChannel.html" title="class or interface in java.nio.channels">WritableByteChannel</A> out) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Write the header data to the DBF file.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>out</CODE> - A channel to write to. If you have an OutputStream you can obtain the correct channel by using java.nio.Channels.newChannel(OutputStream out).<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If errors occur.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE><DL><DD>Get a simple representation of this header.<P><DD><DL><DT><B>Returns:</B><DD>A String representing the state of the header.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DbaseFileHeader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../../org/geotools/data/shapefile/dbf/DbaseFileReader.html" title="class in org.geotools.data.shapefile.dbf"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="DbaseFileHeader.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 1996-2007 <a href="http://www.geotools.org">Geotools</a>. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -