net.sourceforge.sqlunit.types
Class BigDecimalType

java.lang.Object
  extended by net.sourceforge.sqlunit.types.UnsupportedType
      extended by net.sourceforge.sqlunit.types.BigDecimalType
All Implemented Interfaces:
java.lang.Comparable, IType

public class BigDecimalType
extends UnsupportedType

Models a BigDecimal data type.

Version:
$Revision: 1.15 $
Author:
Ralph Brendler (rbrendler@users.sourceforge.net), Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
BigDecimalType()
           
 
Method Summary
 int compareTo(java.lang.Object obj)
          Returns a negative, zero or positive number according to whether this object is smaller, equal or larger than the passed in object.
protected  java.lang.String format(java.lang.Object obj)
          Formats a BigDecimal type.
protected  java.lang.Object parse(java.lang.String str)
          Parses a BigDecimal type.
 
Methods inherited from class net.sourceforge.sqlunit.types.UnsupportedType
equals, formatString, getId, getName, getValue, hashCode, setId, setName, setValue, toObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigDecimalType

public BigDecimalType()
Method Detail

format

protected java.lang.String format(java.lang.Object obj)
                           throws SQLUnitException
Formats a BigDecimal type.

Overrides:
format in class UnsupportedType
Parameters:
obj - an Object to be converted to the IType interface.
Returns:
the String representation of the object.
Throws:
SQLUnitException - if the formatting failed.

parse

protected java.lang.Object parse(java.lang.String str)
                          throws SQLUnitException
Parses a BigDecimal type.

Overrides:
parse in class UnsupportedType
Parameters:
str - the String representation of the object.
Returns:
an object which needs to be cast to a BigDecimal.
Throws:
SQLUnitException - if the parsing failed.

compareTo

public final int compareTo(java.lang.Object obj)
Returns a negative, zero or positive number according to whether this object is smaller, equal or larger than the passed in object.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class UnsupportedType
Parameters:
obj - an Object of type DateType.
Returns:
a negative, zero or positive number.