Package org.applecommander.device
Interface TrackSectorToBlockStrategy
- All Known Implementing Classes:
OzdosAdapterStrategy
,UnidosAdapterStrategy
public interface TrackSectorToBlockStrategy
The AdapterStrategy abstracts the differing components of a device
that is expected to be composed of tracks and sectors but sits on
a block device instead. In particular, this is expected to have
the capacity to support both UniDOS and OzDOS (both support two 400K
DOS images on a 800K 3.5" floppy). Additionally, there is the
potential that the adapter will function to support DOS.MASTER
and other products where DOS was patched to fit on a hard disk.
-
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.default int
Indicates the total number of sectors per track in this device.default int
Indicates the total number of tracks in this device.
-
Method Details
-
computeBlock
int computeBlock(int track, int sector) Translate a track and sector reference into the proper block number. -
computeOffset
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. -
getTotalTracks
default int getTotalTracks()Indicates the total number of tracks in this device. The default is 50 tracks, which is the maximum number of tracks DOS will support; this method will have to be overridden for DOS.MASTER type products. -
getSectorsPerTrack
default int getSectorsPerTrack()Indicates the total number of sectors per track in this device. The default is 32 sectors per track which is the maximum number of sectors that DOS supports. Note that we do make the assumption that the disk geometry is fixed and sectors do not vary. -
getName
String getName()The name is information used in various toString methods. This ensures it is populated.
-