Class DecimalQuantizer

  • All Implemented Interfaces:
    com.rapiddweller.common.Converter<java.lang.Number,​java.math.BigDecimal>, com.rapiddweller.common.ThreadAware, java.lang.Cloneable

    public class DecimalQuantizer
    extends com.rapiddweller.common.converter.ThreadSafeConverter<java.lang.Number,​java.math.BigDecimal>
    Converter that quantizes Numbers by a given 'min' value and 'granularity' and converts it into a BigDecimal.

    Created: 11.04.2011 17:53:55
    Since:
    0.6.6
    Author:
    Volker Bergmann
    • Field Summary

      • Fields inherited from class com.rapiddweller.common.converter.AbstractConverter

        sourceType, targetType
    • Constructor Summary

      Constructors 
      Constructor Description
      DecimalQuantizer​(java.math.BigDecimal min, java.math.BigDecimal granularity)
      Instantiates a new Decimal quantizer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.math.BigDecimal convert​(java.lang.Number sourceValue)  
      • Methods inherited from class com.rapiddweller.common.converter.ThreadSafeConverter

        clone, isParallelizable, isThreadSafe
      • Methods inherited from class com.rapiddweller.common.converter.AbstractConverter

        getSourceType, getTargetType
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DecimalQuantizer

        public DecimalQuantizer​(java.math.BigDecimal min,
                                java.math.BigDecimal granularity)
        Instantiates a new Decimal quantizer.
        Parameters:
        min - the min
        granularity - the granularity
    • Method Detail

      • convert

        public java.math.BigDecimal convert​(java.lang.Number sourceValue)
                                     throws com.rapiddweller.common.ConversionException
        Throws:
        com.rapiddweller.common.ConversionException