net.sourceforge.combean.base
Class LinearMapping
java.lang.Object
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 |
LinearMapping
public LinearMapping(int scale,
int offset)
- Constructor.
- Parameters:
scale - the scaling factoroffset - the constant, additive offset
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