Package com.biglybt.pifimpl.local.peers
Class PeerManagerImpl.pieceFacade
- java.lang.Object
-
- com.biglybt.pifimpl.local.peers.PeerManagerImpl.pieceFacade
-
- All Implemented Interfaces:
Piece
- Enclosing class:
- PeerManagerImpl
protected class PeerManagerImpl.pieceFacade extends java.lang.Object implements Piece
-
-
Field Summary
Fields Modifier and Type Field Description private int
index
-
Constructor Summary
Constructors Modifier Constructor Description protected
pieceFacade(int _index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAllocatableRequestCount()
number of requests that are available to be madeint
getIndex()
int
getLength()
Peer
getReservedFor()
Reserve this peice for a given peer - no other peer will be asked for the pieceboolean
isDone()
boolean
isDownloading()
boolean
isFullyAllocatable()
indicates if this piece is free and available to be allocated for download not done, needed and not downloadingboolean
isNeeded()
void
setReservedFor(Peer peer)
Set the peer that will be responsible for downloading the piece
-
-
-
Method Detail
-
isDownloading
public boolean isDownloading()
- Specified by:
isDownloading
in interfacePiece
-
isFullyAllocatable
public boolean isFullyAllocatable()
Description copied from interface:Piece
indicates if this piece is free and available to be allocated for download not done, needed and not downloading- Specified by:
isFullyAllocatable
in interfacePiece
- Returns:
-
getAllocatableRequestCount
public int getAllocatableRequestCount()
Description copied from interface:Piece
number of requests that are available to be made- Specified by:
getAllocatableRequestCount
in interfacePiece
- Returns:
-
getReservedFor
public Peer getReservedFor()
Description copied from interface:Piece
Reserve this peice for a given peer - no other peer will be asked for the piece- Specified by:
getReservedFor
in interfacePiece
- Returns:
-
setReservedFor
public void setReservedFor(Peer peer)
Description copied from interface:Piece
Set the peer that will be responsible for downloading the piece- Specified by:
setReservedFor
in interfacePiece
-
-