|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSnacCommand
IcbmCommand
TypingCmd
A base class for the two typing-notification commands in this package. These
commands are SendTypingNotification
and RecvTypingNotification
.
Field Summary | |
static int |
CODE_DEFAULT
The default value for the code field. |
static int |
NULLS_DEFAULT
The default value for the nulls field. |
static int |
STATE_NO_TEXT
A typing state indicating that the user has not typed anything, or that he or she erased all of what he or she was typing. |
static int |
STATE_PAUSED
A typing state indicating that the user typed text, but then stopped. |
static int |
STATE_TYPING
A typing state indicating that the user is typing. |
Fields inherited from class IcbmCommand |
CMD_ICBM, CMD_MISSED, CMD_MSG_ACK, CMD_PARAM_INFO, CMD_PARAM_INFO_REQ, CMD_RECV_TYPING, CMD_RV_RESPONSE, CMD_SEND_ICBM, CMD_SEND_TYPING, CMD_SET_PARAM_INFO, CMD_WARN, FAMILY_ICBM, FAMILY_INFO |
Fields inherited from class SnacCommand |
SNACFLAG_DEFAULT |
Constructor Summary | |
protected |
TypingCmd(int command,
long nulls,
int code,
java.lang.String sn,
int typingState)
Creates a new typing notification command with the given properties. |
protected |
TypingCmd(int command,
SnacPacket packet)
Generates a new typing-notification command from the given incoming SNAC packet and with the given SNAC command subtype. |
protected |
TypingCmd(int command,
java.lang.String sn,
int typingState)
Creates a new typing notification command with the given SNAC command subtype to/from the given screenname with the given typing state. |
Method Summary | |
int |
getCode()
Returns the value of some sort of code sent in the typing command. |
long |
getNullBlockValue()
Returns the value of the first eight bytes of the typing notification command. |
java.lang.String |
getScreenname()
Returns the screenname of the user who is typing, if this is an incoming typing notification; otherwise, returns the screenname of the user to whom the user is typing. |
int |
getTypingState()
Returns the "typing state" sent in this command. |
java.lang.String |
toString()
|
void |
writeData(java.io.OutputStream out)
Writes this command's SNAC data block to the given stream. |
Methods inherited from class SnacCommand |
getCommand, getFamily, getFlag1, getFlag2 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NULLS_DEFAULT
nulls
field.
public static final int CODE_DEFAULT
code
field.
public static final int STATE_TYPING
public static final int STATE_PAUSED
public static final int STATE_NO_TEXT
Constructor Detail |
protected TypingCmd(int command, SnacPacket packet)
command
- the SNAC command subtype of this commandpacket
- an incoming typing-notification commandprotected TypingCmd(int command, java.lang.String sn, int typingState)
nulls
and code
fields are set to their
defaults, NULLS_DEFAULT
and CODE_DEFAULT
, respectively.
Using this constructor is equivalent to using new TypingCmd(command, TypingCmd.NULLS_DEFAULT,
TypingCmd.CODE_DEFAULT, sn, typingState)
.
command
- the SNAC command subtype of this commandsn
- the screenname to or from which this typing notification goes
or comes, respectivelytypingState
- the typing state, like STATE_NO_TEXT
protected TypingCmd(int command, long nulls, int code, java.lang.String sn, int typingState)
command
- the SNAC command subtype of this commandnulls
- a value for the first eight bytes of the typing notification
command (normally just NULLS_DEFAULT
, 0
)code
- some sort of code, normally CODE_DEFAULT
sn
- the screenname of the source or destination of this command,
depending on contexttypingState
- the typing state, like STATE_PAUSED
Method Detail |
public final long getNullBlockValue()
NULLS_DEFAULT
, which is
0
and can probably be ignored.
public final int getCode()
CODE_DEFAULT
, and can probably be ignored.
public final java.lang.String getScreenname()
public final int getTypingState()
STATE_NO_TEXT
, STATE_TYPING
, or STATE_PAUSED
.
public void writeData(java.io.OutputStream out) throws java.io.IOException
SnacCommand
writeData
in class SnacCommand
out
- the stream to which to write the SNAC data
java.io.IOException
- if an I/O error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |