metricsOverlay.model.mappings
Class RangeInterpolator

java.lang.Object
  extended by metricsOverlay.model.mappings.RangeInterpolator

public class RangeInterpolator
extends java.lang.Object

This class provides the ability to interpolate any range value into a sensible value required by the mapping interpolator. This class requires knowledge of the different types of ranges that exist.

Shrinking Mapped Ranges is achieved by converting the map into an integer scale where each range/integer in the map is converted to a sequential sequence of map points. (e.g. Good[1,10], Bad[11-20], Ok[21-1000] gets converted to 0,1,2)

This class may be subclassed if needed. All methods should be overridden and super called.

Version:
2/9/2009
Author:
Matthew Harward

Constructor Summary
RangeInterpolator(Range curRange)
          Basic constructor.
 
Method Summary
 double getMax()
          Gets the max value of any range types.
 double getMin()
          Gets the min value of any range types.
 double interpolateValue(java.lang.String value)
          This method interpolates values dependent on the type of range they belong to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeInterpolator

public RangeInterpolator(Range curRange)
Basic constructor.

Parameters:
curRange - the range to be interpolated.
Method Detail

getMax

public double getMax()
Gets the max value of any range types. Note this method shrinks any mapped metric into an integer range.

Returns:
a double value representing the interpolation.

getMin

public double getMin()
Gets the min value of any range types. Note this method shrinks any mapped metric into an integer range.

Returns:
a double value representing the interpolation.

interpolateValue

public double interpolateValue(java.lang.String value)
This method interpolates values dependent on the type of range they belong to.

Parameters:
value - a String value representing the value to be interpolated.
Returns:
a value that can be used by mapping.