avrora.sim.platform
Class Platform

java.lang.Object
  extended byavrora.sim.platform.Platform
Direct Known Subclasses:
DefaultPlatform, Mica2, Seres

public abstract class Platform
extends java.lang.Object

The Platform interface represents both a microcontroller instance and the devices connected to it. These two things together describe a node and its capabilities.


Field Summary
protected  java.util.HashMap devices
           
protected  Microcontroller mcu
           
 
Constructor Summary
protected Platform(Microcontroller m)
           
 
Method Summary
protected  void addDevice(java.lang.String name, java.lang.Object o)
          The addDevice() method is used by subclasses of Platform to add external devices that are connected to the microcontroller.
 java.lang.Object getDevice(java.lang.String name)
          The getDevice() method looks up a device attached to this platform.
 Microcontroller getMicrocontroller()
          The getMicrocontroller() method returns a reference to the microcontroller that is driving this platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mcu

protected final Microcontroller mcu

devices

protected final java.util.HashMap devices
Constructor Detail

Platform

protected Platform(Microcontroller m)
Method Detail

getMicrocontroller

public Microcontroller getMicrocontroller()
The getMicrocontroller() method returns a reference to the microcontroller that is driving this platform.

Returns:
a reference to the microcontroller in this platform

addDevice

protected void addDevice(java.lang.String name,
                         java.lang.Object o)
The addDevice() method is used by subclasses of Platform to add external devices that are connected to the microcontroller.

Parameters:
name - the name of the device as a string
o - the object representing the device

getDevice

public java.lang.Object getDevice(java.lang.String name)
The getDevice() method looks up a device attached to this platform. This device might be a radio, a sensor, etc.

Parameters:
name - the name of the device as a string
Returns:
an object representing the device if it exists; null otherwise