com.planet_ink.coffee_mud.Common
Class DefaultTimeClock

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultTimeClock
All Implemented Interfaces:
CMCommon, TimeClock, CMObject, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultTimeClock
extends java.lang.Object
implements TimeClock


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.TimeClock
TimeClock.MoonPhase, TimeClock.Season, TimeClock.TidePhase, TimeClock.TimeOfDay, TimeClock.TimePeriod
 
Field Summary
protected  int[] dawnToDusk
           
protected  int day
           
protected  int daysInMonth
           
protected  int hoursInDay
           
protected  long lastTicked
           
protected  boolean loaded
           
protected  java.lang.String loadName
           
protected  int month
           
protected  java.lang.String[] monthsInYear
           
protected  int tickStatus
           
protected  int time
           
protected  java.lang.String[] weekNames
           
protected  int year
           
protected  java.lang.String[] yearNames
           
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
DefaultTimeClock()
           
 
Method Summary
 void bumpDays(int num)
          Increase this clocks time by the given number of days.
 void bumpHours(int num)
          Increase this clocks time by the given number of hours.
 void bumpMonths(int num)
          Increase this clocks time by the given number of months.
 void bumpWeeks(int num)
          Increase this clocks time by the given number of weeks.
 void bumpYears(int num)
          Increase this clocks time by the given number of years.
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 TimeClock deriveClock(long millis)
          Using the current time and date as a yardstick, and assuming constant running and perfect timing, this method will derive a mud date and time from the given real life date/time in milliseconds.
 java.lang.String deriveEllapsedTimeString(long millis)
          Using the given number of milliseconds, this method will return a string describing the number of mud days, hours, etc that is represented by that amount of real time, assuming constant running and perfect timing.
 long deriveMillisAfter(TimeClock C)
          This method will discover the difference in mud hours between this time clock and the given EARLIER clock, assuming they use the same scale of measurement.
 long deriveMudHoursAfter(TimeClock C)
          This method will discover the difference in mud hours between this time clock and the given EARLIER clock, assuming they use the same scale of measurement.
 int[] getDawnToDusk()
          Gets the dawn to dusk values, indexed by the TOD constants.
 int getDayOfMonth()
          Gets the current day of month.
 int getDaysInMonth()
          Gets the days in a month.
 int getDaysInWeek()
          Gets the number of days in each week
 int getHourOfDay()
          Gets the current time of day (the hour).
 int getHoursInDay()
          Gets the hours in a day.
 int getMonth()
          Gets the current month.
 java.lang.String[] getMonthNames()
          Gets the month names, in order, indexed by 0.
 int getMonthsInYear()
          Gets the months in a year.
 TimeClock.MoonPhase getMoonPhase(Room room)
          Gets the moon phase an an enumeration.
 TimeClock.Season getSeasonCode()
          Gets the season code.
 java.lang.String getShortestTimeDescription()
          Gets the shortest time description, showing only the date and time in brief numeric format.
 java.lang.String getShortTimeDescription()
          Gets a shorter time description, showing the date and time in full sentence format, but skipping lunar orientation.
 int getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 TimeClock.TidePhase getTidePhase(Room room)
          Gets the phase of the tides as an enumeration.
 TimeClock.TimeOfDay getTODCode()
          Gets the TOD code, which is the sun-orientation (morning, evening, etc)
 java.lang.String[] getWeekNames()
          Gets the week names, which is the names of the days of each week, a string array indexed by the day of the week - 1.
 int getYear()
          Gets the current year.
 java.lang.String[] getYearNames()
          Gets the names of the year, an arbitrary sized list that is rotated through from year to year.
 void handleTimeChange()
          Causes the world to visibly react to a change in time
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 void initializeINIClock(CMProps page)
          Initialize ini clock by reading calendar values from the given properties page.
 java.lang.String L(java.lang.String str, java.lang.String... xs)
           
 java.lang.String name()
          The nice displayable name of this instance of this object
 CMObject newInstance()
          Returns a new instance of this class.
 void save()
          Saves the current time/date information where ever its supposed to be saved.
 void setDawnToDusk(int dawn, int day, int dusk, int night)
          Sets the dawn to dusk values as absolute hours when that particular time of day begins.
 void setDayOfMonth(int d)
          Sets the current day of month.
 void setDaysInMonth(int d)
          Sets the days in a month.
 void setDaysInWeek(java.lang.String[] days)
          Sets the number of days in each week by naming each of them in a string array
 void setFromHoursSinceEpoc(long num)
          Sets this clock to the given number of hours since epoc.
 boolean setHourOfDay(int t)
          Sets the time of day (the hour).
 void setHoursInDay(int h)
          Sets the hours in a day.
 void setLoadName(java.lang.String name)
          Sets the name of this time object for the purposes of database loading and saving.
 void setMonth(int m)
          Sets the current month.
 void setMonthsInYear(java.lang.String[] months)
          Sets the months in year as a string array of names, arranged in order.
 void setYear(int y)
          Sets the current year.
 void setYearNames(java.lang.String[] years)
          Sets the year names, which is an arbitrary sized list that is rotated through from year to year.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 void tickTock(int howManyHours)
          Alters the time/day by the given number of hours (forward or backward)
