Added needsAddress and setAddress.

This commit is contained in:
Robert Greene 2003-02-11 04:34:28 +00:00
parent d5089727f9
commit ecf6f16a83
4 changed files with 65 additions and 9 deletions

View File

@ -430,4 +430,21 @@ public class DosFileEntry implements FileEntry {
public FormattedDisk getFormattedDisk() {
return disk;
}
/**
* Indicates if this filetype requires an address component.
* Note that the FormattedDisk also has this method - normally,
* this will defer to the method on FormattedDisk, as it will be
* more generic.
*/
public boolean needsAddress() {
return disk.needsAddress(getFiletype());
}
/**
* Set the address that this file loads at.
*/
public void setAddress(int address) {
// FIXME - need to implement
}
}

View File

@ -126,4 +126,17 @@ public interface FileEntry {
* Return the maximum filename length.
*/
public int getMaximumFilenameLength();
/**
* Indicates if this filetype requires an address component.
* Note that the FormattedDisk also has this method - normally,
* this will defer to the method on FormattedDisk, as it will be
* more generic.
*/
public abstract boolean needsAddress();
/**
* Set the address that this file loads at.
*/
public abstract void setAddress(int address);
}

View File

@ -83,15 +83,7 @@ public class PascalFileEntry implements FileEntry {
* Return the filetype of this file.
*/
public String getFiletype() {
String filetypes[] = {
"xdskfile (for bad blocks)",
"codefile",
"textfile",
"infofile",
"datafile",
"graffile",
"fotofile",
"securedir" };
String[] filetypes = disk.getFiletypes();
int filetype = fileEntry[4] & 0x0f;
if (filetype == 0 || filetype > filetypes.length) {
return "unknown (" + filetype + ")";
@ -257,4 +249,21 @@ public class PascalFileEntry implements FileEntry {
public FormattedDisk getFormattedDisk() {
return disk;
}
/**
* Indicates if this filetype requires an address component.
* Note that the FormattedDisk also has this method - normally,
* this will defer to the method on FormattedDisk, as it will be
* more generic.
*/
public boolean needsAddress() {
return false;
}
/**
* Set the address that this file loads at.
*/
public void setAddress(int address) {
// Does not apply.
}
}

View File

@ -288,4 +288,21 @@ public class RdosFileEntry implements FileEntry {
public FormattedDisk getFormattedDisk() {
return disk;
}
/**
* Indicates if this filetype requires an address component.
* Note that the FormattedDisk also has this method - normally,
* this will defer to the method on FormattedDisk, as it will be
* more generic.
*/
public boolean needsAddress() {
return disk.needsAddress(getFiletype());
}
/**
* Set the address that this file loads at.
*/
public void setAddress(int address) {
// FIXME - need to implement
}
}