|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.worldsaver.rp.Loader
This class is designed to load a world and all objects around it from a reader and to do all the connecting world. If you want to use this one, you should generally use the following way:
For interested developers, here is the way the whole thing works: first of all, this one implements the Runnable Interface (as explained above). This means, that the constructor just initializes the StreamTokenizer and the run() method does all the work. I splitted the parsing work the following way: the run() method invokes, dependant on the parsed keyword, a method called parseFoo() where Foo stands for the `end'-classes like Adventure, City etc. This method does call the superclass-like-method, for example, parseAdventure calls parseAction and parseRpBase. These methods just proove, if the current token belongs to the class-specific fields. If yes, it parses the field. Parsing of the fields goes over some data-type-like methods like parseString, parseIntIntLong etc. That results in quite a lot of methods, but provides a better overview, I think. Note that the methods that parse fields defined in abstract classes do nothing than parsing the current token and that e.g. parseAction does NOT call parseRpBase! Further, there are the prooveFoo methods which proove, if the necessary fields of the current object have been there or not.
Fields inherited from interface net.sourceforge.worldsaver.util.MiscUtils |
CONSOLE_WIDTH, NEWLINE, RANDOM |
Constructor Summary | |
Loader(java.io.Reader r)
Reads the data from the given Reader. |
Method Summary | |
java.lang.Throwable |
getException()
Returns the exception that occured during the running Thread, or null if none occured. |
long |
getLengthOfTask()
Returns the length of the task. |
java.lang.String |
getMessage()
Returns the message what the Thread is doing right now. |
long |
getStatus()
Returns the status of the current running thread. |
World |
getWorld()
Returns a reference of the just loaded World, or null, if none has been loaded. |
boolean |
isReady()
Returns whether the running thread is ready or not. |
void |
run()
This method does the large part of the work. |
java.lang.String |
versionRequired()
Returns the version string that the file specified, or '0' if none specified. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Loader(java.io.Reader r) throws java.io.IOException
r
- the Reader which contains the dataLoader
Method Detail |
public void run()
run
in interface java.lang.Runnable
Loader
public boolean isReady()
public long getStatus()
public long getLengthOfTask()
public World getWorld()
public java.lang.String versionRequired()
public java.lang.Throwable getException()
public java.lang.String getMessage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |