Interface DiskManagerPiece

All Known Implementing Classes:
DiskManagerPieceImpl, LWSDiskManager.sePiece

public interface DiskManagerPiece
Represents a DiskManager Piece
  • Method Details

    • 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 asynchronously 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

      String getString()