rails.game
Class ReportBuffer

java.lang.Object
  extended by rails.game.ReportBuffer

public final class ReportBuffer
extends java.lang.Object

Class to write a log, and also to maintain a log message stack for writing to the UI. Each gameManager has one unique ReportBuffer, which is used by the public static methods. Messages before the creation of that buffer are kept in an internal initial queue. Also used for regression testing comparing the output of the report buffer.


Field Summary
static java.lang.String ACTIVE_MESSAGE_INDICATOR
          Indicator string to find the active message position in the parsed html document
 
Constructor Summary
ReportBuffer()
           
 
Method Summary
static void add(java.lang.String message)
          Add a message to the log buffer (and display it on the console)
static void addComment(java.lang.String comment)
          Add a user comment to the report window
static void addWaiting(java.lang.String message)
           
static void clear()
          clear the current buffer
static void createNewReportItem(int index)
          Creates a new report item
static java.lang.String get()
          Get the current log buffer, and clear it
static void getAllWaiting()
           
static java.util.List<java.lang.String> getAsList()
          return the current buffer as list
static java.lang.String getComment()
          Retrieves the current user comment
static java.util.SortedMap<java.lang.Integer,java.lang.String> getCommentItems()
          Retrieves all user comments
static java.lang.String getLatestReportItems()
          returns the latest report items
static java.lang.String getReportItems()
           
static void setCommentItems(java.util.SortedMap<java.lang.Integer,java.lang.String> commentItems)
          sets user comments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVE_MESSAGE_INDICATOR

public static final java.lang.String ACTIVE_MESSAGE_INDICATOR
Indicator string to find the active message position in the parsed html document

See Also:
Constant Field Values
Constructor Detail

ReportBuffer

public ReportBuffer()
Method Detail

createNewReportItem

public static void createNewReportItem(int index)
Creates a new report item


getLatestReportItems

public static java.lang.String getLatestReportItems()
returns the latest report items


getReportItems

public static java.lang.String getReportItems()

get

public static java.lang.String get()
Get the current log buffer, and clear it


add

public static void add(java.lang.String message)
Add a message to the log buffer (and display it on the console)


addComment

public static void addComment(java.lang.String comment)
Add a user comment to the report window


getComment

public static java.lang.String getComment()
Retrieves the current user comment


getCommentItems

public static java.util.SortedMap<java.lang.Integer,java.lang.String> getCommentItems()
Retrieves all user comments


setCommentItems

public static void setCommentItems(java.util.SortedMap<java.lang.Integer,java.lang.String> commentItems)
sets user comments


getAsList

public static java.util.List<java.lang.String> getAsList()
return the current buffer as list


clear

public static void clear()
clear the current buffer


addWaiting

public static void addWaiting(java.lang.String message)

getAllWaiting

public static void getAllWaiting()