Package org.applecommander.os.dos
Enum Class 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUse this strategy to work with logical disk #1.Use this strategy to work with logical disk #2. -
Method Summary
Modifier and TypeMethodDescriptionint
computeBlock
(int track, int sector) Translate a track and sector reference into the proper block number.int
computeOffset
(int track, int sector) Translate a given track and sector into the proper offset into the block.getName()
The name is information used in various toString methods.static OzdosAdapterStrategy
Returns the enum constant of this class with the specified name.static OzdosAdapterStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.applecommander.device.TrackSectorToBlockStrategy
getSectorsPerTrack, getTotalTracks
-
Enum Constant Details
-
OZDOS_DISK_1
Use this strategy to work with logical disk #1. -
OZDOS_DISK_2
Use this strategy to work with logical disk #2.
-
-
Method Details
-
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
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 nameNullPointerException
- 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 interfaceTrackSectorToBlockStrategy
-
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 interfaceTrackSectorToBlockStrategy
-
getName
The name is information used in various toString methods. This ensures it is populated.- Specified by:
getName
in interfaceTrackSectorToBlockStrategy
-