|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.sim.util.PeriodicTrigger
The PeriodicTrigger class is a utility that allows a Trigger
to be inserted into the simulator that will fire with a specified period of clock
cycles. It works by automatically adding itself back into the timer queue at each
firing.
Simulator.Trigger| Field Summary | |
long |
period
This field stores the period (in clock cycles) that the trigger will be fired. |
Simulator |
simulator
This field stores the simulator in which the trigger will continually be reinserted. |
Simulator.Trigger |
trigger
This field stores the trigger that will be fired after each period. |
| Constructor Summary | |
PeriodicTrigger(Simulator s,
Simulator.Trigger t,
long p)
The constructor for the PeriodicTrigger class creates a
new periodic trigger with the specified period. |
|
| Method Summary | |
void |
fire()
The fire() method is called by the simulator when the
timer event occurs. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final Simulator simulator
public final Simulator.Trigger trigger
public final long period
| Constructor Detail |
public PeriodicTrigger(Simulator s,
Simulator.Trigger t,
long p)
PeriodicTrigger class creates a
new periodic trigger with the specified period. Each time the trigger
fires, it will be added again back into the simulator's timer event
queue with the same delta. The result is the specified trigger fires
with the precise period specified.
Creating the PeriodicTrigger does not insert it into
the simulator. It is important that these instances of
Simulator match--this probe will always reinsert itself
into the instance passed in the constructor.
s - the simulator in which to reinsert the trigger each timet - the trigger to fire after each periodp - the period in clock cycles| Method Detail |
public void fire()
fire() method is called by the simulator when the
timer event occurs. In this implementation, the periodic trigger is
reinserted into the timer queue, and then the fire()
method of the trigger is called.
fire in interface Simulator.Trigger
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||