类 PositionTrackingStorage

java.lang.Object
cn.nukkit.positiontracking.PositionTrackingStorage
所有已实现的接口:
Closeable, AutoCloseable

@PowerNukkitOnly @Since("1.4.0.0-PN") @ParametersAreNonnullByDefault public class PositionTrackingStorage extends Object implements Closeable
Stores a sequential range of PositionTracking objects in a file. The read operation is cached.

This object holds a file handler and must be closed when it is no longer needed.

Once closed the instance cannot be reused.

作者:
joserobjr
  • 字段详细资料

  • 构造器详细资料

    • PositionTrackingStorage

      @PowerNukkitOnly @Since("1.4.0.0-PN") public PositionTrackingStorage(int startIndex, File persistenceFile) throws IOException
      Opens or create the file and all directories in the path automatically. The given start index will be used in new files and will be checked when opening files. If the file being opened don't matches this value internally than an IllegalArgumentException will be thrown.
      参数:
      startIndex - The number of the first handler. Must be higher than 0 and must match the number of the existing file.
      persistenceFile - The file being opened or created. Parent directories will also be created if necessary.
      抛出:
      IOException - If an error has occurred while reading, parsing or creating the file
      IllegalArgumentException - If opening an existing file and the internal startIndex don't match the given startIndex
    • PositionTrackingStorage

      @PowerNukkitOnly @Since("1.4.0.0-PN") public PositionTrackingStorage(int startIndex, File persistenceFile, int maxStorage) throws IOException
      Opens or create the file and all directories in the path automatically. The given start index will be used in new files and will be checked when opening files. If the file being opened don't matches this value internally than an IllegalArgumentException will be thrown.
      参数:
      startIndex - The number of the first handler. Must be higher than 0 and must match the number of the existing file.
      persistenceFile - The file being opened or created. Parent directories will also be created if necessary.
      maxStorage - The maximum amount of positions that this storage may hold. It cannot be changed after creation. Ignored when loading an existing file. When zero or negative, a default value will be used.
      抛出:
      IOException - If an error has occurred while reading, parsing or creating the file
      IllegalArgumentException - If opening an existing file and the internal startIndex don't match the given startIndex
  • 方法详细资料