org.klomp.snark
class PartialPiece extends Object implements Comparable
Constructor and Description |
---|
PartialPiece(int piece,
int len)
Used by PeerCoordinator.
|
PartialPiece(Request firstOutstandingRequest)
Used by PeerState.
|
Modifier and Type | Method and Description |
---|---|
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() |
public PartialPiece(int piece, int len) throws OutOfMemoryError
piece
- Piece number requested.len
- must be equal to the piece lengthOutOfMemoryError
public PartialPiece(Request firstOutstandingRequest)
firstOutstandingRequest
- the first request not fulfilled for the piecepublic Request getRequest()
public int getPiece()
public int getDownloaded()
public long getCreated()
public int compareTo(Object o) throws ClassCastException
compareTo
in interface Comparable
ClassCastException
public boolean equals(Object o)