Query Cycle Simulator HEADER

qcsim.net.util
Class PeerMsgQueryResponse

java.lang.Object
  |
  +--qcsim.net.util.PeerMsgQueryResponse
All Implemented Interfaces:
PeerMessage

public class PeerMsgQueryResponse
extends java.lang.Object
implements PeerMessage

Message used to respond to a file query.

Version:
1.0
Author:
unascribed

Field Summary
 int contentCategory_
          Content category
 int fileRank_
          The fileRank.
 int sourceID_
          peer id of sending node
 
Fields inherited from interface qcsim.net.util.PeerMessage
MSG_QUERY, MSG_QUERYRESPONSE, MSG_REQUESTDOWNLOAD, MSG_REQUESTTRUST, MSG_TRUST
 
Constructor Summary
PeerMsgQueryResponse(int sourceID, int contentCategory, int fileRank)
          Constructor
PeerMsgQueryResponse(PeerMsgQueryResponse msg)
          Copy constructor.
 
Method Summary
 int contentCategory()
          Content category containing the requested file.
 int fileRank()
          The file rank requested by the peer.
 int sourceID()
          Id of peer sending the query response.
 java.lang.String toString()
           
 int type()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceID_

public int sourceID_
peer id of sending node


contentCategory_

public int contentCategory_
Content category


fileRank_

public int fileRank_
The fileRank.

Constructor Detail

PeerMsgQueryResponse

public PeerMsgQueryResponse(int sourceID,
                            int contentCategory,
                            int fileRank)
Constructor

Parameters:
sourceID - id of peer responding to query.
contentCategory - content category.
fileRank - the file rank.

PeerMsgQueryResponse

public PeerMsgQueryResponse(PeerMsgQueryResponse msg)
Copy constructor.

Parameters:
msg - message to copy
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

type

public int type()
Specified by:
type in interface PeerMessage

sourceID

public int sourceID()
Id of peer sending the query response.


contentCategory

public int contentCategory()
Content category containing the requested file.

Returns:
the content category.

fileRank

public int fileRank()
The file rank requested by the peer.

Returns:
the file rank.

Query Cycle Simulator HEADER