net.kano.joscar.snaccmd.search
Class SearchResultsCmd

java.lang.Object
  extended bySnacCommand
      extended bySearchCommand
          extended bySearchResultsCmd

public class SearchResultsCmd
extends SearchCommand

A SNAC command containing a list of search results. Normally sent in response to a SearchBuddiesCmd.

See Also:
SearchBuddiesCmd
Source of this SNAC:
AIM server
SNAC command type:
Family 0x0f, command 0x03

Field Summary
static int CODE_DEFAULT
          The only result code I've ever seen.
static int SUBCODE_DEFAULT
          The only result subcode I've ever seen.
 
Fields inherited from class SearchCommand
CMD_INTERESTS, CMD_INTERESTS_REQ, CMD_RESULTS, CMD_SEARCH, FAMILY_INFO, FAMILY_SEARCH
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  SearchResultsCmd(DirInfo[] results)
          Creates a new outgoing search results command with the given list of results.
  SearchResultsCmd(int code, int subCode, DirInfo[] results)
          Creates a new outgoing search results command with the given list of results and the given code and subcode.
protected SearchResultsCmd(SnacPacket packet)
          Generates a new search result list command from the given incoming SNAC packet.
 
Method Summary
 int getResultCode()
          Returns the result code sent in this command.
 DirInfo[] getResults()
          Returns the list of results sent in this command, or null if none were sent.
 int getResultSubCode()
          Returns the result "subcode" 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

CODE_DEFAULT

public static final int CODE_DEFAULT
The only result code I've ever seen.

See Also:
Constant Field Values

SUBCODE_DEFAULT

public static final int SUBCODE_DEFAULT
The only result subcode I've ever seen.

See Also:
Constant Field Values
Constructor Detail

SearchResultsCmd

protected SearchResultsCmd(SnacPacket packet)
Generates a new search result list command from the given incoming SNAC packet.

Parameters:
packet - an incoming search result list packet

SearchResultsCmd

public SearchResultsCmd(DirInfo[] results)
Creates a new outgoing search results command with the given list of results. The code and subcode are set to CODE_DEFAULT and SUBCODE_DEFAULT, respectively. Using this constructor is equivalent to using new SearchResultsCmd(SearchResultsCmd.CODE_DEFAULT, SearchResultsCmd.SUBCODE_DEFAULT, results).

Parameters:
results - the list of reuslts to send in this command

SearchResultsCmd

public SearchResultsCmd(int code,
                        int subCode,
                        DirInfo[] results)
Creates a new outgoing search results command with the given list of results and the given code and subcode.

Parameters:
code - a result code, normally CODE_DEFAULT
subCode - a result subcode, normally SUBCODE_DEFAULT
results - a list of results, or null for none
Method Detail

getResultCode

public final int getResultCode()
Returns the result code sent in this command. Normally CODE_DEFAULT.

Returns:
the result code associated with these search results

getResultSubCode

public final int getResultSubCode()
Returns the result "subcode" sent in this command. Normally SUBCODE_DEFAULT.

Returns:
the result "subcode" associated with these search results

getResults

public DirInfo[] getResults()
Returns the list of results sent in this command, or null if none were sent.

Returns:
the search results

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()