@Shareable public class RatingRangeClampingFunction extends Object implements ClampingFunction, Serializable
Clamp values to the range of valid ratings. This clamping function uses the PreferenceDomain
to clamp values to fall within the minimum and maximum allowable ratings.
Constructor and Description |
---|
RatingRangeClampingFunction(PreferenceDomain dom) |
Modifier and Type | Method and Description |
---|---|
double |
apply(long user,
long item,
double value)
Clamp a value.
|
@Inject public RatingRangeClampingFunction(PreferenceDomain dom)
public double apply(long user, long item, double value)
ClampingFunction
Clamp a value.
apply
in interface ClampingFunction
user
- The user ID.item
- The item ID.value
- The value to clamp.