Enum Class UnidosAdapterStrategy

java.lang.Object
java.lang.Enum<UnidosAdapterStrategy>
org.applecommander.os.dos.UnidosAdapterStrategy
All Implemented Interfaces:
Serializable, Comparable<UnidosAdapterStrategy>, Constable, TrackSectorToBlockStrategy

public enum UnidosAdapterStrategy extends Enum<UnidosAdapterStrategy> implements TrackSectorToBlockStrategy
UniDOS implements the disk by halves -- the first 800 blocks of the disk is disk 1 while the second 800 blocks are disk 2. Therefore, each block contains two sectors of the same disk.
  • Enum Constant Details

    • UNIDOS_DISK_1

      public static final UnidosAdapterStrategy UNIDOS_DISK_1
      Use this strategy to work with logical disk #1.
    • UNIDOS_DISK_2

      public static final UnidosAdapterStrategy UNIDOS_DISK_2
      Use this strategy to work with logical disk #2.
  • Method Details

    • values

      public static UnidosAdapterStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UnidosAdapterStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • computeBlock

      public int computeBlock(int track, int sector)
      Translate a track and sector reference into the proper block number.
      Specified by:
      computeBlock in interface TrackSectorToBlockStrategy
    • computeOffset

      public int computeOffset(int track, int sector)
      Translate a given track and sector into the proper offset into the block. This is needed due to the fact that a ProDOS block is 512 bytes but a DOS sector is 256 bytes -- meaning two sectors fit into a block.
      Specified by:
      computeOffset in interface TrackSectorToBlockStrategy
    • getName

      public String getName()
      The name is information used in various toString methods. This ensures it is populated.
      Specified by:
      getName in interface TrackSectorToBlockStrategy