com.webcodepro.applecommander.storage.os.nakedos
Class NakedosFileEntry

java.lang.Object
  extended by com.webcodepro.applecommander.storage.os.nakedos.NakedosFileEntry
All Implemented Interfaces:
FileEntry

public class NakedosFileEntry
extends java.lang.Object
implements FileEntry

Represents a Nakedos file entry on disk.

Date created: August 5, 2010 10:23:23 AM

Author:
David Schmidt

Constructor Summary
NakedosFileEntry(NakedosFormatDisk disk, int fileNumber, int size)
          Constructor for NakedosFileEntry.
 
Method Summary
 boolean canCompile()
          Indicates that this filetype can be compiled.
 void delete()
          Delete this file (unimplemented).
 boolean equals(java.lang.Object o)
           
 java.util.List getFileColumnData(int displayMode)
          Get the standard file column header information.
 byte[] getFileData()
          Get file data.
 java.lang.String getFilename()
          Return the name of this file.
 int getFileNumber()
          Return the name of this file.
 java.lang.String getFiletype()
          Return the filetype of this file.
 FormattedDisk getFormattedDisk()
          Get the FormattedDisk associated with this FileEntry.
 int getMaximumFilenameLength()
          Return the maximum filename length.
 int getSize()
          Compute the size of this file (in bytes).
 FileFilter getSuggestedFilter()
          Get the suggested FileFilter.
 boolean isDeleted()
          Identify if this file has been deleted.
 boolean isDirectory()
          Identify if this is a directory file.
 boolean isLocked()
          Identify if this file is locked.
 boolean needsAddress()
          Indicates if this filetype requires an address component.
 void setAddress(int address)
          Set the address that this file loads at.
 void setFileData(byte[] data)
          Set the file data.
 void setFilename(java.lang.String filename)
          Set the name of this file.
 void setFiletype(java.lang.String filetype)
          Set the filetype (typeless - unused)
 void setLocked(boolean lock)
          Set the lock indicator (unused)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NakedosFileEntry

public NakedosFileEntry(NakedosFormatDisk disk,
                        int fileNumber,
                        int size)
Constructor for NakedosFileEntry.

Method Detail

getFilename

public java.lang.String getFilename()
Return the name of this file.

Specified by:
getFilename in interface FileEntry
See Also:
FileEntry.getFilename()

getFileNumber

public int getFileNumber()
Return the name of this file.

See Also:
FileEntry.getFilename()

setFilename

public void setFilename(java.lang.String filename)
Set the name of this file.

Specified by:
setFilename in interface FileEntry

getFiletype

public java.lang.String getFiletype()
Return the filetype of this file.

Specified by:
getFiletype in interface FileEntry
See Also:
FileEntry.getFiletype()

setFiletype

public void setFiletype(java.lang.String filetype)
Set the filetype (typeless - unused)

Specified by:
setFiletype in interface FileEntry

isLocked

public boolean isLocked()
Identify if this file is locked.

Specified by:
isLocked in interface FileEntry
See Also:
FileEntry.isLocked()

setLocked

public void setLocked(boolean lock)
Set the lock indicator (unused)

Specified by:
setLocked in interface FileEntry

getSize

public int getSize()
Compute the size of this file (in bytes).

Specified by:
getSize in interface FileEntry
See Also:
FileEntry.getSize()

isDirectory

public boolean isDirectory()
Identify if this is a directory file.

Specified by:
isDirectory in interface FileEntry
See Also:
FileEntry.isDirectory()

isDeleted

public boolean isDeleted()
Identify if this file has been deleted.

Specified by:
isDeleted in interface FileEntry
See Also:
FileEntry.isDeleted()

delete

public void delete()
Delete this file (unimplemented).

Specified by:
delete in interface FileEntry

getFileColumnData

public java.util.List getFileColumnData(int displayMode)
Get the standard file column header information. This default implementation is intended only for standard mode. displayMode is specified in FormattedDisk.

Specified by:
getFileColumnData in interface FileEntry

getFileData

public byte[] getFileData()
Get file data. This handles any operating-system specific issues.

Specified by:
getFileData in interface FileEntry

setFileData

public void setFileData(byte[] data)
                 throws DiskFullException
Set the file data. Note: The address can be set before the data is saved or after the data is saved. This is an attempt to make the API more easily usable. Empirically, the data must be set before the address is set.

Specified by:
setFileData in interface FileEntry
Throws:
DiskFullException

getSuggestedFilter

public FileFilter getSuggestedFilter()
Get the suggested FileFilter. This appears to be operating system specific, so each operating system needs to implement some manner of guessing the appropriate filter. FIXME - this code should be a helper class for DOS and RDOS!

Specified by:
getSuggestedFilter in interface FileEntry

getFormattedDisk

public FormattedDisk getFormattedDisk()
Get the FormattedDisk associated with this FileEntry. This is useful to interfaces that need to retrieve the associated disk.

Specified by:
getFormattedDisk in interface FileEntry

getMaximumFilenameLength

public int getMaximumFilenameLength()
Return the maximum filename length.

Specified by:
getMaximumFilenameLength in interface FileEntry

needsAddress

public boolean needsAddress()
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.

Specified by:
needsAddress in interface FileEntry

setAddress

public void setAddress(int address)
Set the address that this file loads at.

Specified by:
setAddress in interface FileEntry

canCompile

public boolean canCompile()
Indicates that this filetype can be compiled.

Specified by:
canCompile in interface FileEntry

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object