jmce - 1_02

jmce.sim.disk
Class NullDisk

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.disk.AbstractDisk
              extended by jmce.sim.disk.NullDisk
All Implemented Interfaces:
Disk, Hardware, Peripheral

public class NullDisk
extends AbstractDisk

Null disk implementation.

Can have any size but always return error on any operation as read,write and mount.

Version:
1.00
Author:
Mario Viara

Field Summary
 
Fields inherited from class jmce.sim.disk.AbstractDisk
buffer, head, mounted, numHead, numSector, numTrack, readOnly, sector, sectorSize, track
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Fields inherited from interface jmce.sim.Disk
ERROR, ERROR_SEEK, ERROR_WRITE_PROTECT
 
Constructor Summary
NullDisk()
           
 
Method Summary
 void dismount()
          Dismount the disk
 boolean mount()
          Mount the disk.
 int read(int pos)
          Read one sector.
 int write(int pos)
          Write one sector.
 
Methods inherited from class jmce.sim.disk.AbstractDisk
format, getBuffer, getDiskSize, getDiskSizeString, getHead, getNumHead, getNumSector, getNumTrack, getReadOnly, getSector, getSectorSize, getTrack, isMounted, read, read, setHead, setMounted, setNumHead, setNumSector, setNumTrack, setReadOnly, setSector, setSectorSize, setTrack, write, write
 
Methods inherited from class jmce.sim.AbstractPeripheral
idle, registerCPU, setIdle, setLive
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Peripheral
idle, registerCPU
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 

Constructor Detail

NullDisk

public NullDisk()
Method Detail

dismount

public void dismount()
              throws SIMException
Description copied from interface: Disk
Dismount the disk

Specified by:
dismount in interface Disk
Overrides:
dismount in class AbstractDisk
Throws:
SIMException

mount

public boolean mount()
              throws SIMException
Description copied from interface: Disk
Mount the disk.

Specified by:
mount in interface Disk
Overrides:
mount in class AbstractDisk
Returns:
true if the disk is correctly mounted.
Throws:
SIMException

read

public int read(int pos)
Description copied from class: AbstractDisk
Read one sector. Read one sector at specified position. Must be implemented by subclass.

Specified by:
read in class AbstractDisk
Returns:
the number of bytes readed.

write

public int write(int pos)
Description copied from class: AbstractDisk
Write one sector. Write one sector at specified position. Must be implemented by subclass.

Specified by:
write in class AbstractDisk
Returns:
the number of bytes written.

jmce - 1_02