openlist.util
Class IntegerScaler

java.lang.Object
  extended by openlist.util.IntegerScaler
All Implemented Interfaces:
Function1arg

public class IntegerScaler
extends java.lang.Object
implements Function1arg

A Scaler (not scaler) multiplies its argument by a fixed value, as specified in the constructor.


Field Summary
(package private)  int factor
           
 
Constructor Summary
IntegerScaler(int factor)
          Create a Scaler to multiply Integers by a fixed factor.
 
Method Summary
 java.lang.Integer apply(java.lang.Object arg)
          Apply this Scaler to an argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factor

int factor
Constructor Detail

IntegerScaler

public IntegerScaler(int factor)
Create a Scaler to multiply Integers by a fixed factor.

Parameters:
factor - the int by which the argument of the function is multiplied
Method Detail

apply

public java.lang.Integer apply(java.lang.Object arg)
Apply this Scaler to an argument.

Specified by:
apply in interface Function1arg
Parameters:
arg - the value to be scaled
Returns:
the arg times the factor