|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.clock.ClockDomain
The ClockDomain
class represents a collection of clocks for a device or platform,
including the main clock used for the microcontroller.
Field Summary | |
protected java.util.HashMap |
clockMap
|
protected MainClock |
mainClock
|
Constructor Summary | |
ClockDomain(long mainHz)
The constructor for the ClockDomain class constructs the main clock (from which
all other clocks are derived). |
Method Summary | |
void |
addClock(Clock c)
The addClock() method adds a clock to this clock domain. |
Clock |
getClock(java.lang.String name)
The getClock() method looks for a clock with the specified name in this clock
domain. |
MainClock |
getMainClock()
The getMainClock() method returns the main clock for this clock domain. |
boolean |
hasClock(java.lang.String name)
The hasClock() method queries the clock domain whether it contains a particular
named clock. |
Clock |
newClock(java.lang.String name,
long hz)
The newClock() method creates a new clock derived from the main clock of
this clock domain with the given name and clockspeed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.util.HashMap clockMap
protected final MainClock mainClock
Constructor Detail |
public ClockDomain(long mainHz)
ClockDomain
class constructs the main clock (from which
all other clocks are derived). It accepts as a parameter the speed of the main clock.
mainHz
- the speed of the main clock in cycles per secondMethod Detail |
public MainClock getMainClock()
getMainClock()
method returns the main clock for this clock domain.
MainClock
class that contains the main clock for
this clock domain.public Clock getClock(java.lang.String name)
getClock()
method looks for a clock with the specified name in this clock
domain.
name
- the name of the clock as a string
Clock
interface for the specified clock name
java.util.NoSuchElementException
- if no clock with the specified name exists in this domainpublic void addClock(Clock c)
addClock()
method adds a clock to this clock domain. It will be indexed
by the name returned by the clock's getName()
method. If there is a clock
already in this domain with the name specified, the new clock will be returned for subsequent
calls to getClock()
, and the old clock will no longer be accessible.
c
- the clock to add to this domainpublic Clock newClock(java.lang.String name, long hz)
newClock()
method creates a new clock derived from the main clock of
this clock domain with the given name and clockspeed. The clock will automatically be
added to this clock domain with the specified name.
name
- the name of the new clockhz
- the clockspeed of the new clock in cycles per second
Clock
instance with the specified propertiespublic boolean hasClock(java.lang.String name)
hasClock()
method queries the clock domain whether it contains a particular
named clock.
name
- the name of the clock to check for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |