com.twitter.common.util
Class RangeNormalizer

java.lang.Object
  extended by com.twitter.common.util.RangeNormalizer

public class RangeNormalizer
extends Object

Generic range normalizer class. Values must be positive.


Constructor Summary
RangeNormalizer(double minA, double maxA, double minB, double maxB)
           
 
Method Summary
 double normalize(double value)
           
static double normalize(double value, double minA, double maxA, double minB, double maxB)
           
static float normalizeToStepDistribution(double rating)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeNormalizer

public RangeNormalizer(double minA,
                       double maxA,
                       double minB,
                       double maxB)
Method Detail

normalize

public double normalize(double value)

normalize

public static double normalize(double value,
                               double minA,
                               double maxA,
                               double minB,
                               double maxB)

normalizeToStepDistribution

public static float normalizeToStepDistribution(double rating)