|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Interface for objects which support parsing from and output to a character stream. Although Java provides no way to specify it, all objects implementing this interface must provide a method with one or both of the following exact signatures:
public static Parseable loadYourself(TokenStream s) throws IOException;
public static Parseable loadYourself(Reader r) throws IOException;
These methods support input from a Reader object or,
if the implementer prefers, a TokenStream object.
TokenStream is not specified here and must be provided
by the implementer, but the intention is that it should translate a
raw character input stream into a sequence of tokens, provide a
pushback facility, etc.
Note: This interface provides a printLastMove(java.io.Writer) method that is specific to the
PuzzleMuncher project. To use this code elsewhere,
please remove that method from this interface. Its inclusion here
is something of a sub-optimal design choice...
| Method Summary | |
void |
printLastMove(java.io.Writer w)
Print a formatted representation of a move (action) to an output stream. |
void |
printYourself(java.io.Writer w)
Print a formatted representation of the current object to an output stream. |
| Method Detail |
public void printYourself(java.io.Writer w)
throws java.io.IOException
loadYourself() method(s).
w - Output stream onto which the object will be formatted.
java.io.IOException - In case of an error while writing to
the output stream.
public void printLastMove(java.io.Writer w)
throws java.io.IOException
Note: This method is specific to the
PuzzleMuncher project and to PuzState
objects in particular. If you wish to apply the
Parseable interface to other applications, please
remove this method from the interface.
w - Output stream onto which the object will be formatted.
java.io.IOException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||