public interface ScoresCache
Implementations can treat this as a cache, with as much or as little persistence as required. If getScore() returns null, callers should recalculate the score and then store it for future calls. Implementations can therefore reset the cache if things which might impact the scores change.
A list of common scores are included to coordinate property names, but additional scores can be stored as well.
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
getScore(java.lang.String property)
Get the value for a particular score.
|
java.util.Set<java.lang.String> |
getScores()
Get a collection of all scores that have been set.
|
void |
putScore(java.lang.String property,
java.lang.Double score)
Add a score to the list of scores.
|
void putScore(java.lang.String property, java.lang.Double score)
property
- A string identifying the score and suitable for printing in headers.
E.g. #SCORE_TMSCORE
score
- Value of the scorejava.lang.Double getScore(java.lang.String property)
putScore(String, Double)
.property
- Name of the score to fetchjava.util.Set<java.lang.String> getScores()