Package com.biglybt.core.lws
Class LWSDiskManager.sePiece
- java.lang.Object
-
- com.biglybt.core.lws.LWSDiskManager.sePiece
-
- All Implemented Interfaces:
DiskManagerPiece
- Enclosing class:
- LWSDiskManager
protected static class LWSDiskManager.sePiece extends java.lang.Object implements DiskManagerPiece
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
sePiece()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
calcChecking()
boolean
calcDone()
boolean
calcNeeded()
void
clearChecking()
void
clearNeeded()
void
clearWritten(int b)
int
getBlockSize(int b)
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
setChecking(boolean b)
void
setDone(boolean b)
void
setDownloadable()
void
setMergeRead()
void
setMergeWrite()
void
setNeeded()
void
setNeeded(boolean b)
void
setReadCount(short c)
void
setWritten(int b)
boolean
spansFiles()
-
-
-
Method Detail
-
clearChecking
public void clearChecking()
-
isNeedsCheck
public boolean isNeedsCheck()
- Specified by:
isNeedsCheck
in interfaceDiskManagerPiece
-
spansFiles
public boolean spansFiles()
- Specified by:
spansFiles
in interfaceDiskManagerPiece
-
getPieceList
public DMPieceList getPieceList()
- Specified by:
getPieceList
in interfaceDiskManagerPiece
-
getLength
public int getLength()
- Specified by:
getLength
in interfaceDiskManagerPiece
-
getNbBlocks
public int getNbBlocks()
- Specified by:
getNbBlocks
in interfaceDiskManagerPiece
-
getPieceNumber
public int getPieceNumber()
- Specified by:
getPieceNumber
in interfaceDiskManagerPiece
-
getBlockSize
public int getBlockSize(int b)
- Specified by:
getBlockSize
in interfaceDiskManagerPiece
-
isWritten
public boolean isWritten()
- Specified by:
isWritten
in interfaceDiskManagerPiece
-
getNbWritten
public int getNbWritten()
- Specified by:
getNbWritten
in interfaceDiskManagerPiece
-
getWritten
public boolean[] getWritten()
- Specified by:
getWritten
in interfaceDiskManagerPiece
-
reDownloadBlock
public void reDownloadBlock(int blockNumber)
- Specified by:
reDownloadBlock
in interfaceDiskManagerPiece
-
reset
public void reset()
- Specified by:
reset
in interfaceDiskManagerPiece
-
isDownloadable
public boolean isDownloadable()
Description copied from interface:DiskManagerPiece
This must not be used to qualify pieces in End Game Mode.- Specified by:
isDownloadable
in interfaceDiskManagerPiece
- Returns:
- true if a piece is Needed but is not fully; Requested, Downloaded, Written, Checking, or Done.
-
setDownloadable
public void setDownloadable()
- Specified by:
setDownloadable
in interfaceDiskManagerPiece
-
getManager
public DiskManager getManager()
- Specified by:
getManager
in interfaceDiskManagerPiece
-
calcNeeded
public boolean calcNeeded()
- Specified by:
calcNeeded
in interfaceDiskManagerPiece
-
clearNeeded
public void clearNeeded()
- Specified by:
clearNeeded
in interfaceDiskManagerPiece
-
isNeeded
public boolean isNeeded()
- Specified by:
isNeeded
in interfaceDiskManagerPiece
- 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
public void setNeeded()
- Specified by:
setNeeded
in interfaceDiskManagerPiece
-
setNeeded
public void setNeeded(boolean b)
- Specified by:
setNeeded
in interfaceDiskManagerPiece
-
setWritten
public void setWritten(int b)
- Specified by:
setWritten
in interfaceDiskManagerPiece
-
clearWritten
public void clearWritten(int b)
- Specified by:
clearWritten
in interfaceDiskManagerPiece
-
isWritten
public boolean isWritten(int blockNumber)
- Specified by:
isWritten
in interfaceDiskManagerPiece
- Parameters:
blockNumber
- int- Returns:
- true if the given blockNumber has already been written to disk
-
calcChecking
public boolean calcChecking()
-
isChecking
public boolean isChecking()
- Specified by:
isChecking
in interfaceDiskManagerPiece
-
setChecking
public void setChecking()
- Specified by:
setChecking
in interfaceDiskManagerPiece
-
setChecking
public void setChecking(boolean b)
-
calcDone
public boolean calcDone()
- Specified by:
calcDone
in interfaceDiskManagerPiece
-
isDone
public boolean isDone()
- Specified by:
isDone
in interfaceDiskManagerPiece
- 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.
-
isInteresting
public boolean isInteresting()
- Specified by:
isInteresting
in interfaceDiskManagerPiece
- Returns:
- true if a piece is Needed and not Done
-
isSkipped
public boolean isSkipped()
Description copied from interface:DiskManagerPiece
returns true if all the files that the piece spans are skipped- Specified by:
isSkipped
in interfaceDiskManagerPiece
- Returns:
-
getString
public java.lang.String getString()
- Specified by:
getString
in interfaceDiskManagerPiece
-
getReadCount
public short getReadCount()
- Specified by:
getReadCount
in interfaceDiskManagerPiece
-
setReadCount
public void setReadCount(short c)
- Specified by:
setReadCount
in interfaceDiskManagerPiece
-
isMergeRead
public boolean isMergeRead()
- Specified by:
isMergeRead
in interfaceDiskManagerPiece
-
isMergeWrite
public boolean isMergeWrite()
- Specified by:
isMergeWrite
in interfaceDiskManagerPiece
-
setMergeRead
public void setMergeRead()
- Specified by:
setMergeRead
in interfaceDiskManagerPiece
-
setMergeWrite
public void setMergeWrite()
- Specified by:
setMergeWrite
in interfaceDiskManagerPiece
-
getRemaining
public int getRemaining()
- Specified by:
getRemaining
in interfaceDiskManagerPiece
-
setDone
public void setDone(boolean b)
- Specified by:
setDone
in interfaceDiskManagerPiece
-
-