jmce.sim.serial
Class SerialFile
java.lang.Object
jmce.sim.AbstractHardware
jmce.sim.AbstractPeripheral
jmce.sim.Device<java.lang.Integer>
jmce.sim.Serial
jmce.sim.serial.SerialFile
- All Implemented Interfaces:
- Console, DeviceConsumer<java.lang.Integer>, Hardware, Peripheral
public class SerialFile
- extends Serial
- implements DeviceConsumer<java.lang.Integer>
Serial interface to file.
This class implements a serial interface without input and with the
output to a file.
- Version:
- 1.00
- Author:
- Mario Viara
Method Summary |
void |
consume(java.lang.Integer c)
|
java.lang.String |
getFileName()
Return the name of the file used as output |
void |
init(Hardware parent)
Initialize the hardware. |
void |
setFileName(java.lang.String s)
Set the name of the file used as output |
java.lang.String |
toString()
|
Methods inherited from class jmce.sim.Device |
addInputConsumer, addInputProducer, addOutputConsumer, addOutputProducer, getConnected, read, readOutput, readyRead, readyReadOutput, readyWrite, removeInputConsumer, removeOutputConsumer, setConnected, write, writeInput |
Methods inherited from class jmce.sim.AbstractHardware |
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmce.sim.Hardware |
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
SerialFile
public SerialFile()
SerialFile
public SerialFile(java.lang.String name)
init
public void init(Hardware parent)
throws SIMException
- Description copied from interface:
Hardware
- Initialize the hardware. This method must be called before
any use of the interface. Only set ... / get ... method are
allowed to be called before the intialization.
- Specified by:
init
in interface Hardware
- Overrides:
init
in class AbstractHardware
- Parameters:
parent
- Parent of this hardware.
- Throws:
SIMException
consume
public void consume(java.lang.Integer c)
throws SIMException
- Specified by:
consume
in interface DeviceConsumer<java.lang.Integer>
- Throws:
SIMException
setFileName
public void setFileName(java.lang.String s)
- Set the name of the file used as output
getFileName
public java.lang.String getFileName()
- Return the name of the file used as output
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractHardware