org.jwalk.out
Class Report

java.lang.Object
  extended by org.jwalk.out.Report
Direct Known Subclasses:
ProtocolReport, Question

public abstract class Report
extends java.lang.Object

Report is the ancestor of all kinds of report. Its descendants include: ProtocolReport, a static analysis of the test class's public interface; AlgebraReport, a dynamic analysis of the test class's algebra; StateReport, a dynamic analysis of the test class's state space; CycleReport, a dynamic analysis after one completed test cycle; and SummaryReport, a summary of test statistics after testing has finished.

A Question is also a kind of Report. A Report has textual content which is extracted using getContent(). A Question also has a query prompt, which is extracted using getQuestion(). Every kind of Report contains an enumerated Edition token indicating the kind of Report, so that clients can use getEdition() to discriminate subclasses of Report more easily, before casting a Report to a more specific type. By default, the toString() method of Report returns the same as getContent().

Version:
1.0
Author:
Anthony Simons

Field Summary
protected  Edition edition
          The edition of this Report.
protected  JWalker walker
          The JWalker which published this Report.
 
Constructor Summary
Report(Edition edition, JWalker walker)
          Creates a Report published by a JWalker.
 
Method Summary
abstract  java.lang.String getContent()
          Returns the content of this Report as formatted text.
 Edition getEdition()
          Returns the edition of this Report.
 JWalker getJWalker()
          Returns the source JWalker that published this Report.
 java.lang.String toString()
          Returns this Report as formatted text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

edition

protected Edition edition
The edition of this Report. An enumerated value denoting what kind of Report this is. Allows client programs to distinguish the main kinds of Report more easily.


walker

protected JWalker walker
The JWalker which published this Report.

Constructor Detail

Report

public Report(Edition edition,
              JWalker walker)
Creates a Report published by a JWalker.

Parameters:
walker - the JWalker publishing this Report.
Method Detail

getJWalker

public JWalker getJWalker()
Returns the source JWalker that published this Report. This is provided so that ReportEvents can find out who dispatched the Report.

Returns:
the JWalker which published this Report.

getEdition

public Edition getEdition()
Returns the edition of this Report. This is an enumerated value denoting the kind of Report (or Question), one of: {PROTOCOL_REPORT, ALGEBRA_REPORT, STATE_REPORT, CYCLE_REPORT, SUMMARY_REPORT, CONFIRM_DIALOG, NOTIFY_DIALOG}. Client programs may use this value to determine the kind of Report (or Question) before casting this to a more specific type.

Returns:
an enumerated Edition.

toString

public java.lang.String toString()
Returns this Report as formatted text. This is the standard means of presenting the whole of this Report to the user. By default, this returns the same as getContent().

Overrides:
toString in class java.lang.Object
Returns:
this Report as formatted text.

getContent

public abstract java.lang.String getContent()
Returns the content of this Report as formatted text. This is the main means of extracting the content of a Report as formatted text.

Returns:
the formatted content of this Report.