org.klomp.snark
Class Request

java.lang.Object
  extended by org.klomp.snark.Request

 class Request
extends Object

Holds all information needed for a partial piece request. This class should be used only by PeerState, PeerConnectionIn, and PeerConnectionOut.


Field Summary
(package private)  int len
           
(package private)  int off
           
(package private)  long sendTime
           
 
Constructor Summary
Request(PartialPiece piece, int off, int len)
          Creates a new Request.
 
Method Summary
 boolean equals(Object o)
           
 PartialPiece getPartialPiece()
          The PartialPiece this Request is for
 int getPiece()
          The piece number this Request is for
 int hashCode()
           
 void read(DataInputStream din)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

off

final int off

len

final int len

sendTime

long sendTime
Constructor Detail

Request

Request(PartialPiece piece,
        int off,
        int len)
Creates a new Request.

Parameters:
piece - Piece number requested.
off - the offset in the array.
len - the number of bytes requested.
Method Detail

read

public void read(DataInputStream din)
          throws IOException
Throws:
IOException
Since:
0.9.1

getPiece

public int getPiece()
The piece number this Request is for

Since:
0.9.1

getPartialPiece

public PartialPiece getPartialPiece()
The PartialPiece this Request is for

Since:
0.9.1

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object