|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webcodepro.applecommander.storage.Disk
public class Disk
Abstract representation of an Apple2 disk (floppy, 800k, hard disk).
Date created: Oct 3, 2002 10:59:47 PM
Nested Class Summary | |
---|---|
class |
Disk.FilenameFilter
Specifies a filter to be used in determining filetypes which are supported. |
Field Summary | |
---|---|
static int |
APPLE_10MB_HARDDISK
|
static int |
APPLE_140KB_DISK
|
static int |
APPLE_140KB_NIBBLE_DISK
|
static int |
APPLE_20MB_HARDDISK
|
static int |
APPLE_32MB_HARDDISK
|
static int |
APPLE_5MB_HARDDISK
|
static int |
APPLE_800KB_2IMG_DISK
|
static int |
APPLE_800KB_DISK
|
static int |
BLOCK_SIZE
|
static int |
DOS33_SECTORS_ON_140KB_DISK
|
static int |
PRODOS_BLOCKS_ON_140KB_DISK
|
static int |
SECTOR_SIZE
|
Constructor Summary | |
---|---|
|
Disk(java.lang.String filename)
Construct a Disk and load the specified file. |
protected |
Disk(java.lang.String filename,
ImageOrder imageOrder)
Construct a Disk with the given byte array. |
Method Summary | |
---|---|
ByteArrayImageLayout |
getDiskImageManager()
Returns the diskImage. |
java.lang.String |
getFilename()
Returns the filename. |
static Disk.FilenameFilter[] |
getFilenameFilters()
Get the supported file filters supported by the Disk interface. |
FormattedDisk[] |
getFormattedDisks()
Determine type of disk, and return the appropriate FormattedDisk object. |
ImageOrder |
getImageOrder()
Answer with the phyiscal ordering of the disk. |
int |
getPhysicalSize()
Identify the size of this disk. |
boolean |
hasChanged()
Indicates if the disk has changed. |
protected boolean |
is140KbDisk()
Answers true if this disk image is within the expected 140K disk size. |
boolean |
is2ImgOrder()
Indicate if this disk is a 2IMG disk. |
protected boolean |
is800KbDisk()
Answers true if this disk image is within the expected 800K disk size. |
boolean |
isCompressed()
Indicate if this disk is GZIP compressed. |
boolean |
isCpmFormat()
Test the disk format to see if this is a CP/M formatted disk. |
boolean |
isDosFormat()
Test the disk format to see if this is a DOS 3.3 formatted disk. |
boolean |
isDosOrder()
Indicate if this disk is DOS ordered (T0,S0 - T35,S15). |
boolean |
isNewImage()
Indicates if the disk image is new. |
boolean |
isNibbleOrder()
Indicate if this disk is a nibbilized disk.. |
boolean |
isOzDosFormat()
Test the disk format to see if this is a OzDOS formatted disk. |
boolean |
isPascalFormat()
Test the disk format to see if this is a Pascal formatted disk. |
boolean |
isProdosFormat()
Test the disk format to see if this is a ProDOS formatted disk. |
boolean |
isProdosOrder()
Indicate if this disk is ProDOS ordered (beginning with block 0). |
boolean |
isRdosFormat()
Test the disk format to see if this is a RDOS formatted disk. |
boolean |
isUniDosFormat()
Test the disk format to see if this is a UniDOS formatted disk. |
byte[] |
readBlock(int block)
Read the block from the disk image. |
byte[] |
readSector(int track,
int sector)
Retrieve the specified sector. |
protected void |
resizeDiskImage(int newSize)
Resize a disk image up to a larger size. |
void |
save()
Save a Disk image to its file. |
void |
saveAs(java.lang.String filename)
Save a Disk image as a new/different file. |
void |
setFilename(java.lang.String filename)
Sets the filename. |
protected void |
setImageOrder(ImageOrder imageOrder)
Set the physical ordering of the disk. |
void |
writeBlock(int block,
byte[] data)
Write the block to the disk image. |
void |
writeSector(int track,
int sector,
byte[] bytes)
Write the specified sector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BLOCK_SIZE
public static final int SECTOR_SIZE
public static final int PRODOS_BLOCKS_ON_140KB_DISK
public static final int DOS33_SECTORS_ON_140KB_DISK
public static final int APPLE_140KB_DISK
public static final int APPLE_140KB_NIBBLE_DISK
public static final int APPLE_800KB_DISK
public static final int APPLE_800KB_2IMG_DISK
public static final int APPLE_5MB_HARDDISK
public static final int APPLE_10MB_HARDDISK
public static final int APPLE_20MB_HARDDISK
public static final int APPLE_32MB_HARDDISK
Constructor Detail |
---|
protected Disk(java.lang.String filename, ImageOrder imageOrder)
public Disk(java.lang.String filename) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public static Disk.FilenameFilter[] getFilenameFilters()
public void save() throws java.io.IOException
java.io.IOException
public void saveAs(java.lang.String filename) throws java.io.IOException
java.io.IOException
public FormattedDisk[] getFormattedDisks()
public ByteArrayImageLayout getDiskImageManager()
public java.lang.String getFilename()
public void setFilename(java.lang.String filename)
public boolean isCompressed()
public boolean isProdosOrder()
public boolean isDosOrder()
public boolean is2ImgOrder()
public boolean isNibbleOrder()
public int getPhysicalSize()
protected void resizeDiskImage(int newSize)
newSize
- public byte[] readBlock(int block)
public void writeBlock(int block, byte[] data)
public byte[] readSector(int track, int sector) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void writeSector(int track, int sector, byte[] bytes) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean isProdosFormat()
public boolean isDosFormat()
public boolean isUniDosFormat()
public boolean isOzDosFormat()
public boolean isPascalFormat()
public boolean isCpmFormat()
protected boolean is140KbDisk()
protected boolean is800KbDisk()
public boolean isRdosFormat()
public boolean hasChanged()
public boolean isNewImage()
public ImageOrder getImageOrder()
protected void setImageOrder(ImageOrder imageOrder)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |