Class TrackSectorToBlockAdapter
java.lang.Object
org.applecommander.device.TrackSectorToBlockAdapter
- All Implemented Interfaces:
CapabilityProvider, BlockDevice, Device, HintProvider, Container, InformationProvider
Provides a _very simple_ mapping from Track/Sectors to blocks. All sector skewing is expected
to be handled in the TrackSectorDevice. As such, this device expects to map sectors in the given
("natural") order. (That is, ProDOS blocks are sectors 0,1 and 2,3 and 3,4 etc. RDOS is in physical
order. CP/M is in CP/M's expected order.)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface BlockDevice
BlockDevice.Geometry -
Field Summary
Fields inherited from interface BlockDevice
STANDARD_BLOCK_SIZE -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncalculateTrackSectorCoordinate(int block) booleancan(Capability capability) Helps identify capabilities of the existing component.voidformat()Format a disk.<T> Optional<T> Get information that describes the disk geometry.booleanreadBlock(int block) Read a single block from the disk.readRange(int block, int totalBlocks) Read a range of blocks.voidwriteBlock(int block, DataBuffer blockData) Write a single block to the disk.voidwriteRange(int block, DataBuffer rangeData) Write a range of blocks.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BlockDevice
calculateRequiredBlocks, sizeBufferMethods inherited from interface HintProvider
isAny
-
Constructor Details
-
TrackSectorToBlockAdapter
public TrackSectorToBlockAdapter(TrackSectorDevice device, TrackSectorToBlockAdapter.BlockStyle style)
-
-
Method Details
-
get
-
is
- Specified by:
isin interfaceHintProvider
-
can
Description copied from interface:CapabilityProviderHelps identify capabilities of the existing component.- Specified by:
canin interfaceCapabilityProvider
-
getGeometry
Description copied from interface:BlockDeviceGet information that describes the disk geometry.- Specified by:
getGeometryin interfaceBlockDevice
-
readBlock
Description copied from interface:BlockDeviceRead a single block from the disk.- Specified by:
readBlockin interfaceBlockDevice
-
readRange
Read a range of blocks.- Specified by:
readRangein interfaceBlockDevice
-
writeBlock
Description copied from interface:BlockDeviceWrite a single block to the disk.- Specified by:
writeBlockin interfaceBlockDevice
-
writeRange
Write a range of blocks.- Specified by:
writeRangein interfaceBlockDevice
-
information
- Specified by:
informationin interfaceInformationProvider
-
format
public void format()Description copied from interface:BlockDeviceFormat a disk. For most disks, this is simply a wipe to all zeros. If this disk has extended format (such as nibble formats), this is the opportunity to write out that format.
NOTE: Adapter type devices have to be cautious about what device is responsible about formatting. For example, a UniDOS disk is 2x400K volumes on an 800K block device -- if they defer formatting to the 800K block device, a format on one volume also wipes out the other (in this case, do not defer to the "parent"). However, if the block adapter contains a nibble-based TrackSectorDevice, the actual formatting needs to get to the nibble device so it can lay down sector markers and the rest of the track structure.
- Specified by:
formatin interfaceBlockDevice
-
calculateTrackSectorCoordinate
-