org.progeeks.dbf
Class DbfRecord

java.lang.Object
  extended by org.progeeks.dbf.DbfRecord
All Implemented Interfaces:
java.io.Serializable

public class DbfRecord
extends java.lang.Object
implements java.io.Serializable

Represents the values for a DBF record.

Version:
$Revision: 1.12 $
Author:
Paul Speed
See Also:
Serialized Form

Constructor Summary
DbfRecord(DbfField[] fieldDefs)
           
 
Method Summary
 int getFieldIndex(java.lang.String name)
           
 java.lang.Object getFieldValue(int i)
           
 java.lang.Object getFieldValue(java.lang.String name)
           
 void readRecord(BinaryDataInputStream in)
           
 void setFieldValue(int i, java.lang.Object value)
          Set the field value.
 void setFieldValue(java.lang.String name, java.lang.Object value)
           
 java.lang.String toString()
           
protected  void writeBoolean(BinaryDataOutputStream out, java.lang.Boolean value, int length)
           
protected  void writeDate(BinaryDataOutputStream out, java.util.Date value, int length)
           
protected  void writeNumeric(BinaryDataOutputStream out, java.lang.Object value, int length, int precision)
           
 void writeRecord(BinaryDataOutputStream out)
           
protected  void writeString(BinaryDataOutputStream out, java.lang.String value, int length, boolean leftJustify)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbfRecord

public DbfRecord(DbfField[] fieldDefs)
Method Detail

getFieldValue

public java.lang.Object getFieldValue(int i)

setFieldValue

public void setFieldValue(int i,
                          java.lang.Object value)
Set the field value. Will convert Characters and Calendars to their correct value types for insertion (String and Date respectively)

Parameters:
i - Field Index
value - One of Number, Character, Boolean, Date, Calendar, String
Throws:
java.lang.IllegalArgumentException - if the value can not go into the indexed field

getFieldValue

public java.lang.Object getFieldValue(java.lang.String name)

setFieldValue

public void setFieldValue(java.lang.String name,
                          java.lang.Object value)

getFieldIndex

public final int getFieldIndex(java.lang.String name)

readRecord

public void readRecord(BinaryDataInputStream in)
                throws java.io.IOException
Throws:
java.io.IOException

writeRecord

public void writeRecord(BinaryDataOutputStream out)
                 throws java.io.IOException
Throws:
java.io.IOException

writeString

protected void writeString(BinaryDataOutputStream out,
                           java.lang.String value,
                           int length,
                           boolean leftJustify)
                    throws java.io.IOException
Throws:
java.io.IOException

writeDate

protected void writeDate(BinaryDataOutputStream out,
                         java.util.Date value,
                         int length)
                  throws java.io.IOException
Throws:
java.io.IOException

writeBoolean

protected void writeBoolean(BinaryDataOutputStream out,
                            java.lang.Boolean value,
                            int length)
                     throws java.io.IOException
Throws:
java.io.IOException

writeNumeric

protected void writeNumeric(BinaryDataOutputStream out,
                            java.lang.Object value,
                            int length,
                            int precision)
                     throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2003 Paul Speed. All Rights Reserved.