xBaseJ
Class Field

java.lang.Object
  |
  +--xBaseJ.Field
All Implemented Interfaces:
java.lang.Cloneable, java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
CharField, DateField, LogicalField, MemoField, NumField, PictureField

public abstract class Field
extends java.lang.Object
implements java.lang.Cloneable, java.io.Externalizable

See Also:
Serialized Form

Method Summary
 int decPoint()
          Deprecated. use getDecimalPositionCount
 java.lang.String get()
           
 byte[] getBytes()
          returns the original byte array as stored in the file.
 int getDecimalPositionCount()
           
 int getLength()
           
 java.lang.String getName()
           
 char getType()
           
 int length()
          Deprecated. use getLength
 java.lang.String name()
          Deprecated. use getName
 void put(byte[] inValue)
          set field contents with binary data, no database updates until a DBF update or write is issued if inValue is too short buffer is filled with binary zeros.
 void put(java.lang.String inValue)
          set field contents, no database updates until a DBF update or write is issued
 void readExternal(java.io.ObjectInput in)
          used by externalize methods
 char type()
          Deprecated. use getType
 void writeExternal(java.io.ObjectOutput out)
          used by externalize methods
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
used by externalize methods
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - ObjectInput stream
Throws:
java.io.IOException - - most likely class changed since written
java.lang.ClassNotFoundException - - only when dummy constructro not found

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
used by externalize methods
Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - ObjectOutput stream
Throws:
java.io.IOException - Java.io error

name

public java.lang.String name()
Deprecated. use getName

Returns:
String contianing the field name

getName

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

length

public int length()
Deprecated. use getLength

Returns:
int - the field length

getLength

public int getLength()
Returns:
int - the field length

type

public char type()
          throws xBaseJException
Deprecated. use getType

Returns:
char field type
Throws:
xBaseJException - undefined field type

getType

public char getType()
             throws xBaseJException
Returns:
char field type
Throws:
xBaseJException - undefined field type

decPoint

public int decPoint()
Deprecated. use getDecimalPositionCount

Returns:
int - the number of decimal positions for numeric fields, zero returned otherwise

getDecimalPositionCount

public int getDecimalPositionCount()
Returns:
int - the number of decimal positions for numeric fields, zero returned otherwise

get

public java.lang.String get()
Returns:
String field contents after any type of read.

getBytes

public byte[] getBytes()
returns the original byte array as stored in the file.
Returns:
byte[] - may return a null if not set

put

public void put(java.lang.String inValue)
         throws xBaseJException
set field contents, no database updates until a DBF update or write is issued
Parameters:
inValue - value to set
Throws:
xBaseJException - value length too long

put

public void put(byte[] inValue)
         throws xBaseJException
set field contents with binary data, no database updates until a DBF update or write is issued if inValue is too short buffer is filled with binary zeros.
Parameters:
inValue - byte array
Throws:
xBaseJException - value length too long