cdx.scorebot.scoring
Class ScoringInfo

java.lang.Object
  extended by cdx.scorebot.scoring.ScoringInfo
All Implemented Interfaces:
java.io.Serializable

public class ScoringInfo
extends java.lang.Object
implements java.io.Serializable

Describes a score change as well as any thresholds which modify that change

Author:
David Underhill
See Also:
Serialized Form

Constructor Summary
ScoringInfo(int scoreChange)
          constructs a ScoringInfo with the specified score change; the ThresholdType is assumed to be NOT_THRESHOLDED since no ScoreEvents are provided
 
Method Summary
 void addAggravatingEvent(ScoreEvent evt)
          Adds a ScoreEvent to denote as an aggravating event (one that impacted the score change caused by this).
 int getActualScoreChange()
          gets the actual score change
 ScoreEvent getAggravatingEvent(int index)
          Gets the specified ScoreEvent which impacted the score change caused by this.
 java.util.Vector<ScoreEvent> getAggravatingEvents()
          gets the ScoreEvents which caused this score's impact to be reduced due to ThresholdType.MAX_RULE_PENALTY_TIME only (if any)
 int getScoreChange()
          gets the unthresholded number of points to add to the score (negative number => penalty)
 int getThresholdedScoreChange()
          gets the thresholded # of points to add to the score (negative # => penalty)
 ThresholdType getThresholdType()
          gets the kind of threshold is being applied
 void removeAggravatingEvent(int index)
          Removes the ScoreEvent from the list of aggravating events which impacted the score change caused by this.
 void setScoreChange(int scoreChange)
          sets the unthresholded number of points to add to the score (negative number => penalty)
 void setThresholdedScoreChange(int thresholdedScoreChange)
          sets the thresholded # of points to add to the score (negative # => penalty)
 void setThresholdType(ThresholdType type)
          sets the kind of threshold is being applied
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScoringInfo

public ScoringInfo(int scoreChange)
constructs a ScoringInfo with the specified score change; the ThresholdType is assumed to be NOT_THRESHOLDED since no ScoreEvents are provided

Parameters:
scoreChange - the unthresholded # of points to add to the score (negative # => penalty)
Method Detail

addAggravatingEvent

public void addAggravatingEvent(ScoreEvent evt)
Adds a ScoreEvent to denote as an aggravating event (one that impacted the score change caused by this). Due to ThresholdType.MAX_RULE_PENALTY_TIME only.

Parameters:
evt - the ScoreEvent to add to this ScoringInfo

removeAggravatingEvent

public void removeAggravatingEvent(int index)
                            throws java.lang.ArrayIndexOutOfBoundsException
Removes the ScoreEvent from the list of aggravating events which impacted the score change caused by this. Due to ThresholdType.MAX_RULE_PENALTY_TIME only.

Parameters:
index - remove the ScoreEvent at the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.

getAggravatingEvent

public ScoreEvent getAggravatingEvent(int index)
                               throws java.lang.ArrayIndexOutOfBoundsException
Gets the specified ScoreEvent which impacted the score change caused by this. Due to ThresholdType.MAX_RULE_PENALTY_TIME only.

Returns:
the ScoreEvent at the specified index in the ScoreEvent vector
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.

getAggravatingEvents

public java.util.Vector<ScoreEvent> getAggravatingEvents()
gets the ScoreEvents which caused this score's impact to be reduced due to ThresholdType.MAX_RULE_PENALTY_TIME only (if any)


getActualScoreChange

public int getActualScoreChange()
gets the actual score change

Returns:
getScoreChange() if no threshold has been applied; otherwise, returns getThresholdedScoreChange()

getScoreChange

public int getScoreChange()
gets the unthresholded number of points to add to the score (negative number => penalty)


setScoreChange

public void setScoreChange(int scoreChange)
sets the unthresholded number of points to add to the score (negative number => penalty)


getThresholdedScoreChange

public int getThresholdedScoreChange()
gets the thresholded # of points to add to the score (negative # => penalty)


setThresholdedScoreChange

public void setThresholdedScoreChange(int thresholdedScoreChange)
sets the thresholded # of points to add to the score (negative # => penalty)


getThresholdType

public ThresholdType getThresholdType()
gets the kind of threshold is being applied


setThresholdType

public void setThresholdType(ThresholdType type)
sets the kind of threshold is being applied