org.databene.benerator.primitive.number
Class FloatingPointQuantizer<E extends java.lang.Number>
java.lang.Object
org.databene.commons.converter.AbstractConverter<S,T>
org.databene.commons.converter.ThreadSafeConverter<E,E>
org.databene.benerator.primitive.number.FloatingPointQuantizer<E>
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<E,E>, ThreadAware
public class FloatingPointQuantizer<E extends java.lang.Number>
- extends ThreadSafeConverter<E,E>
Quantizes floating point numbers (Double or Float)
to be min plus an integral multiple of precision.
Created: 15.03.2010 15:35:05
- Since:
- 0.6.0
- Author:
- Volker Bergmann
|
Method Summary |
E |
convert(E sourceValue)
Concerts an object of type S to an object of type T |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FloatingPointQuantizer
public FloatingPointQuantizer(java.lang.Class<E> numberType,
java.lang.Double min,
double precision)
convert
public E convert(E sourceValue)
throws ConversionException
- Description copied from interface:
Converter
- Concerts an object of type S to an object of type T
- Parameters:
sourceValue - the object to convert
- Returns:
- the converted object
- Throws:
ConversionException - if the conversion fails
Copyright © 2010. All Rights Reserved.