Interface ScoresCache

  • All Known Subinterfaces:
    Block, BlockSet, MultipleAlignment, MultipleAlignmentEnsemble
    All Known Implementing Classes:
    AbstractScoresCache, BlockImpl, BlockSetImpl, MultipleAlignmentEnsembleImpl, MultipleAlignmentImpl

    public interface ScoresCache
    Interface for classes which implement a temporary cache for various numeric scores, e.g. RMSD, TM-Score, etc.

    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. As a result, this is a flexible cache that can store any score as a key-value object.

    Since:
    4.1.0
    Author:
    Spencer Bliven
    • Method Detail

      • putScore

        void putScore​(String property,
                      Double score)
        Add a score to the list of scores.
        Parameters:
        property - A string identifying the score and suitable for printing in headers. Example names found in: MultipleAlignmentScorer.
        score - Value of the score
      • getScore

        Double getScore​(String property)
        Get the value for a particular score. Scores which return null should be recalculated and then stored using putScore(String, Double).
        Parameters:
        property - Name of the score to fetch
        Returns:
        Value of the score, or null if it is not set.
      • getScores

        Set<StringgetScores()
        Get a collection of all scores that have been set.
        Returns:
        Set of all score names