sg.edu.nus.protocol.body
Class FeedbackBody

java.lang.Object
  extended by sg.edu.nus.protocol.body.Body
      extended by sg.edu.nus.protocol.body.FeedbackBody
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class FeedbackBody
extends Body

Implement confirmation data type with online peer information.

The data value in confirmation body is empty.

Author:
Xu Linhao
See Also:
Serialized Form

Constructor Summary
FeedbackBody()
          Construct an empty body.
FeedbackBody(PeerInfo[] data)
          Construct a body with data objects.
 
Method Summary
 PeerInfo[] getOnlineSuperPeers()
          Get all online super peers in message body.
 PeerInfo getOnlineSuperPeers(int i)
          Get the i-th online super peers.
 void setOnlineSuperPeers(PeerInfo[] data)
          Set an array of online super peers to the message body.
 java.lang.String toString()
          Override toString() function of java.lang.Object.
 
Methods inherited from class sg.edu.nus.protocol.body.Body
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeedbackBody

public FeedbackBody()
Construct an empty body.


FeedbackBody

public FeedbackBody(PeerInfo[] data)
Construct a body with data objects.

Parameters:
data - the data objects to be feedback
Method Detail

setOnlineSuperPeers

public void setOnlineSuperPeers(PeerInfo[] data)
Set an array of online super peers to the message body.

Parameters:
data - an array of online super peers

getOnlineSuperPeers

public PeerInfo[] getOnlineSuperPeers()
Get all online super peers in message body.

Returns:
all online super peers

getOnlineSuperPeers

public PeerInfo getOnlineSuperPeers(int i)
Get the i-th online super peers.

Parameters:
i - the index number
Returns:
the instance of PeerInfo

toString

public java.lang.String toString()
Override toString() function of java.lang.Object.

Overrides:
toString in class java.lang.Object
Returns:
A string that describes the content of the body.