org.gudy.azureus2.pluginsimpl.local.peers
Class PeerManagerImpl.pieceFacade

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.peers.PeerManagerImpl.pieceFacade
All Implemented Interfaces:
Piece
Enclosing class:
PeerManagerImpl

protected class PeerManagerImpl.pieceFacade
extends java.lang.Object
implements Piece


Constructor Summary
protected PeerManagerImpl.pieceFacade(int _index)
           
 
Method Summary
 int getAllocatableRequestCount()
          number of requests that are available to be made
 int getIndex()
           
 int getLength()
           
 Peer getReservedFor()
          Reserve this peice for a given peer - no other peer will be asked for the piece
 boolean isDone()
           
 boolean isDownloading()
           
 boolean isFullyAllocatable()
          indicates if this piece is free and available to be allocated for download not done, needed and not downloading
 boolean isNeeded()
           
 void setReservedFor(Peer peer)
          Set the peer that will be responsible for downloading the piece
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerManagerImpl.pieceFacade

protected PeerManagerImpl.pieceFacade(int _index)
Method Detail

getIndex

public int getIndex()
Specified by:
getIndex in interface Piece

getLength

public int getLength()
Specified by:
getLength in interface Piece

isDone

public boolean isDone()
Specified by:
isDone in interface Piece

isNeeded

public boolean isNeeded()
Specified by:
isNeeded in interface Piece

isDownloading

public boolean isDownloading()
Specified by:
isDownloading in interface Piece

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 interface Piece
Returns:

getAllocatableRequestCount

public int getAllocatableRequestCount()
Description copied from interface: Piece
number of requests that are available to be made

Specified by:
getAllocatableRequestCount in interface Piece
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 interface Piece
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 interface Piece