All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.PinballLog

java.lang.Object
   |
   +----pinball.PinballLog

public class PinballLog
extends Object
Used to keep track of what goes on in the game.


Variable Index

 o ballNumber
The ball for the file name.
 o dateTime
Start date/time the log file was made.
 o display
The display status, used in the file name.
 o filename
File name to log to.
 o header
The header information.
 o id
Name of the strategy.
 o information
The log information.
 o path
The path the store the file.
 o priorityLevel
Priority value to let through.
 o startOfGameTime
Start time for the log.
 o statsLog
The file to log to.

Constructor Index

 o PinballLog()

Method Index

 o ballNumber()
Set the ball number.
 o closeUp()
Writes the header and information of the ball currently in play.
 o dateTime()
Create the date and time formated string.
 o headerInfo(String, Object)
Add info to the header.
 o headerWrite()
Writes the header to the disk.
 o infoWrite()
Writes the information to the disk.
 o makeFile()
Make the log file.
 o newBall()
Set the log file for a new ball.
 o setPath(String, boolean)
Set the path of the log file.
 o setStatsFile(String, int)
Set the statistics file and priority.
 o videoLogFileName()
Get the name of the videoLogFile.
 o write(int, String, int, Object)
Write the log info on the current line.
 o writeln(int, String, int, Object)
Write the log info on a new line.

Variables

 o statsLog
 private static PrintStream statsLog
The file to log to.

 o startOfGameTime
 private static long startOfGameTime
Start time for the log.

 o priorityLevel
 private static int priorityLevel
Priority value to let through. 0 means nothing is written

 o id
 private static String id
Name of the strategy.

 o filename
 private static String filename
File name to log to.

 o ballNumber
 private static int ballNumber
The ball for the file name.

 o dateTime
 private static String dateTime
Start date/time the log file was made.

 o header
 private static Vector header
The header information.

 o information
 private static Vector information
The log information.

 o path
 private static String path
The path the store the file.

 o display
 private static String display
The display status, used in the file name.

Constructors

 o PinballLog
 public PinballLog()

Methods

 o setPath
 public static void setPath(String filePath,
                            boolean video)
Set the path of the log file.

Parameters:
filePath - the path of the file.
video - should the video be recorded as well.
 o setStatsFile
 public static void setStatsFile(String info,
                                 int priority)
Set the statistics file and priority.

Parameters:
info - the name of the stradegy.
priority - the max level priority to go through.
 o newBall
 public static synchronized void newBall()
Set the log file for a new ball.

 o makeFile
 private static void makeFile()
Make the log file.

 o videoLogFileName
 public static String videoLogFileName()
Get the name of the videoLogFile.

 o ballNumber
 private static String ballNumber()
Set the ball number.

 o writeln
 public static synchronized void writeln(int frame,
                                         String info,
                                         int level,
                                         Object called)
Write the log info on a new line.

Parameters:
frame - frame number.
info - The data to write to the log.
level - The priority level for this data.
object - caller of the method.
 o write
 public static synchronized void write(int frame,
                                       String info,
                                       int level,
                                       Object called)
Write the log info on the current line.

Parameters:
frame - frame number.
info - The data to write to the log.
level - The priority level for this data.
object - caller of the method.
 o dateTime
 private static String dateTime()
Create the date and time formated string. The format is yyyymmdd@hhmmss

 o headerInfo
 public static void headerInfo(String s,
                               Object called)
Add info to the header.

Parameters:
s - String to add to the header.
object - caller of the method.
 o headerWrite
 private static synchronized void headerWrite()
Writes the header to the disk.

 o infoWrite
 private static synchronized void infoWrite()
Writes the information to the disk.

 o closeUp
 public static void closeUp()
Writes the header and information of the ball currently in play. Called when exiting the system.


All Packages  Class Hierarchy  This Package  Previous  Next  Index