protected  void tickTock(int howManyHours, boolean moveTheSky)
           
 java.lang.String timeDescription(MOB mob, Room room)
          Returns a complete description of the date, time, and lunar orientation, and day of the week in a full sentence word format.
 long toHoursSinceEpoc()
          Returns the total hours since epoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tickStatus

protected int tickStatus

loaded

protected boolean loaded

loadName

protected java.lang.String loadName

lastTicked

protected volatile long lastTicked

year

protected int year

month

protected int month

day

protected int day

time

protected int time

hoursInDay

protected int hoursInDay

monthsInYear

protected java.lang.String[] monthsInYear

daysInMonth

protected int daysInMonth

dawnToDusk

protected int[] dawnToDusk

weekNames

protected java.lang.String[] weekNames

yearNames

protected java.lang.String[] yearNames
Constructor Detail

DefaultTimeClock

public DefaultTimeClock()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: Tickable
The nice displayable name of this instance of this object

Specified by:
name in interface CMObject
Specified by:
name in interface Tickable
Returns:
the displayable name of this object instance
See Also:
Environmental.Name()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

getTickStatus

public int getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

setLoadName

public void setLoadName(java.lang.String name)
Description copied from interface: TimeClock
Sets the name of this time object for the purposes of database loading and saving. This is required for the save method to do anything at all.

Specified by:
setLoadName in interface TimeClock
Parameters:
name - the new load name
See Also:
TimeClock.save()

getHoursInDay

public int getHoursInDay()
Description copied from interface: TimeClock
Gets the hours in a day.

Specified by:
getHoursInDay in interface TimeClock
Returns:
the hours in a day
See Also:
TimeClock.setHoursInDay(int)

setHoursInDay

public void setHoursInDay(int h)
Description copied from interface: TimeClock
Sets the hours in a day.

Specified by:
setHoursInDay in interface TimeClock
Parameters:
h - the new hours in a day
See Also:
TimeClock.getHoursInDay()

getDaysInMonth

public int getDaysInMonth()
Description copied from interface: TimeClock
Gets the days in a month.

Specified by:
getDaysInMonth in interface TimeClock
Returns:
the days in a month
See Also:
TimeClock.setDaysInMonth(int)

setDaysInMonth

public void setDaysInMonth(int d)
Description copied from interface: TimeClock
Sets the days in a month.

Specified by:
setDaysInMonth in interface TimeClock
Parameters:
d - the new days in a month
See Also:
TimeClock.getDaysInMonth()

getMonthsInYear

public int getMonthsInYear()
Description copied from interface: TimeClock
Gets the months in a year.

Specified by:
getMonthsInYear in interface TimeClock
Returns:
the months in a year
See Also:
TimeClock.setMonthsInYear(String[]), TimeClock.getMonthNames()

getMonthNames

public java.lang.String[] getMonthNames()
Description copied from interface: TimeClock
Gets the month names, in order, indexed by 0.

Specified by:
getMonthNames in interface TimeClock
Returns:
the month names
See Also:
TimeClock.setMonthsInYear(String[]), TimeClock.getMonthNames()

setMonthsInYear

public void setMonthsInYear(java.lang.String[] months)
Description copied from interface: TimeClock
Sets the months in year as a string array of names, arranged in order.

Specified by:
setMonthsInYear in interface TimeClock
Parameters:
months - the new month names in a year
See Also:
TimeClock.getMonthNames(), TimeClock.getMonthsInYear()

getDawnToDusk

public int[] getDawnToDusk()
Description copied from interface: TimeClock
Gets the dawn to dusk values, indexed by the TOD constants. Each entry is an hour when the TOD starts. The order of the values is DAWN, DAY, DUSK, NIGHT.

