apollo.gui
Class StoredScoreCalculator

java.lang.Object
  extended by apollo.gui.ScoreCalculator
      extended by apollo.gui.WindowScoreCalculator
          extended by apollo.gui.StoredScoreCalculator
Direct Known Subclasses:
SgrScoreCalculator, WiggleScoreCalculator

public abstract class StoredScoreCalculator
extends WindowScoreCalculator

Refactored abstract class for score calculators that store the scores in memory.


Field Summary
protected static org.apache.log4j.Logger logger
           
protected  double maxScore
           
protected  double minScore
           
protected  java.util.TreeMap<java.lang.Integer,java.lang.Double> scoreMap
           
 
Fields inherited from class apollo.gui.ScoreCalculator
factor
 
Constructor Summary
StoredScoreCalculator(int winSize)
          Builds a StoredScoreCalculator object
 
Method Summary
 double getMaxScore()
          Get the maximum score for this set
 double getMinScore()
          Get the minimum score for this set
 double getScoreForPosition(int position)
          Get the score for a given position
 double[] getScoresForPositions(int[] positions)
          Get the scores for an array of positions
 int[] getXRange()
          Get the position range covered by the scores [lowestPosition, highestPosition]
 int[] getYRange()
          Gets the score range for all scores [minScore, maxScore]
 
Methods inherited from class apollo.gui.WindowScoreCalculator
getModel, getWindowExtents, getWinSize, hasModel, setWinSize
 
Methods inherited from class apollo.gui.ScoreCalculator
getFactor, setXOrientation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

scoreMap

protected java.util.TreeMap<java.lang.Integer,java.lang.Double> scoreMap

minScore

protected double minScore

maxScore

protected double maxScore
Constructor Detail

StoredScoreCalculator

public StoredScoreCalculator(int winSize)
Builds a StoredScoreCalculator object

Parameters:
winSize - - size of display window
Method Detail

getYRange

public int[] getYRange()
Gets the score range for all scores [minScore, maxScore]

Overrides:
getYRange in class ScoreCalculator
Returns:
the score range for all scores

getScoreForPosition

public double getScoreForPosition(int position)
Description copied from class: ScoreCalculator
Get the score for a given position

Overrides:
getScoreForPosition in class ScoreCalculator
Parameters:
position - - position to get the score for
Returns:
the score for the position

getScoresForPositions

public double[] getScoresForPositions(int[] positions)
Get the scores for an array of positions

Specified by:
getScoresForPositions in class ScoreCalculator
Parameters:
positions - - positions to get the scores for
Returns:
an array of scores for each position

getXRange

public int[] getXRange()
Get the position range covered by the scores [lowestPosition, highestPosition]

Specified by:
getXRange in class ScoreCalculator
Returns:
the position range

getMinScore

public double getMinScore()
Get the minimum score for this set

Returns:
mininum score for this set

getMaxScore

public double getMaxScore()
Get the maximum score for this set

Returns:
maximum score for this set