Added canCompile metod to all FileEntry objects.

This commit is contained in:
Robert Greene 2003-12-04 06:00:26 +00:00
parent 0cb572b961
commit 991b574427
5 changed files with 42 additions and 2 deletions

View File

@ -449,4 +449,11 @@ public class DosFileEntry implements FileEntry {
public void setAddress(int address) {
// FIXME - need to implement
}
/**
* Indicates that this filetype can be compiled.
*/
public boolean canCompile() {
return isApplesoftBasicFile();
}
}

View File

@ -130,4 +130,14 @@ public interface FileEntry {
* Set the address that this file loads at.
*/
public abstract void setAddress(int address);
/**
* Indicates that this filetype can be compiled.
* Compile is a somewhat arbitrary term, as the code may be
* assembled.
* NOTE: The current assumption is that the filetype is
* AppleSoft. This should be updated to include Integer BASIC,
* assembly, and potentially other languages.
*/
public abstract boolean canCompile();
}

View File

@ -268,4 +268,11 @@ public class PascalFileEntry implements FileEntry {
public void setAddress(int address) {
// Does not apply.
}
/**
* Indicates that this filetype can be compiled.
*/
public boolean canCompile() {
return false;
}
}

View File

@ -1,6 +1,6 @@
/*
* AppleCommander - An Apple ][ image utility.
* Copyright (C) 2002 by Robert Greene
* Copyright (C) 2002-3 by Robert Greene
* robgreene at users.sourceforge.net
*
* This program is free software; you can redistribute it and/or modify it
@ -486,4 +486,11 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry {
setAuxiliaryType(fileEntry, address);
writeFileEntry(fileEntry);
}
/**
* Indicates that this filetype can be compiled.
*/
public boolean canCompile() {
return getDisk().canCompile(getFiletype());
}
}

View File

@ -1,6 +1,6 @@
/*
* AppleCommander - An Apple ][ image utility.
* Copyright (C) 2002 by Robert Greene
* Copyright (C) 2002-3 by Robert Greene
* robgreene at users.sourceforge.net
*
* This program is free software; you can redistribute it and/or modify it
@ -307,4 +307,13 @@ public class RdosFileEntry implements FileEntry {
public void setAddress(int address) {
// FIXME - need to implement
}
/**
* Indicates that this filetype can be compiled.
* WARNING: RDOS programs most likely will not have the
* DOS routines handled by the compiler.
*/
public boolean canCompile() {
return isApplesoftBasicFile();
}
}