org.xBaseJ.fields
Class NumField

java.lang.Object
  extended byorg.xBaseJ.fields.Field
      extended byorg.xBaseJ.fields.NumField
All Implemented Interfaces:
Cloneable, Externalizable, Serializable
Direct Known Subclasses:
FloatField

public class NumField
extends Field

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xBaseJ.fields.Field
buffer, bytebuffer, Deleted, Length, myoffset, Name, otherValidCharacters
 
Constructor Summary
NumField()
           
NumField(String iName, int iLength, int inDecPosition)
          public method for creating a numeric field object.
NumField(String iName, int iLength, int idecPosition, java.nio.ByteBuffer inBuffer)
           
 
Method Summary
 Object clone()
           
 String get()
          public method for getting field value
 int getDecimalPositionCount()
           
 char getType()
          return the character 'N' indicating a numeric field
 void put(double inValue)
          sets the field contents.
 void put(float inValue)
          sets the field contents.
 void put(int inValue)
          sets the field contents.
 void put(long inValue)
          sets the field contents.
 void put(String inValue)
          sets the field contents.
 
Methods inherited from class org.xBaseJ.fields.Field
getBytes, getLength, getName, put, read, readExternal, setBuffer, setBufferSpace, setField, update, write, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumField

public NumField()

NumField

public NumField(String iName,
                int iLength,
                int idecPosition,
                java.nio.ByteBuffer inBuffer)
         throws xBaseJException

NumField

public NumField(String iName,
                int iLength,
                int inDecPosition)
         throws xBaseJException,
                IOException
public method for creating a numeric field object. It is not associated with a database but can be when used with some DBF methods.

Parameters:
iName - the name of the field
iLength - the length of Field. range is 1 to 19 bytes
inDecPosition - the number of decimal positions range from 2 to 17 bytes. Relative to Length.
Throws:
xBaseJException - bad name, length or decimal positions specified
IOException - can not occur but defined for calling methods
See Also:
Field
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Field
Throws:
CloneNotSupportedException

getType

public char getType()
return the character 'N' indicating a numeric field

Overrides:
getType in class Field
Returns:
char field type

getDecimalPositionCount

public int getDecimalPositionCount()
Overrides:
getDecimalPositionCount in class Field
Returns:
int - the number of decimal positions

get

public String get()
public method for getting field value

Overrides:
get in class Field
Returns:
String of field value

put

public void put(String inValue)
         throws xBaseJException
sets the field contents.

Overrides:
put in class Field
Parameters:
inValue - String
Throws:
xBaseJException - most likely a format exception

put

public void put(long inValue)
         throws xBaseJException
sets the field contents.

Parameters:
inValue - long
Throws:
xBaseJException - most likely a format exception

put

public void put(int inValue)
         throws xBaseJException
sets the field contents.

Parameters:
inValue - int
Throws:
xBaseJException - most likely a format exception

put

public void put(float inValue)
         throws xBaseJException
sets the field contents.

Parameters:
inValue - float
Throws:
xBaseJException - most likely a format exception

put

public void put(double inValue)
         throws xBaseJException
sets the field contents.

Parameters:
inValue - double
Throws:
xBaseJException - most likely a format exception


Copyright 1997-2007 American Coders Ltd. All Rights Reserved.