avrora.sim.platform
Class DefaultPlatform.Factory
java.lang.Object
avrora.sim.platform.DefaultPlatform.Factory
- All Implemented Interfaces:
- PlatformFactory
- Enclosing class:
- DefaultPlatform
- public static class DefaultPlatform.Factory
- extends java.lang.Object
- implements PlatformFactory
The DefaultPlatform.Factory
class implements a factory for a default platform. The
speed of the main clock, the speed of the external clock (called "external"), and the microcontroller
factory are specified. This class will implement the newPlatform()
method which is used
to instantiate a new platform instance.
Constructor Summary |
DefaultPlatform.Factory(long mc,
long ext,
MicrocontrollerFactory mcf)
The constructor for the DefaultPlatform.Factory class accepts three parameters: the
speed of the main clock, the speed of the external clock, and the microcontroller factory for
this platform |
Method Summary |
Platform |
newPlatform(int id,
InterpreterFactory f,
Program p)
The newPlatform() method creates a new instance of the platform with the specified
ID number, using the interpreter created by the given interpreter factory, containing the specified
progarm. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mcf
public final MicrocontrollerFactory mcf
mainClockSpeed
public final long mainClockSpeed
extClockSpeed
public final long extClockSpeed
DefaultPlatform.Factory
public DefaultPlatform.Factory(long mc,
long ext,
MicrocontrollerFactory mcf)
- The constructor for the
DefaultPlatform.Factory
class accepts three parameters: the
speed of the main clock, the speed of the external clock, and the microcontroller factory for
this platform
- Parameters:
mc
- the speed of the microcontroller's main clock in hzext
- the speed of the external clock (usually an input to the MCU) in hzmcf
- the microcontroller factory capable of creating a new microcontroller
newPlatform
public Platform newPlatform(int id,
InterpreterFactory f,
Program p)
- The
newPlatform()
method creates a new instance of the platform with the specified
ID number, using the interpreter created by the given interpreter factory, containing the specified
progarm.
- Specified by:
newPlatform
in interface PlatformFactory
- Parameters:
id
- the ID number of the platform to createf
- the interpreter factory capable of creating a new interpreter for this platformp
- the program to load into the platform
- Returns:
- a new instance of the
Platform
interface for this platform