org.dbunit.dataset.datatype
Class NumberTolerantDataType

java.lang.Object
  extended by org.dbunit.dataset.datatype.DataType
      extended by org.dbunit.dataset.datatype.AbstractDataType
          extended by org.dbunit.dataset.datatype.NumberDataType
              extended by org.dbunit.dataset.datatype.NumberTolerantDataType

public final class NumberTolerantDataType
extends NumberDataType

Copy from org/dbunit/dataset/datatype/NumberDataType.java with extended version of the compare method in order to respect precision tolerance. This is comparable to the junit method assert(double val1, double val2, double toleratedDelta).

Since:
2.3.0
Version:
$Revision $
Author:
gommma

Field Summary
 
Fields inherited from class org.dbunit.dataset.datatype.DataType
BIGINT, BINARY, BIT, BLOB, BOOLEAN, CHAR, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGVARBINARY, LONGVARCHAR, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, UNKNOWN, VARBINARY, VARCHAR
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          The only method overwritten from the base implementation to compare numbers allowing a tolerance
 double getDelta()
           
 
Methods inherited from class org.dbunit.dataset.datatype.NumberDataType
getSqlValue, setSqlValue, typeCast
 
Methods inherited from class org.dbunit.dataset.datatype.AbstractDataType
getSqlType, getTypeClass, isDateTime, isNumber, loadClass, toString
 
Methods inherited from class org.dbunit.dataset.datatype.DataType
asString, forObject, forSqlType, forSqlTypeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getDelta

public double getDelta()

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
            throws TypeCastException
The only method overwritten from the base implementation to compare numbers allowing a tolerance

Overrides:
compare in class AbstractDataType
Throws:
TypeCastException - if the arguments' types prevent them from being compared by this Comparator.
See Also:
AbstractDataType.compare(java.lang.Object, java.lang.Object)


Copyright © 2002-2008. All Rights Reserved.