|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.DefaultClockControl
public class DefaultClockControl
Class providing default logic of the ClockControl interface. Hardware systems that have fast clocks should "extend DefaultClockControl" and override the appropriate methods. This class provides default implementations of ClockControl methods that are not needed in the hardware implementation if one exists, or for those systems with no hardware fast clock.
| Constructor Summary | |
|---|---|
DefaultClockControl()
|
|
| Method Summary | |
|---|---|
boolean |
canCorrectHardwareClock()
Returns true if hardware clock accuracy can be corrected using the computer clock. |
boolean |
canSet12Or24HourClock()
Returns true if hardware clock can be set to 12 or 24 hour display from JMRI software. |
String |
getHardwareClockName()
Get name of hardware clock Note: If there is no hardware clock, this method returns null. |
double |
getRate()
|
int |
getStatus()
Get Status of the Fast Clock |
Date |
getTime()
|
void |
initializeHardwareClock(double rate,
Date now,
boolean getTime)
Initialize the hardware fast clock Note: When the hardware clock control receives this, it should initialize those clock settings that are available on the hardware clock. |
boolean |
requiresIntegerRate()
Returns true if hardware clock requires an integer rate Note: Default implementation returns false. |
void |
setRate(double newRate)
Get and set the rate of the fast clock Note: The rate is an integer that multiplies the wall clock For example, a rate of 4 specifies that the fast clock runs 4 times faster than the wall clock. |
void |
setTime(Date now)
Set and get the fast clock time For the default implementation,set time is ignored and getTime returns the time of the internal clock; |
void |
startHardwareClock(Date now)
Start and stop hardware fast clock Many hardware fast clocks continue to run indefinitely. |
void |
stopHardwareClock()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultClockControl()
| Method Detail |
|---|
public int getStatus()
getStatus in interface ClockControlpublic String getHardwareClockName()
getHardwareClockName in interface ClockControlpublic boolean canCorrectHardwareClock()
canCorrectHardwareClock in interface ClockControlpublic boolean canSet12Or24HourClock()
canSet12Or24HourClock in interface ClockControlpublic boolean requiresIntegerRate()
requiresIntegerRate in interface ClockControlpublic void setRate(double newRate)
setRate in interface ClockControlpublic double getRate()
getRate in interface ClockControlpublic void setTime(Date now)
setTime in interface ClockControlpublic Date getTime()
getTime in interface ClockControlpublic void startHardwareClock(Date now)
startHardwareClock in interface ClockControlpublic void stopHardwareClock()
stopHardwareClock in interface ClockControl
public void initializeHardwareClock(double rate,
Date now,
boolean getTime)
initializeHardwareClock in interface ClockControl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||