edu.stanford.multiagent.gamer
Class GameOutput
java.lang.Object
|
+--edu.stanford.multiagent.gamer.GameOutput
- Direct Known Subclasses:
- DoubleOutput, GambitOutput, GTOutput, SimpleOutput, SpecialOutput, TwoPlayerOutput
- public abstract class GameOutput
- extends java.lang.Object
Super class for all game outputters.
Method Summary |
static java.lang.String |
arrayToString(java.lang.String[] args,
java.lang.String sep)
Converts an array of Strings into one long String in which
each element of the array is separated from the next by
the specified seperator. |
static java.lang.String |
commentString(java.lang.String str,
java.lang.String comment)
Properly adds and formats comments to the output in the comment
format specified. |
abstract void |
writeGame(java.io.PrintWriter out,
edu.stanford.multiagent.gamer.Game g)
Writes the game to the specified PrintWriter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GAMER_STRING
protected final java.lang.String GAMER_STRING
GameOutput
public GameOutput()
writeGame
public abstract void writeGame(java.io.PrintWriter out,
edu.stanford.multiagent.gamer.Game g)
throws java.lang.Exception
- Writes the game to the specified PrintWriter. Must be implemented
by every subclass.
- Parameters:
out
- the PrintWriter to which the game should be writteng
- the Game
- Throws:
java.lang.Exception
- if unable to write the game
commentString
public static java.lang.String commentString(java.lang.String str,
java.lang.String comment)
- Properly adds and formats comments to the output in the comment
format specified.
- Parameters:
str
- the string to add comments tocomment
- the string to use as a comment marker at the
beginning of a line
arrayToString
public static java.lang.String arrayToString(java.lang.String[] args,
java.lang.String sep)
- Converts an array of Strings into one long String in which
each element of the array is separated from the next by
the specified seperator.
- Parameters:
args
- the array of Strings to convertsep
- the separator