ccs.cpc.impl
Class ResultsVDevice

java.lang.Object
  extended by ccs.cpc.VDevice
      extended by ccs.cpc.impl.ResultsVDevice
All Implemented Interfaces:
ccs.utils.Hurlable

 class ResultsVDevice
extends VDevice


Constructor Summary
ResultsVDevice(CpCmdr cpc, java.lang.String name, VDeviceLister vdl)
           
 
Method Summary
 java.lang.String getName()
          returns the device identifier, for listing purposes.
 VFile getRoot()
          returns root directory
 java.lang.String getSeparator()
          returns the path element separator.
 char getSeparatorChar()
          the separator, as a char.
 java.lang.String getShortName()
          returns the device identifier, for changing directory.
 int getStoredPwdPrefixLength()
          The length of prefix to remove from a stored pwd (to implement "stateful devices" whereby when you return to a device after leaving it abruptly, you get straight back to the same place) to obtain a path relative to the device root which can then be walked.
 VDeviceLister getVDL()
          returns the object which lists all devices currently available.
 boolean isNoCopy()
          returns whether copy-protection is enforced on this device.
 boolean isReal()
          Whether this device actually provides storage space for its contents.
 boolean isSort()
          Whether this device should be sorted automatically: some devices sort / order their own contents instead, and don't want the standard sort.
protected  void marshalIDSlug(java.io.DataOutputStream dos)
          Every device requires a unique ID.
 void notifyLoaded()
           
 void notifyModified()
           
(package private)  void setRoot(ResultsVFile root)
           
 void umount()
          closes the VDevice (to let it be removed from the list).
 
Methods inherited from class ccs.cpc.VDevice
getCPAIffArchive, getCPC, getID, getTitlePrefix, hurl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultsVDevice

ResultsVDevice(CpCmdr cpc,
               java.lang.String name,
               VDeviceLister vdl)
Method Detail

setRoot

void setRoot(ResultsVFile root)

getSeparator

public java.lang.String getSeparator()
Description copied from class: VDevice
returns the path element separator.

Specified by:
getSeparator in class VDevice

getSeparatorChar

public char getSeparatorChar()
Description copied from class: VDevice
the separator, as a char.

Specified by:
getSeparatorChar in class VDevice

getRoot

public VFile getRoot()
Description copied from class: VDevice
returns root directory

Specified by:
getRoot in class VDevice

getName

public java.lang.String getName()
Description copied from class: VDevice
returns the device identifier, for listing purposes.

Specified by:
getName in class VDevice

getShortName

public java.lang.String getShortName()
Description copied from class: VDevice
returns the device identifier, for changing directory. This is whatever punter would have to type to get to the root directory of the device. Thus we can get to device root somehow (which is usually easy), cull the short name, and carry on in a simple fashion. Other definitions get all hot and bothered about drive letters in DOS vs / for root FS in unix etc.

Specified by:
getShortName in class VDevice

getStoredPwdPrefixLength

public int getStoredPwdPrefixLength()
Description copied from class: VDevice
The length of prefix to remove from a stored pwd (to implement "stateful devices" whereby when you return to a device after leaving it abruptly, you get straight back to the same place) to obtain a path relative to the device root which can then be walked.

Specified by:
getStoredPwdPrefixLength in class VDevice

getVDL

public VDeviceLister getVDL()
Description copied from class: VDevice
returns the object which lists all devices currently available.

Specified by:
getVDL in class VDevice

umount

public void umount()
Description copied from class: VDevice
closes the VDevice (to let it be removed from the list). the "n" from this unmount has gone missing. If you find it, please return it.

Specified by:
umount in class VDevice

isNoCopy

public boolean isNoCopy()
Description copied from class: VDevice
returns whether copy-protection is enforced on this device.

Overrides:
isNoCopy in class VDevice

isReal

public boolean isReal()
Description copied from class: VDevice
Whether this device actually provides storage space for its contents. ResultsVDevices don't, all others do. (ATM).

Overrides:
isReal in class VDevice

notifyLoaded

public void notifyLoaded()

notifyModified

public void notifyModified()

isSort

public boolean isSort()
Description copied from class: VDevice
Whether this device should be sorted automatically: some devices sort / order their own contents instead, and don't want the standard sort. Currently only ResultVDevices do this.

Overrides:
isSort in class VDevice

marshalIDSlug

protected void marshalIDSlug(java.io.DataOutputStream dos)
                      throws java.io.IOException
Description copied from class: VDevice
Every device requires a unique ID. For everything except result sets, this must also be persistent. This method must marshal suitable information to create such an ID. Start with a fixed char which specifies the device type: 'd' for disks, 'a' for archives (and CPC+ registered archives), 'z' for jars / zips, 'r' for result sets. Then add enough information to identify the device uniquely within its namespace.

Specified by:
marshalIDSlug in class VDevice
Parameters:
dos - The stream to marshal this lot onto. You should only send as much as you need to identify the device - say, a few hundred bytes, tops.
Throws:
java.io.IOException - if the stream blows up - this shouldn't happen.