|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.klomp.snark.PartialPiece
class PartialPiece
This is the class passed from PeerCoordinator to PeerState so PeerState may start requests. It is also passed from PeerState to PeerCoordinator when a piece is not completely downloaded, for example when the Peer disconnects or chokes.
Constructor Summary | |
---|---|
PartialPiece(int piece,
int len)
Used by PeerCoordinator. |
|
PartialPiece(Request firstOutstandingRequest)
Used by PeerState. |
Method Summary | |
---|---|
int |
compareTo(Object o)
Highest downloaded first |
boolean |
equals(Object o)
Make this simple so PeerCoordinator can keep a List. |
long |
getCreated()
|
int |
getDownloaded()
how many bytes are good |
int |
getPiece()
piece number |
Request |
getRequest()
Convert this PartialPiece to a request for the next chunk. |
int |
hashCode()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PartialPiece(int piece, int len) throws OutOfMemoryError
piece
- Piece number requested.len
- must be equal to the piece length
OutOfMemoryError
public PartialPiece(Request firstOutstandingRequest)
firstOutstandingRequest
- the first request not fulfilled for the pieceMethod Detail |
---|
public Request getRequest()
public int getPiece()
public int getDownloaded()
public long getCreated()
public int compareTo(Object o) throws ClassCastException
compareTo
in interface Comparable
ClassCastException
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |