|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectplanty.FileHandler
public class FileHandler
Handles save files.
| Field Summary | |
|---|---|
static java.lang.String |
ext
The program's save file extension. |
| Constructor Summary | |
|---|---|
FileHandler()
|
|
| Method Summary | |
|---|---|
private static void |
echo()
Prints an empty line in the default PrintStream. |
private static void |
echo(java.lang.Object o)
Prints the given content. |
private static void |
echoErr(java.lang.Object o)
Prints something to the default error PrintStream. |
static Sprouling |
load()
Loads a plant from a file. |
private static java.lang.String |
read()
Executes a line-reading of the default InputStream. |
private static int |
readInt()
Runs the read() method and converts the input to int format. |
static boolean |
save(Sprouling plant)
Saves the given plant to a file. |
private static boolean |
yes()
Reades the default InputStream for an "yes" or "no". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ext
| Constructor Detail |
|---|
public FileHandler()
| Method Detail |
|---|
private static java.lang.String read()
InputStream.
null in case of error.private static int readInt()
read() method and converts the input to int format.
private static boolean yes()
InputStream for an "yes" or "no".
false if the user input "n", true otherwise.private static void echo()
PrintStream.
private static void echo(java.lang.Object o)
o - something to print.private static void echoErr(java.lang.Object o)
PrintStream.
o - the thing to print.public static boolean save(Sprouling plant)
plant - the plant whose data is to be saved as a Sprouling object.
true if file was successfully saved, false otherwise.public static Sprouling load()
Sprouling object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||