com.sentilla.system
Class DriverAdapter

java.lang.Object
  extended by com.sentilla.system.DriverAdapter
All Implemented Interfaces:
Driver
Direct Known Subclasses:
ButtonDriver, ByteReceiverDriver, ByteSenderDriver, CpuDriver, DigitalPinDriver, Dispatcher, FileDriver, InterruptPinDriver, LedsDriver, Mimeo, MoteSecurityDriver, PowerManagerDriver, PropertyDriver, Protocol, ReceiverDriver, RemotePropertyDriver, SenderDriver, SensorDriver

public abstract class DriverAdapter
extends Object
implements Driver

The base class that new drivers may extend. By extending this class, new drivers can be registered with the Drivers system.

See Also:
Drivers

Field Summary
protected  Driver m_nextDriver
          A reference to the next driver in the list of drivers.
 
Constructor Summary
DriverAdapter()
           
 
Method Summary
abstract  String getDriverName(int n)
          Returns the valid name(s) for each driver.
 Driver getNextDriver()
          Get the next driver in the list of registered drivers.
 void setNextDriver(Driver driver)
          Sets the next driver in the list of registered drivers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_nextDriver

protected Driver m_nextDriver
A reference to the next driver in the list of drivers.

Constructor Detail

DriverAdapter

public DriverAdapter()
Method Detail

setNextDriver

public void setNextDriver(Driver driver)
Sets the next driver in the list of registered drivers. Typically only used by the Drivers registry.

Specified by:
setNextDriver in interface Driver
Parameters:
driver - A reference to the next driver in the list of registered drivers
See Also:
Drivers

getNextDriver

public Driver getNextDriver()
Get the next driver in the list of registered drivers. Typically only used by the Drivers registry.

Specified by:
getNextDriver in interface Driver
Returns:
An instance of the next driver, or null if the end of the list is reached
See Also:
Drivers

getDriverName

public abstract String getDriverName(int n)
Returns the valid name(s) for each driver. If a driver has N-names, then getDriverName returns a string for n=0 to n=N-1, and returns null for all other values of n.

A driver may return multiple names because it provides the default implementation for a specific name, such as associating "flash" by default to the external flash, or "extflash" if an application specifically asserts it requires the external flash resources. Some drivers may return only a single valid name, such as "intflash" for the internal flash.

Specified by:
getDriverName in interface Driver


Copyright © 2007 Sentilla Corporation. All Rights Reserved.