org.simpleflatmapper.converter.ConvertingScore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-converter Show documentation
Show all versions of sfm-converter Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
The newest version!
package org.simpleflatmapper.converter;
public class ConvertingScore {
public static final int MAX_SCORE = 256;
public static final ConvertingScore NO_MATCH = new ConvertingScore(-1, -1);
private final int fromScore;
private final int toScore;
public ConvertingScore(int fromScore, int toScore) {
this.fromScore = fromScore;
this.toScore = toScore;
}
public int getScore() {
if (toScore == -1) return -1;
// score on source
if (fromScore == -1) return -1;
return toScore * MAX_SCORE + fromScore;
}
public int getFromScore() {
return fromScore;
}
public int getToScore() {
return toScore;
}
}