xBaseJ
Class NumField

java.lang.Object
  |
  +--xBaseJ.Field
        |
        +--xBaseJ.NumField
Direct Known Subclasses:
FloatField

public class NumField
extends Field


Constructor Summary
NumField(java.lang.String iName, int iLength, int inDecPosition)
          public method for creating a numeric field object.
 
Method Summary
 int decPosition()
          Deprecated. use getDecimalPositionCount
 java.lang.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(java.lang.String inValue)
          sets the field contents.
 char type()
          Deprecated. use getType
 
Methods inherited from class xBaseJ.Field
decPoint, getBytes, getLength, getName, length, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumField

public NumField(java.lang.String iName,
                int iLength,
                int inDecPosition)
         throws xBaseJException,
                java.io.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:
Name - the name of the field
Length - the length of Field. range is 1 to 19 bytes
decPosition - the number of decimal positions range from 2 to 17 bytes. Relative to Length.
Throws:
xBaseJException - bad name, length or decimal positions specified
java.io.IOException - can not occur but defined for calling methods
See Also:
Field
Method Detail

type

public char type()
Deprecated. use getType

return the character 'N' indicating a numeric field
Overrides:
type in class Field
Tags copied from class: Field
Returns:
char field type
Throws:
xBaseJException - undefined field type

getType

public char getType()
return the character 'N' indicating a numeric field
Overrides:
getType in class Field
Tags copied from class: Field
Returns:
char field type
Throws:
xBaseJException - undefined field type

decPosition

public int decPosition()
Deprecated. use getDecimalPositionCount

return the number of decimal positions

getDecimalPositionCount

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

get

public java.lang.String get()
public method for getting field value
Overrides:
get in class Field
Tags copied from class: Field
Returns:
String field contents after any type of read.

put

public void put(java.lang.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