Login | Register
My pages Projects Community openCollabNet

The Tigris site will receive a major upgrade the evening of Monday, December 1, beginning at 8:30 pm PST. Downtime is projected to be about ten hours. Further details in the announcement


jmt.measurement
Class RankingStrategyFactory

java.lang.Object
  |
  +--jmt.measurement.RankingStrategyFactory

public final class RankingStrategyFactory
extends java.lang.Object

A static factory providing methods to create diffrent types of ranking strategies and the rank points to describe rank curves.

Provided ranking-strategies:

Linear interpolation interpolates straight lines between the rank points by ignoring the weight.
Nearest value interpolation interpolates by using the nearest fix-point's rank value to calculate the rank of the measurement value.
Plateau interpolation interpolates using bezier line between to neighboured rank-points. The weights may in a range of 0 to 1. A weight of zero (or below) means no 'rounding' and 1 (or higher) means the maximum 'rounding'.

Author:
Martin Kersten

Constructor Summary
RankingStrategyFactory()
           
 
Method Summary
static RankingStrategy createLinearInterpolation(RankingPoint[] points)
          Returns a new RankingStrategy instance using linear interpolation for rank calculation.
static RankingStrategy createNearestValueInterpolation(RankingPoint[] points)
          Returns a new RankingStrategy instance using nearest value interpolation for rank calculation.
static RankingStrategy createPlateauInterpolation(RankingPoint[] points)
          Returns a new RankingStrategy instance using plateau interpolation for rank calculation.
static RankingPoint createPoint(double value, double rank)
          Returns a RankingPoint instance representing the given value and rank.
static RankingPoint createPoint(double value, double rank, double weight)
          Returns a RankingPoint instance representing the given value, rank and weight.
static RankingPoint createPoint(double value, double rank, double leftWeight, double rightWeight)
          Returns a RankingPoint instance representing the given value, rank and weights.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankingStrategyFactory

public RankingStrategyFactory()
Method Detail

createLinearInterpolation

public static RankingStrategy createLinearInterpolation(RankingPoint[] points)
Returns a new RankingStrategy instance using linear interpolation for rank calculation.

Parameters:
points - The ranking points defining the ranking function

createNearestValueInterpolation

public static RankingStrategy createNearestValueInterpolation(RankingPoint[] points)
Returns a new RankingStrategy instance using nearest value interpolation for rank calculation.

Parameters:
points - The ranking points defining the ranking function

createPlateauInterpolation

public static RankingStrategy createPlateauInterpolation(RankingPoint[] points)
Returns a new RankingStrategy instance using plateau interpolation for rank calculation.

Parameters:
points - The ranking points defining the ranking function

createPoint

public static RankingPoint createPoint(double value,
                                       double rank)
Returns a RankingPoint instance representing the given value and rank. The weights will be set to one.

Parameters:
value - The value of the ranking point
rank - The rank of the ranking point
Returns:
A RankingPoint instance representing the given value and rank

createPoint

public static RankingPoint createPoint(double value,
                                       double rank,
                                       double weight)
Returns a RankingPoint instance representing the given value, rank and weight.

Parameters:
value - The value of the ranking point
rank - The rank of the ranking point
weight - The weight of the ranking point
Returns:
A RankingPoint instance representing the given value, rank and weight.

createPoint

public static RankingPoint createPoint(double value,
                                       double rank,
                                       double leftWeight,
                                       double rightWeight)
Returns a RankingPoint instance representing the given value, rank and weights.

Parameters:
value - The value of the ranking point
rank - The rank of the ranking point
leftWeight - The left weight of the ranking point
rightWeight - The right weight of the ranking point
Returns:
A RankingPoint instance representing the given value, rank and weight.