avrora.sim.platform
Class DefaultPlatform.Factory

java.lang.Object
  extended byavrora.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.


Field Summary
 long extClockSpeed
           
 long mainClockSpeed
           
 MicrocontrollerFactory mcf
           
 
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
 

Field Detail

mcf

public final MicrocontrollerFactory mcf

mainClockSpeed

public final long mainClockSpeed

extClockSpeed

public final long extClockSpeed
Constructor Detail

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 hz
ext - the speed of the external clock (usually an input to the MCU) in hz
mcf - the microcontroller factory capable of creating a new microcontroller
Method Detail

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 create
f - the interpreter factory capable of creating a new interpreter for this platform
p - the program to load into the platform
Returns:
a new instance of the Platform interface for this platform