Specified by:
getDawnToDusk in interface TimeClock
Returns:
the dawn to dusk array
See Also:
TimeClock.getTODCode(), TimeClock.setDawnToDusk(int, int, int, int), TimeClock.TimeOfDay

getYearNames

public java.lang.String[] getYearNames()
Description copied from interface: TimeClock
Gets the names of the year, an arbitrary sized list that is rotated through from year to year. (think: "year of the donkey", etc..)

Specified by:
getYearNames in interface TimeClock
Returns:
the year names, if any.
See Also:
TimeClock.setYearNames(String[])

setYearNames

public void setYearNames(java.lang.String[] years)
Description copied from interface: TimeClock
Sets the year names, which is an arbitrary sized list that is rotated through from year to year. (think: "year of the donkey", etc..)

Specified by:
setYearNames in interface TimeClock
Parameters:
years - the new years names
See Also:
TimeClock.getYearNames()

setDawnToDusk

public void setDawnToDusk(int dawn,
                          int day,
                          int dusk,
                          int night)
Description copied from interface: TimeClock
Sets the dawn to dusk values as absolute hours when that particular time of day begins.

Specified by:
setDawnToDusk in interface TimeClock
Parameters:
dawn - the dawn hour
day - the day hour
dusk - the dusk hour
night - the night hour
See Also:
TimeClock.getDawnToDusk(), TimeClock.getTODCode(), TimeClock.TimeOfDay

getWeekNames

public java.lang.String[] getWeekNames()
Description copied from interface: TimeClock
Gets the week names, which is the names of the days of each week, a string array indexed by the day of the week - 1.

Specified by:
getWeekNames in interface TimeClock
Returns:
the week names as an array of strings
See Also:
TimeClock.setDaysInWeek(String[]), TimeClock.getDaysInWeek()

getDaysInWeek

public int getDaysInWeek()
Description copied from interface: TimeClock
Gets the number of days in each week

Specified by:
getDaysInWeek in interface TimeClock
Returns:
the days in each week
See Also:
TimeClock.setDaysInWeek(String[]), TimeClock.getWeekNames()

setDaysInWeek

public void setDaysInWeek(java.lang.String[] days)
Description copied from interface: TimeClock
Sets the number of days in each week by naming each of them in a string array

Specified by:
setDaysInWeek in interface TimeClock
Parameters:
days - the new days in each week string array
See Also:
TimeClock.getDaysInWeek(), TimeClock.getWeekNames()

getShortestTimeDescription

public java.lang.String getShortestTimeDescription()
Description copied from interface: TimeClock
Gets the shortest time description, showing only the date and time in brief numeric format.

Specified by:
getShortestTimeDescription in interface TimeClock
Returns:
the shortest time description
See Also:
TimeClock.timeDescription(MOB, Room), TimeClock.getShortTimeDescription()

getShortTimeDescription

public java.lang.String getShortTimeDescription()
Description copied from interface: TimeClock
Gets a shorter time description, showing the date and time in full sentence format, but skipping lunar orientation.

Specified by:
getShortTimeDescription in interface TimeClock
Returns:
the short time description
See Also:
TimeClock.timeDescription(MOB, Room), TimeClock.getShortestTimeDescription()

initializeINIClock

public void initializeINIClock(CMProps page)
Description copied from interface: TimeClock
Initialize ini clock by reading calendar values from the given properties page. Does not load current values from anywhere.

Specified by:
initializeINIClock in interface TimeClock
Parameters:
page - the properties page

L

public java.lang.String L(java.lang.String str,
                          java.lang.String... xs)

timeDescription

public java.lang.String timeDescription(MOB mob,
                                        Room room)
Description copied from interface: TimeClock
Returns a complete description of the date, time, and lunar orientation, and day of the week in a full sentence word format.

Specified by:
timeDescription in interface TimeClock
Parameters:
mob - the mob who wants to know the time
room - the room the room where the mob is wanting the time
Returns:
the string representing the date and time
See Also:
TimeClock.getShortTimeDescription(), TimeClock.getShortestTimeDescription()

getYear

public int getYear()
Description copied from interface: TimeClock
Gets the current year.

Specified by:
getYear in interface TimeClock
Returns:
the current year
See Also:
TimeClock.setYear(int)

setYear

public void setYear(int y)
Description copied from interface: TimeClock
Sets the current year.

Specified by:
setYear in interface TimeClock
Parameters:
y - the new year
See Also:
TimeClock.getYear()

