public class LinearScore extends java.lang.Object implements ScoreFunction, Scriptable
| Modifier and Type | Field and Description |
|---|---|
static LinearScore |
IDENTITY
Linear scoring implementing an identity function.
|
| Constructor and Description |
|---|
LinearScore()
Creates a new linear score with a factor of 1.
|
LinearScore(int factor)
Creates a new linear score with the specified factor;
|
| Modifier and Type | Method and Description |
|---|---|
int |
factor() |
int |
get(int value)
Returns the score based on the specified value.
|
java.lang.Appendable |
toScript(java.lang.Appendable script)
Writes the script for the object on to the specified writer.
|
java.lang.String |
type()
Returns the type for this function.
|
public static final LinearScore IDENTITY
public LinearScore()
public LinearScore(int factor)
factor - the factor to apply.public int factor()
public java.lang.String type()
ScoreFunctiontype in interface ScoreFunctionpublic int get(int value)
ScoreFunctionget in interface ScoreFunctionvalue - The valuepublic java.lang.Appendable toScript(java.lang.Appendable script)
throws java.io.IOException
ScriptabletoScript in interface Scriptablescript - Where to write the script.Appendablejava.io.IOException - If an I/O error occurs