net.kano.joscar.snaccmd.chat
Class UsersCmd

java.lang.Object
  extended bySnacCommand
      extended byChatCommand
          extended byUsersCmd
Direct Known Subclasses:
UsersJoinedCmd, UsersLeftCmd

public abstract class UsersCmd
extends ChatCommand

A base class for the two member-list-based commands in this package, UsersJoinedCmd and UsersLeftCmd.


Field Summary
 
Fields inherited from class ChatCommand
CMD_RECV_CHAT_MSG, CMD_ROOM_UPDATE, CMD_SEND_CHAT_MSG, CMD_USERS_JOINED, CMD_USERS_LEFT, FAMILY_CHAT, FAMILY_INFO
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
protected UsersCmd(int command, FullUserInfo[] users)
          Creates a new outgoing user-based command with the given SNAC command subtype and list of users.
protected UsersCmd(int command, SnacPacket packet)
          Creates a new user-based command from the given incoming SNAC packet.
 
Method Summary
 FullUserInfo[] getUsers()
          Returns the list of users 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
 

Constructor Detail

UsersCmd

protected UsersCmd(int command,
                   SnacPacket packet)
Creates a new user-based command from the given incoming SNAC packet.

Parameters:
command - the command's SNAC command subtype
packet - an incoming user-based SNAC packet

UsersCmd

protected UsersCmd(int command,
                   FullUserInfo[] users)
Creates a new outgoing user-based command with the given SNAC command subtype and list of users.

Parameters:
command - the SNAC command subtype of this command
users - the users this command concerns
Method Detail

getUsers

public final FullUserInfo[] getUsers()
Returns the list of users sent in this command.

Returns:
the list of users

writeData

public void writeData(java.io.OutputStream out)
               throws java.io.IOException
Description copied from class: SnacCommand
Writes this command's SNAC data block to the given stream. The SNAC data block is the data after the first ten bytes of a SNAC packet.

Specified by:
writeData in class SnacCommand
Parameters:
out - the stream to which to write the SNAC data
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()