net.sourceforge.combean.base
Class LinearMapping

Package class diagram package LinearMapping
java.lang.Object
  extended by net.sourceforge.combean.base.LinearMapping
All Implemented Interfaces:
IndexMapping

public class LinearMapping
extends Object
implements IndexMapping

A linear mapping f(x) = cx + t.


Constructor Summary
LinearMapping(int scale, int offset)
          Constructor.
 
Method Summary
 int mapIndex(int origIndex)
          Mapping function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearMapping

public LinearMapping(int scale,
                     int offset)
Constructor.

Parameters:
scale - the scaling factor
offset - the constant, additive offset
Method Detail

mapIndex

public int mapIndex(int origIndex)
Description copied from interface: IndexMapping
Mapping function.

Specified by:
mapIndex in interface IndexMapping
Parameters:
origIndex - the original index value to be mapped
Returns:
the mapped index value