Package com.biglybt.core.disk
Interface DiskManagerPiece
-
- All Known Implementing Classes:
DiskManagerPieceImpl
,LWSDiskManager.sePiece
public interface DiskManagerPiece
Represents a DiskManager Piece
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
calcDone()
boolean
calcNeeded()
void
clearNeeded()
void
clearWritten(int blockNumber)
int
getBlockSize(int block_index)
int
getLength()
DiskManager
getManager()
int
getNbBlocks()
int
getNbWritten()
DMPieceList
getPieceList()
int
getPieceNumber()
short
getReadCount()
int
getRemaining()
java.lang.String
getString()
boolean[]
getWritten()
boolean
isChecking()
boolean
isDone()
boolean
isDownloadable()
This must not be used to qualify pieces in End Game Mode.boolean
isInteresting()
boolean
isMergeRead()
boolean
isMergeWrite()
boolean
isNeeded()
boolean
isNeedsCheck()
boolean
isSkipped()
returns true if all the files that the piece spans are skippedboolean
isWritten()
boolean
isWritten(int blockNumber)
void
reDownloadBlock(int blockNumber)
void
reset()
void
setChecking()
void
setDone(boolean b)
void
setDownloadable()
void
setMergeRead()
void
setMergeWrite()
void
setNeeded()
void
setNeeded(boolean b)
void
setReadCount(short c)
void
setWritten(int blockNumber)
boolean
spansFiles()
-
-
-
Method Detail
-
getManager
DiskManager getManager()
-
getLength
int getLength()
-
getPieceNumber
int getPieceNumber()
-
getNbBlocks
int getNbBlocks()
-
getBlockSize
int getBlockSize(int block_index)
-
getReadCount
short getReadCount()
-
setReadCount
void setReadCount(short c)
-
calcNeeded
boolean calcNeeded()
-
clearNeeded
void clearNeeded()
-
isNeeded
boolean isNeeded()
- Returns:
- true if any file the piece covers is neither Do Not Download nor Delete. This is not a real-time indicator. Also, the results are not reliable for pieces that are Done. Use calcNeeded() for guaranteed correct and up to date results
-
setNeeded
void setNeeded()
-
setNeeded
void setNeeded(boolean b)
-
isWritten
boolean isWritten()
-
getNbWritten
int getNbWritten()
-
getWritten
boolean[] getWritten()
-
isWritten
boolean isWritten(int blockNumber)
- Parameters:
blockNumber
- int- Returns:
- true if the given blockNumber has already been written to disk
-
setWritten
void setWritten(int blockNumber)
-
clearWritten
void clearWritten(int blockNumber)
-
setChecking
void setChecking()
-
isChecking
boolean isChecking()
-
isNeedsCheck
boolean isNeedsCheck()
-
spansFiles
boolean spansFiles()
-
getPieceList
DMPieceList getPieceList()
-
calcDone
boolean calcDone()
-
isDone
boolean isDone()
- Returns:
- true when the hash check has passed and the DiskManager has asyncronously updated the Done status. There is nothing further to be done regarding downloading for pieces that are Done.
-
setDone
void setDone(boolean b)
-
isInteresting
boolean isInteresting()
- Returns:
- true if a piece is Needed and not Done
-
isDownloadable
boolean isDownloadable()
This must not be used to qualify pieces in End Game Mode.- Returns:
- true if a piece is Needed but is not fully; Requested, Downloaded, Written, Checking, or Done.
-
setDownloadable
void setDownloadable()
-
isSkipped
boolean isSkipped()
returns true if all the files that the piece spans are skipped- Returns:
-
getRemaining
int getRemaining()
-
reDownloadBlock
void reDownloadBlock(int blockNumber)
-
reset
void reset()
-
setMergeRead
void setMergeRead()
-
isMergeRead
boolean isMergeRead()
-
setMergeWrite
void setMergeWrite()
-
isMergeWrite
boolean isMergeWrite()
-
getString
java.lang.String getString()
-
-