getSeasonCode

public TimeClock.Season getSeasonCode()
Description copied from interface: TimeClock
Gets the season code.

Specified by:
getSeasonCode in interface TimeClock
Returns:
the season code
See Also:
TimeClock.Season

getMonth

public int getMonth()
Description copied from interface: TimeClock
Gets the current month.

Specified by:
getMonth in interface TimeClock
Returns:
the current month
See Also:
TimeClock.setMonth(int)

setMonth

public void setMonth(int m)
Description copied from interface: TimeClock
Sets the current month.

Specified by:
setMonth in interface TimeClock
Parameters:
m - the new month
See Also:
TimeClock.getMonth()

getMoonPhase

public TimeClock.MoonPhase getMoonPhase(Room room)
Description copied from interface: TimeClock
Gets the moon phase an an enumeration.

Specified by:
getMoonPhase in interface TimeClock
Parameters:
room - the room to check the moon phase for
Returns:
the moon phase as an enumeration
See Also:
TimeClock.MoonPhase

getTidePhase

public TimeClock.TidePhase getTidePhase(Room room)
Description copied from interface: TimeClock
Gets the phase of the tides as an enumeration.

Specified by:
getTidePhase in interface TimeClock
Parameters:
room - the room to check the tide phase for
Returns:
the tide phase as an enumeration
See Also:
TimeClock.TidePhase

getDayOfMonth

public int getDayOfMonth()
Description copied from interface: TimeClock
Gets the current day of month.

Specified by:
getDayOfMonth in interface TimeClock
Returns:
the day of month
See Also:
TimeClock.setDayOfMonth(int)

setDayOfMonth

public void setDayOfMonth(int d)
Description copied from interface: TimeClock
Sets the current day of month.

Specified by:
setDayOfMonth in interface TimeClock
Parameters:
d - the new day of month
See Also:
TimeClock.getDayOfMonth()

getHourOfDay

public int getHourOfDay()
Description copied from interface: TimeClock
Gets the current time of day (the hour).

Specified by:
getHourOfDay in interface TimeClock
Returns:
the time of day (hour)
See Also:
TimeClock.setHourOfDay(int)

getTODCode

public TimeClock.TimeOfDay getTODCode()
Description copied from interface: TimeClock
Gets the TOD code, which is the sun-orientation (morning, evening, etc)

Specified by:
getTODCode in interface TimeClock
Returns:
the TOD code
See Also:
TimeClock.setHourOfDay(int), TimeClock.setDawnToDusk(int, int, int, int), TimeClock.TimeOfDay

setHourOfDay

public boolean setHourOfDay(int t)
Description copied from interface: TimeClock
Sets the time of day (the hour).

Specified by:
setHourOfDay in interface TimeClock
Parameters:
t - the time of day (the hour)
Returns:
true, if the new time denotes a change of sun-orientation, false otherwise
See Also:
TimeClock.getHourOfDay()

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

deriveClock

public TimeClock deriveClock(long millis)
Description copied from interface: TimeClock
Using the current time and date as a yardstick, and assuming constant running and perfect timing, this method will derive a mud date and time from the given real life date/time in milliseconds.

Specified by:
deriveClock in interface TimeClock
Parameters:
millis - the milliseconds since 1970
Returns:
the time clock object representing that real life time
See Also:
TimeClock.deriveMillisAfter(TimeClock), TimeClock.deriveEllapsedTimeString(long)

deriveEllapsedTimeString

public java.lang.String deriveEllapsedTimeString(long millis)
Description copied from interface: TimeClock
Using the given number of milliseconds, this method will return a string describing the number of mud days, hours, etc that is represented by that amount of real time, assuming constant running and perfect timing.

Specified by:
deriveEllapsedTimeString in interface TimeClock
Parameters:
millis - the milliseconds of elapsed time represented
Returns:
the string representing the elapsed mud time
See Also:
TimeClock.deriveMillisAfter(TimeClock), TimeClock.deriveClock(long)

deriveMillisAfter

public long deriveMillisAfter(TimeClock C)
Description copied from interface: TimeClock
This method will discover the difference in mud hours between this time clock and the given EARLIER clock, assuming they use the same scale of measurement. It will then return the number of actual milliseconds would have elapsed, assuming constant running and perfect timing.

Specified by:
deriveMillisAfter in interface TimeClock
Parameters:
C - the earlier time clock object
Returns:
the number of milliseconds elapsed since the given clock
See Also:
TimeClock.deriveClock(long), TimeClock.deriveEllapsedTimeString(long)

