Class AbstractScorer
- java.lang.Object
-
- org.biojava.nbio.alignment.template.AbstractScorer
-
- All Implemented Interfaces:
Scorer
- Direct Known Subclasses:
AbstractMatrixAligner
,FractionalIdentityScorer
,FractionalSimilarityScorer
,StandardRescoreRefiner
,SubstitutionMatrixScorer
public abstract class AbstractScorer extends Object implements Scorer
Implements common code for algorithms which compute a score.- Author:
- Mark Chapman
-
-
Constructor Summary
Constructors Constructor Description AbstractScorer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDistance()
Returns score as a distance between 0.0 and 1.0.double
getDistance(double scale)
Returns score as a distance between 0.0 and scale.double
getSimilarity()
Returns score as a similarity between 0.0 and 1.0.double
getSimilarity(double scale)
Returns score as a similarity between 0.0 and scale.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.nbio.alignment.template.Scorer
getMaxScore, getMinScore, getScore
-
-
-
-
Constructor Detail
-
AbstractScorer
public AbstractScorer()
-
-
Method Detail
-
getDistance
public double getDistance()
Description copied from interface:Scorer
Returns score as a distance between 0.0 and 1.0. This equals (Scorer.getMaxScore()
-Scorer.getScore()
) / (Scorer.getMaxScore()
-Scorer.getMinScore()
).- Specified by:
getDistance
in interfaceScorer
- Returns:
- score as a distance between 0.0 and 1.0
-
getDistance
public double getDistance(double scale)
Description copied from interface:Scorer
Returns score as a distance between 0.0 and scale. This equals scale * (Scorer.getMaxScore()
-Scorer.getScore()
) / (Scorer.getMaxScore()
-Scorer.getMinScore()
).- Specified by:
getDistance
in interfaceScorer
- Parameters:
scale
- maximum distance- Returns:
- score as a distance between 0.0 and scale
-
getSimilarity
public double getSimilarity()
Description copied from interface:Scorer
Returns score as a similarity between 0.0 and 1.0. This equals (Scorer.getScore()
-Scorer.getMinScore()
) / (Scorer.getMaxScore()
-Scorer.getMinScore()
).- Specified by:
getSimilarity
in interfaceScorer
- Returns:
- score as a similarity between 0.0 and 1.0
-
getSimilarity
public double getSimilarity(double scale)
Description copied from interface:Scorer
Returns score as a similarity between 0.0 and scale. This equals scale * (Scorer.getScore()
-Scorer.getMinScore()
) / (Scorer.getMaxScore()
-Scorer.getMinScore()
).- Specified by:
getSimilarity
in interfaceScorer
- Parameters:
scale
- maximum similarity- Returns:
- score as a similarity between 0.0 and scale
-
-