Query Cycle Simulator HEADER

qcsim.net.util
Class Upload

java.lang.Object
  |
  +--qcsim.net.util.Upload

public class Upload
extends java.lang.Object

Provides an interface to simulate the upload of a file.

Version:
1.0
Author:
unascribed

Field Summary
(package private)  int downloadPeerID_
          peer ID of downloading peer
(package private)  double kbyteLeft_
          kbytes left to be transferred
(package private)  double transferRate_
          transfer rate of upload
 
Constructor Summary
Upload(int downloadPeerID, double transferRate, double kbyteLeft)
          Constructor
 
Method Summary
 void setTransferRate(double rate)
          Set the transfer rate
 boolean upload(int numSec)
          Simulates upload for some seconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

downloadPeerID_

int downloadPeerID_
peer ID of downloading peer


transferRate_

double transferRate_
transfer rate of upload


kbyteLeft_

double kbyteLeft_
kbytes left to be transferred

Constructor Detail

Upload

public Upload(int downloadPeerID,
              double transferRate,
              double kbyteLeft)
Constructor

Parameters:
downloadPeerID - peer ID of downloading peer
transferRate - transfer rate of upload
kbyteLeft - kbytes left to be transferred
Method Detail

setTransferRate

public void setTransferRate(double rate)
Set the transfer rate

Parameters:
rate - the transfer rate

upload

public boolean upload(int numSec)
Simulates upload for some seconds

Parameters:
numSec - number of seconds to be simulated
Returns:
true if download is finished

Query Cycle Simulator HEADER