deriveMudHoursAfter

public long deriveMudHoursAfter(TimeClock C)
Description copied from interface: TimeClock
This method will discover the difference in mud hours between this time clock and the given EARLIER clock, assuming they use the same scale of measurement. It will then return the number of actual mud hours would have elapsed.

Specified by:
deriveMudHoursAfter in interface TimeClock
Parameters:
C - the earlier time clock object
Returns:
the number of mud hours elapsed since the given clock
See Also:
TimeClock.deriveClock(long), TimeClock.deriveEllapsedTimeString(long)

handleTimeChange

public void handleTimeChange()
Description copied from interface: TimeClock
Causes the world to visibly react to a change in time

Specified by:
handleTimeChange in interface TimeClock

tickTock

protected void tickTock(int howManyHours,
                        boolean moveTheSky)

tickTock

public void tickTock(int howManyHours)
Description copied from interface: TimeClock
Alters the time/day by the given number of hours (forward or backward)

Specified by:
tickTock in interface TimeClock
Parameters:
howManyHours - the how many hours to alter the time by

bumpHours

public void bumpHours(int num)
Description copied from interface: TimeClock
Increase this clocks time by the given number of hours. Does NOT move the sky. Use tickTock for that.

Specified by:
bumpHours in interface TimeClock
Parameters:
num - the number to bump
See Also:
TimeClock.tickTock(int), TimeClock.bumpDays(int), TimeClock.bumpWeeks(int), TimeClock.bumpMonths(int), TimeClock.bumpYears(int)

bumpDays

public void bumpDays(int num)
Description copied from interface: TimeClock
Increase this clocks time by the given number of days. Does NOT move the sky. Use tickTock for that.

Specified by:
bumpDays in interface TimeClock
Parameters:
num - the number to bump
See Also:
TimeClock.tickTock(int), TimeClock.bumpHours(int), TimeClock.bumpWeeks(int), TimeClock.bumpMonths(int), TimeClock.bumpYears(int)

bumpWeeks

public void bumpWeeks(int num)
Description copied from interface: TimeClock
Increase this clocks time by the given number of weeks. Does NOT move the sky. Use tickTock for that.

Specified by:
bumpWeeks in interface TimeClock
Parameters:
num - the number to bump
See Also:
TimeClock.tickTock(int), TimeClock.bumpHours(int), TimeClock.bumpDays(int), TimeClock.bumpMonths(int), TimeClock.bumpYears(int)

bumpMonths

public void bumpMonths(int num)
Description copied from interface: TimeClock
Increase this clocks time by the given number of months. Does NOT move the sky. Use tickTock for that.

Specified by:
bumpMonths in interface TimeClock
Parameters:
num - the number to bump
See Also:
TimeClock.tickTock(int), TimeClock.bumpHours(int), TimeClock.bumpDays(int), TimeClock.bumpWeeks(int), TimeClock.bumpYears(int)

bumpYears

public void bumpYears(int num)
Description copied from interface: TimeClock
Increase this clocks time by the given number of years. Does NOT move the sky. Use tickTock for that.

Specified by:
bumpYears in interface TimeClock
Parameters:
num - the number to bump
See Also:
TimeClock.tickTock(int), TimeClock.bumpHours(int), TimeClock.bumpDays(int), TimeClock.bumpWeeks(int), TimeClock.bumpMonths(int)

toHoursSinceEpoc

public long toHoursSinceEpoc()
Description copied from interface: TimeClock
Returns the total hours since epoc

Specified by:
toHoursSinceEpoc in interface TimeClock
Returns:
total hours since epoc
See Also:
TimeClock.setFromHoursSinceEpoc(long)

setFromHoursSinceEpoc

public void setFromHoursSinceEpoc(long num)
Description copied from interface: TimeClock
Sets this clock to the given number of hours since epoc. Does NOT move the sky, you need to call tickTock for that.

Specified by:
setFromHoursSinceEpoc in interface TimeClock
Parameters:
num - the new time, in hours since epoc.
See Also:
TimeClock.tickTock(int), TimeClock.toHoursSinceEpoc()

save

public void save()
Description copied from interface: TimeClock
Saves the current time/date information where ever its supposed to be saved. Requires that setLoadName be called before.

Specified by:
save in interface TimeClock
See Also:
TimeClock.setLoadName(String)

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>