An abstract class defining the basic functionality of the electronic devices,
such as getting the states of the IO ports
numberOfPorts:Number [read-only]
Get the number of IO ports in the device.
NOTE: the number of ports cannot be modified once the device is created
Implementation
public function get numberOfPorts():Number
protected var _ports:Array
public function AbstractElectronicDevice(numberOfPorts:Number, portDirection:Number)
Creates an electronic device with a certain number of IO ports.
The directionality of the ports may be changed later.
NOTE: an abstract class cannot be instantialized, used the subclasses
Parameters
| numberOfPorts:Number |
| |
| portDirection:Number |
public function getPort(portNumber:Number):IOPort
Get a certain IO port by its number
Parameters
Returns
Throws
| — an Error when the port number is out of the range
|