com.linuxense.javadbf
Class DBFField

java.lang.Object
  |
  +--com.linuxense.javadbf.DBFField

public class DBFField
extends java.lang.Object

DBFField represents a field specification in an dbf file. DBFField objects are either created and added to a DBFWriter object or obtained from DBFReader object through getField( int) query.


Field Summary
static byte FIELD_TYPE_C
           
static byte FIELD_TYPE_D
           
static byte FIELD_TYPE_F
           
static byte FIELD_TYPE_L
           
static byte FIELD_TYPE_M
           
static byte FIELD_TYPE_N
           
 
Constructor Summary
DBFField()
           
 
Method Summary
protected static DBFField createField(java.io.DataInput in)
          Creates a DBFField object from the data read from the given DataInputStream.
 byte getDataType()
          Returns the data type of the field.
 int getDecimalCount()
          Returns the decimal part.
 int getFieldLength()
          Returns field length.
 java.lang.String getName()
          Returns the name of the field.
 void setDataType(byte value)
          Sets the data type of the field.
 void setDecimalCount(int value)
          Sets the decimal place size of the field.
 void setFieldLength(int value)
          Length of the field.
 void setFieldName(java.lang.String value)
          Deprecated. This method is depricated as of version 0.3.3.1 and is replaced by setName( String).
 void setName(java.lang.String value)
          Sets the name of the field.
protected  void write(java.io.DataOutput out)
          Writes the content of DBFField object into the stream as per DBF format specifications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_TYPE_C

public static final byte FIELD_TYPE_C
See Also:
Constant Field Values

FIELD_TYPE_L

public static final byte FIELD_TYPE_L
See Also:
Constant Field Values

FIELD_TYPE_N

public static final byte FIELD_TYPE_N
See Also:
Constant Field Values

FIELD_TYPE_F

public static final byte FIELD_TYPE_F
See Also:
Constant Field Values

FIELD_TYPE_D

public static final byte FIELD_TYPE_D
See Also:
Constant Field Values

FIELD_TYPE_M

public static final byte FIELD_TYPE_M
See Also:
Constant Field Values
Constructor Detail

DBFField

public DBFField()
Method Detail

createField

protected static DBFField createField(java.io.DataInput in)
                               throws java.io.IOException
Creates a DBFField object from the data read from the given DataInputStream. The data in the DataInputStream object is supposed to be organised correctly and the stream "pointer" is supposed to be positioned properly.

Parameters:
in - DataInputStream
Returns:
Returns the created DBFField object.
Throws:
java.io.IOException - If any stream reading problems occures.

write

protected void write(java.io.DataOutput out)
              throws java.io.IOException
Writes the content of DBFField object into the stream as per DBF format specifications.

Throws:
java.io.IOException - if any stream related issues occur.

getName

public java.lang.String getName()
Returns the name of the field.

Returns:
Name of the field as String.

getDataType

public byte getDataType()
Returns the data type of the field.

Returns:
Data type as byte.

getFieldLength

public int getFieldLength()
Returns field length.

Returns:
field length as int.

getDecimalCount

public int getDecimalCount()
Returns the decimal part. This is applicable only if the field type if of numeric in nature. If the field is specified to hold integral values the value returned by this method will be zero.

Returns:
decimal field size as int.

setFieldName

public void setFieldName(java.lang.String value)
Deprecated. This method is depricated as of version 0.3.3.1 and is replaced by setName( String).


setName

public void setName(java.lang.String value)
Sets the name of the field.

Since:
0.3.3.1

setDataType

public void setDataType(byte value)
Sets the data type of the field.


setFieldLength

public void setFieldLength(int value)
Length of the field. This method should be called before calling setDecimalCount().


setDecimalCount

public void setDecimalCount(int value)
Sets the decimal place size of the field. Before calling this method the size of the field should be set by calling setFieldLength().