Enum Class OzdosAdapterStrategy

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

public enum OzdosAdapterStrategy extends Enum<OzdosAdapterStrategy> implements TrackSectorToBlockStrategy
OzDOS implements 1 sector per block (50 tracks * 32 sectors = 1600 sectors). The differential is that disk 1 is the first half of the block while disk 2 is in the second half of the block.
  • Enum Constant Details

    • OZDOS_DISK_1

      public static final OzdosAdapterStrategy OZDOS_DISK_1
      Use this strategy to work with logical disk #1.
    • OZDOS_DISK_2

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

    • values

      public static OzdosAdapterStrategy[] 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 OzdosAdapterStrategy 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