public abstract class UserDefinedEvent extends java.lang.Object implements EventIfc
Constructor and Description |
---|
UserDefinedEvent()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClassName()
Gets the event class name.
|
boolean |
isEventClass(java.lang.Class eventClass)
Indicates if this event matches a given event class.
|
boolean |
isUserDefined()
Indicates if this event is user defined or not.
|
boolean |
onText(java.lang.String buffer,
java.lang.String text)
This method is called when new text has arrived from the game server.
You can override this method to handle incoming text. Text will only be received during the WaitForEvent command. |
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 |
skipBufferText(int count)
Removes characters from the current text buffer.
|
public final boolean isEventClass(java.lang.Class eventClass)
EventIfc
isEventClass
in interface EventIfc
eventClass
- The event class.true
if this event is of the same class,
otherwise false
.public final boolean isUserDefined()
EventIfc
isUserDefined
in interface EventIfc
true
if user defined, otherwise false
.public final java.lang.String getClassName()
EventIfc
getClassName
in interface EventIfc
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 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.Exception
public boolean onText(java.lang.String buffer, java.lang.String text) throws java.lang.Exception
skipBufferText
and setBufferText
methods.buffer
- The current text buffer.text
- The new incoming text.true
to post this event or false
to wait.java.lang.Exception
skipBufferText(int)
,
setBufferText(java.lang.String)
,
printTrace(java.lang.String)