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 TypeMethodDescriptionbooleancan(Capability capability) Helps identify capabilities of the existing component.voidformat()Format a disk.<T> Optional<T> booleanreadBlock(int block) voidwriteBlock(int block, DataBuffer blockData) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
- Specified by:
getGeometryin interfaceBlockDevice
-
readBlock
- Specified by:
readBlockin interfaceBlockDevice
-
writeBlock
- Specified by:
writeBlockin 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
-