jet.connect
Class DbNumber

java.lang.Object
  extended by jet.connect.DbValue
      extended by jet.connect.DbNumber
All Implemented Interfaces:
jet.util.DbValueable, jet.util.QuickSortableNode
Direct Known Subclasses:
DbBigInt, DbDecimal, DbDouble, DbInteger, DbReal, DbSmallInt, DbTinyInt

public abstract class DbNumber
extends DbValue

The super class of all number types.

In addition, this class provides several methods for some unique implementations of derived classes. Note that this class should not be initialized directly.


Field Summary
 
Fields inherited from class jet.connect.DbValue
bNull, CHAR_DESC, CURRENCY_DESC, DATE_DESC, desc, DOUBLE_DESC, INTEGER_DESC, TIME_DESC
 
Fields inherited from interface jet.util.DbValueable
EQUAL, GREATER, LESS
 
Constructor Summary
DbNumber()
          Constructs an uninitialized DbNumber.
DbNumber(DbColDesc desc)
          Constructs an uninitialized DbNumber.
 
Method Summary
abstract  byte byteValue()
          Returns the value of this DbNumber as a byte.
 int compare(DbNumber val)
          Compares this DbNumber object with the DbNumber object;
 int compareTo(DbValue v)
          Compares with the DbValue object.
abstract  double doubleValue()
          Returns the value of this DbNumber as a double.
abstract  boolean equals(DbNumber value)
          Compares this object to the specified object.
 boolean equals(DbValue v)
          Compares this object to the specified object.
abstract  float floatValue()
          Returns the value of this DbNumber as a float.
abstract  int intValue()
          Returns the value of this DbNumber as an int.
abstract  long longValue()
          Returns the value of this DbNumber as a long value.
 void set(DbValue v)
          Sets a newly allocated DbNumber object that represents the value indicated by the DbValue parameter.
abstract  void setValue(DbNumber value)
          Sets a newly allocated DbNumber object that represents the value indicated by the DbNumber parameter.
abstract  short shortValue()
          Returns the value of this DbNumber as a short.
 
Methods inherited from class jet.connect.DbValue
clone, compareTo, compareTo, equals, getColDesc, getPrecision, getScale, getSqlType, isCurrency, isNull, makeDbValue, set, set, setColDesc, setfoo, setNull, setValue, setValue, toString, toStringValue
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbNumber

public DbNumber()
Constructs an uninitialized DbNumber. This DbNumber object is mutable until a nonzero value and the description of the column are set.


DbNumber

public DbNumber(DbColDesc desc)
Constructs an uninitialized DbNumber. This DbNumber object is mutable until the value is set.

Parameters:
desc - The value to be represented by the DbColDesc object.
Method Detail

compareTo

public int compareTo(DbValue v)
Description copied from class: DbValue
Compares with the DbValue object.

Specified by:
compareTo in class DbValue
Returns:
LESS, EQUAL, or GREAT.
See Also:
DbValueable

compare

public int compare(DbNumber val)
Compares this DbNumber object with the DbNumber object;

Returns:
LESS, EQUAL, or GREAT.
See Also:
DbValueable

setValue

public abstract void setValue(DbNumber value)
Sets a newly allocated DbNumber object that represents the value indicated by the DbNumber parameter. The DbNumber object will be checked to see if it is null,

Parameters:
value - The DbNumber. If it is null, the value will not be set.

equals

public abstract boolean equals(DbNumber value)
Compares this object to the specified object. The result is true if and only if the argument is not null but a DbNumber object that contains the same DbNumber value as this object.

Parameters:
obj - The DbNumber object to be compared with.
Returns:
true if the objects are the same; false otherwise.

set

public final void set(DbValue v)
Sets a newly allocated DbNumber object that represents the value indicated by the DbValue parameter. The DbValue object will be checked to see if it is null,

Specified by:
set in class DbValue
Parameters:
v - The DbValue to be converted to a DbNumber. if it is null, the value will not be set.

equals

public final boolean equals(DbValue v)
Compares this object to the specified object. The result is true if and only if the argument is not null but a DbNumber object that contains the same DbValue value as this object.

Specified by:
equals in class DbValue
Parameters:
obj - The DbNumber object to be compared with.
Returns:
true if the objects are the same; false otherwise.

byteValue

public abstract byte byteValue()
Returns the value of this DbNumber as a byte.


shortValue

public abstract short shortValue()
Returns the value of this DbNumber as a short.


intValue

public abstract int intValue()
Returns the value of this DbNumber as an int.


longValue

public abstract long longValue()
Returns the value of this DbNumber as a long value.


floatValue

public abstract float floatValue()
Returns the value of this DbNumber as a float.


doubleValue

public abstract double doubleValue()
Returns the value of this DbNumber as a double.