|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.swath.UserDefinedDaemon
User Defined Daemon base class.
| Constructor Summary | |
UserDefinedDaemon()
Constructor. |
|
| Method Summary | |
void |
enableEvents()
This method enables processing of events. |
void |
enableIncomingText()
This method enables processing of incoming text. |
void |
endDaemon()
Called by the framework when the daemon is shut down. |
java.lang.String |
getClassName()
Gets the class name. |
java.lang.String |
getName()
Called by the framework to get the name of the daemon. |
java.net.URL |
getResource(java.lang.String resource)
Finds a resource with a given name. |
boolean |
initDaemon()
Called by the framework to initialise the daemon. |
void |
onEvent(EventIfc event)
This method is called for each posted event. |
void |
onText(java.lang.String buffer,
java.lang.String text)
This method is called when new text has arrived from the game server. |
void |
onTimer(java.util.Date time)
This method is called when the timer is triggered. |
void |
postEvent(UserDefinedEvent event)
This method posts an event in the SWATH event queue. |
void |
printTrace(java.lang.Exception e)
Print an exception and the complete stack trace in the SWATH console window. |
void |
printTrace(java.lang.String text)
Print trace text in the SWATH console window. |
void |
setBufferText(java.lang.String text)
Sets the current text buffer content. |
void |
setTimer(java.util.Date time)
This method sets the timer. |
void |
setTimer(long delay)
This method sets the timer to the current time plus the delay. |
void |
skipBufferText(int count)
Removes characters from the current text buffer. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UserDefinedDaemon()
| Method Detail |
public final java.lang.String getClassName()
public final java.net.URL getResource(java.lang.String resource)
resource - The name of the wanted resource.
null if not found.public final void enableEvents()
initDaemon.onEvent method will be called
for each new event in the SWATH event queue.
onEvent(com.swath.EventIfc),
initDaemon()public final void enableIncomingText()
initDaemon.onText method will be called
when there is new text from the game server.
onText(java.lang.String, java.lang.String),
initDaemon()public final void skipBufferText(int count)
count - Number of characters to remove.setBufferText(java.lang.String),
onText(java.lang.String, java.lang.String)public final void setBufferText(java.lang.String text)
text - The new content.skipBufferText(int),
onText(java.lang.String, java.lang.String)public final void postEvent(UserDefinedEvent event)
event - The event to post.public final void setTimer(java.util.Date time)
time - When the timer should trigger or
null to reset the timer.onTimer(java.util.Date),
setTimer(long)public final void setTimer(long delay)
delay - The delay in milliseconds.onTimer(java.util.Date),
setTimer(Date)
public final void printTrace(java.lang.String text)
throws java.lang.Exception
text - The text to print.
java.lang.Exception
public final void printTrace(java.lang.Exception e)
throws java.lang.Exception
e - The exception to print.
java.lang.Exceptionpublic java.lang.String getName()
public boolean initDaemon()
throws java.lang.Exception
true if the initialisation was successful,
otherwise false.
java.lang.ExceptionenableEvents(),
enableIncomingText(),
postEvent(com.swath.UserDefinedEvent),
setTimer(java.util.Date),
printTrace(java.lang.String),
onTimer(java.util.Date),
onText(java.lang.String, java.lang.String),
onEvent(com.swath.EventIfc)
public void endDaemon()
throws java.lang.Exception
java.lang.Exception
public void onTimer(java.util.Date time)
throws java.lang.Exception
time - The current time.
java.lang.ExceptionpostEvent(com.swath.UserDefinedEvent),
setTimer(java.util.Date),
printTrace(java.lang.String)
public void onText(java.lang.String buffer,
java.lang.String text)
throws java.lang.Exception
setIncomingTextMode to enable this callback method.skipBufferText and setBufferText methods.
buffer - The current text buffer.text - The new incoming text.
java.lang.ExceptionenableIncomingText(),
skipBufferText(int),
setBufferText(java.lang.String),
postEvent(com.swath.UserDefinedEvent),
setTimer(java.util.Date),
printTrace(java.lang.String)
public void onEvent(EventIfc event)
throws java.lang.Exception
event - The event.
java.lang.ExceptionenableEvents(),
postEvent(com.swath.UserDefinedEvent),
setTimer(java.util.Date),
printTrace(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||