cdx.scorebot.scoring
Class TestScoreEvent

java.lang.Object
  extended by cdx.scorebot.util.Event
      extended by cdx.scorebot.scoring.ScoreEvent
          extended by cdx.scorebot.scoring.TestScoreEvent
All Implemented Interfaces:
java.io.Serializable

public class TestScoreEvent
extends ScoreEvent
implements java.io.Serializable

describes a change in score due to a penalty or bonus resulting from test results triggering a scoring rule (includes all relevant information as to why)

Author:
David Underhill
See Also:
Serialized Form

Field Summary
static java.lang.String XML_EXT
          extension for files of this type serialized to XML
 
Constructor Summary
TestScoreEvent(ScoringRule generatingRule, int scoreChange, java.lang.String title)
          Creates the TestScoreEvent from the specified parameters.
TestScoreEvent(ScoringRule generatingRule, int scoreChange, java.lang.String title, java.lang.String msg)
          Creates the TestScoreEvent from the specified parameters.
 
Method Summary
 ScoringRule getGeneratingRule()
          gets the generating rule
 Timestamp getTimeCompleted()
          gets the ending time of the last TestEvent
 Timestamp getTimeGenerated()
          gets the time the first (earliest) TestEvent completed (from the generatingRule) (note: this overloads ScoreEvents getTimeGenerated() method)
 Timestamp getTimeReported()
          the time the last TestEvent to be reported (null if not all TestEvents have been reported yet)
 void setTimeReported(Timestamp time)
          sets the time all constituent test events was reported
 java.lang.String toString()
           
 
Methods inherited from class cdx.scorebot.scoring.ScoreEvent
getExplanation, getScoringInfo, getTitle, setExplanation, setTitle
 
Methods inherited from class cdx.scorebot.util.Event
getFilename, isReported, setFilename, setTimeGenerated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_EXT

public static final java.lang.String XML_EXT
extension for files of this type serialized to XML

See Also:
Constant Field Values
Constructor Detail

TestScoreEvent

public TestScoreEvent(ScoringRule generatingRule,
                      int scoreChange,
                      java.lang.String title)
Creates the TestScoreEvent from the specified parameters. The explanation is set to the generatingRule's description.

Parameters:
generatingRule - the scoring rule which generated this ScoreEvent (includes all information about the tests that caused it to fire, etc.)
scoreChange - the number of points to add to the score (negative number => penalty)
title - a descriptive heading for the event

TestScoreEvent

public TestScoreEvent(ScoringRule generatingRule,
                      int scoreChange,
                      java.lang.String title,
                      java.lang.String msg)
Creates the TestScoreEvent from the specified parameters.

Parameters:
generatingRule - the scoring rule which generated this ScoreEvent (includes all information about the tests that caused it to fire, etc.)
scoreChange - the number of points to add to the score (negative number => penalty)
title - a descriptive heading for the event
msg - explanation for the score change
Method Detail

getTimeGenerated

public Timestamp getTimeGenerated()
gets the time the first (earliest) TestEvent completed (from the generatingRule) (note: this overloads ScoreEvents getTimeGenerated() method)

Overrides:
getTimeGenerated in class Event
Returns:
the ending time of the first TestEvent

getTimeCompleted

public Timestamp getTimeCompleted()
gets the ending time of the last TestEvent

Returns:
the ending time of the last TestEvent (null if some TestEvent hasn't completed)

getTimeReported

public Timestamp getTimeReported()
the time the last TestEvent to be reported (null if not all TestEvents have been reported yet)

Specified by:
getTimeReported in class Event
Returns:
the time the last TestEvent to be reported (null if not all TestEvents have been reported yet)

setTimeReported

public void setTimeReported(Timestamp time)
sets the time all constituent test events was reported

Specified by:
setTimeReported in class Event

getGeneratingRule

public ScoringRule getGeneratingRule()
gets the generating rule


toString

public java.lang.String toString()
Overrides:
toString in class ScoreEvent