CMObject
, Tickable
, CMLibrary
, TimeManager
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CoffeeTime extends StdLibrary implements TimeManager
Modifier and Type | Field | Description |
---|---|---|
protected TimeClock |
globalClock |
idConverter
isDebugging, name, serviceClient, tickStatus
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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, 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_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
MILI_DAY, MILI_HOUR, MILI_MINUTE, MILI_MONTH, MILI_SECOND, MILI_WEEK, MILI_YEAR, MONTHS, SHORTMONTHS
Constructor | Description |
---|---|
CoffeeTime() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
convertHour(java.lang.String hours24) |
Returns the regular Hours given the hours in the
international format (military time)
Usage: ConvertHour(GetIn(req, "ENDHR"))
|
java.lang.String |
date2AMPMString(long time) |
Returns the Minutes portion of a given Time
Usage: String ST_AMPM=date2AMPMString(time);
|
java.lang.String |
date2AMPMString(java.util.Calendar C) |
|
java.lang.String |
date2APTimeString(long time) |
Return the time in HH:MM AP format.
|
java.lang.String |
date2BestShortEllapsedTime(long t) |
Picks the single best representation of the given ellapsed time,
from seconds to minutes to hours to days, and returns the correct
amount along with the single letter suffix
|
java.lang.String |
date2BriefString(long time) |
Returns time in HH:MMap format, unless the day is other
than today, in which case it prepends yy/m/d.
|
java.lang.String |
date2Date2String(long time) |
Converts a given date into a string of form:
MM/DD/YY
Usage: date2Date2String(time)
|
java.lang.String |
date2DateString(long time) |
Converts a given date into a string of form:
MM/DD/YYYY
Usage: date2DateString(time)
|
java.lang.String |
date2DayOfMonthString(long time) |
Returns the DD portion of a given date
Usage: String ENDDD=date2DayOfMonthString();
|
java.lang.String |
date2EllapsedTime(long time,
java.util.concurrent.TimeUnit minUnit,
boolean shortest) |
Converts a given number of milliseconds,
into a number of rl years, months, days,
hours, minutes, and seconds.
|
java.lang.String |
date2HRString(long time) |
Returns the Hours portion of a given Time
Usage: String ENDHR=date2HRString();
|
java.lang.String |
date2HRString(java.util.Calendar C) |
|
java.lang.String |
date2MINString(long time) |
Returns the Minutes portion of a given Time
Usage: String ENDMIN=date2MINString();
|
java.lang.String |
date2MINString(java.util.Calendar C) |
|
java.lang.String |
date2MonthDateString(long time,
boolean shortName) |
Returns the month/day for a given date
Usage: String ENDMM=date2MonthDateString();
|
java.lang.String |
date2MonthString(long time,
boolean shortName) |
Returns the month for a given date
Usage: String ENDMM=date2MonthString(time,true);
|
java.lang.String |
date2SecondsString(long time) |
Converts a given date into a string of form:
MM/DD/YYYY HH:MM AP
Usage: date2SecondsString(time)
|
java.lang.String |
date2SmartEllapsedTime(long time,
boolean shortest) |
Converts a given number of milliseconds,
into a number of rl years, months, days,
hours, minutes, and seconds.
|
java.lang.String |
date2String(long time) |
Converts a given date into a string of form:
MM/DD/YYYY HH:MM AP
Usage: date2String(time)
|
java.lang.String |
date2String(java.util.Calendar C) |
Converts a given date into a string of form:
MM/DD/YYYY HH:MM AP
Usage: date2String()
|
java.lang.String |
date2String24(long time) |
Converts a given date into a string of form:
YYYY/MM/DD HH:MM where HH is 24 hr
Usage: date2String24(time)
|
java.lang.String |
date2String24(java.util.Calendar C) |
Converts a given date into a string of form:
YYYY/MM/DD HH:MM where HH is 24 hr
Usage: date2String24(C)
|
java.lang.String |
date2YYYYString(long time) |
Returns the YYYY portion of a given date
Returns the DD portion of a given date
Usage: String ENDYYYY=date2YYYYString();
|
java.lang.String |
date2ZoneString(long time) |
Returns the time zone of the server
Usage: MEETZN = T2ZoneString();
|
java.lang.String |
getAMPM(java.lang.String TheHour) |
Returns the AMPM stamp given the international Hours portion the Time
Usage: getAMPM(GetIn(req, "ENDHR"))
|
java.lang.String |
getMonthName(int number,
boolean giveShort) |
Return the name of the month, given a number
Usage: String Mnth=getMonthName(m,GiveShort).charStats();
|
java.lang.String |
getTheIntZoneID(int theRawOffset) |
Get the zone id given the timezone string
Usage: GetTheZoneID(MeetTZ.getRawOffset())+"\n";
|
java.lang.String |
getTheTimeZone(java.lang.String theID) |
Returns the time zone of the given ID
Usage: MEETZN = GetTheTimeZone(ID);
|
TimeClock |
globalClock() |
Returns the mud wide global time clock
object as defined by the coffeemud.ini
file.
|
TimeClock |
homeClock(Physical P) |
Returns the home clock for the given object.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
isTickExpression(java.lang.String val) |
Parses whether a tick expression, or an
expression ending with the word minutes,
hours, seconds, days, mudhours, muddays,
mudweeks, mudmonths, or mudyears
|
boolean |
isValidDateString(java.lang.String dateTimeStr) |
Returns whether the given string would parse to a valid
date.
|
TimeClock |
localClock(Physical P) |
Returns the most local clock for the given object.
|
java.lang.String |
month2MM(java.lang.String monthName) |
Returns the numeric representation of the month
Usage: month2MM("January");
|
int |
parseTickExpression(java.lang.String val) |
Parses either a tick expression, or an
expression ending with the word minutes,
hours, seconds, days, mudhours, muddays,
mudweeks, mudmonths, or mudyears
|
java.lang.String |
smtpDateFormat(long time) |
format the date for an smtp message
Usage: smtpDateFormat(98374987234)
|
java.util.Calendar |
string2Date(java.lang.String dateTimeStr) |
Converts a string of some form into a Calendar object.
|
long |
string2Millis(java.lang.String dateTimeStr) |
Converts a string of some form into a timestamp.
|
java.util.Calendar |
string2TimeFuture(java.lang.String timeStr) |
Converts a string of some future time into a Calendar object.
|
java.lang.String |
twoDigits(long num) |
Converts a number to two digits.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
protected TimeClock globalClock
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public java.lang.String month2MM(java.lang.String monthName)
TimeManager
month2MM
in interface TimeManager
monthName
- The month namepublic java.lang.String getMonthName(int number, boolean giveShort)
TimeManager
getMonthName
in interface TimeManager
number
- Month number to convertgiveShort
- Give abbreviation if truepublic long string2Millis(java.lang.String dateTimeStr)
TimeManager
string2Millis
in interface TimeManager
dateTimeStr
- The string to retrieve frompublic java.util.Calendar string2Date(java.lang.String dateTimeStr)
TimeManager
string2Date
in interface TimeManager
dateTimeStr
- The string to retrieve frompublic java.util.Calendar string2TimeFuture(java.lang.String timeStr)
TimeManager
string2TimeFuture
in interface TimeManager
timeStr
- The string to retrieve time frompublic boolean isValidDateString(java.lang.String dateTimeStr)
TimeManager
isValidDateString
in interface TimeManager
dateTimeStr
- the strong to parsepublic java.lang.String convertHour(java.lang.String hours24)
TimeManager
convertHour
in interface TimeManager
hours24
- Hours in military formatpublic java.lang.String getAMPM(java.lang.String TheHour)
TimeManager
getAMPM
in interface TimeManager
TheHour
- Hours in military formatpublic java.lang.String getTheIntZoneID(int theRawOffset)
TimeManager
getTheIntZoneID
in interface TimeManager
theRawOffset
- The time zone's raw offset to convertpublic java.lang.String getTheTimeZone(java.lang.String theID)
TimeManager
getTheTimeZone
in interface TimeManager
theID
- The ID of the abbreviated time zone.public java.lang.String date2MonthString(long time, boolean shortName)
TimeManager
date2MonthString
in interface TimeManager
time
- The time in milisecondsshortName
- true to use shortened monthspublic java.lang.String date2MonthDateString(long time, boolean shortName)
TimeManager
date2MonthDateString
in interface TimeManager
time
- The time in milisecondsshortName
- true to use shortened monthspublic java.lang.String date2DayOfMonthString(long time)
TimeManager
date2DayOfMonthString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String twoDigits(long num)
TimeManager
twoDigits
in interface TimeManager
num
- the numberpublic java.lang.String date2YYYYString(long time)
TimeManager
date2YYYYString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2HRString(long time)
TimeManager
date2HRString
in interface TimeManager
time
- time usedpublic java.lang.String date2MINString(long time)
TimeManager
date2MINString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2HRString(java.util.Calendar C)
public java.lang.String date2MINString(java.util.Calendar C)
public java.lang.String date2ZoneString(long time)
TimeManager
date2ZoneString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2AMPMString(long time)
TimeManager
date2AMPMString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2AMPMString(java.util.Calendar C)
public java.lang.String date2APTimeString(long time)
TimeManager
date2APTimeString
in interface TimeManager
time
- the time in millispublic java.lang.String date2BriefString(long time)
TimeManager
date2BriefString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2String(java.util.Calendar C)
TimeManager
date2String
in interface TimeManager
C
- The time in calendarpublic java.lang.String date2String(long time)
TimeManager
date2String
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2String24(java.util.Calendar C)
TimeManager
date2String24
in interface TimeManager
C
- The time in calendarpublic java.lang.String date2String24(long time)
TimeManager
date2String24
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2EllapsedTime(long time, java.util.concurrent.TimeUnit minUnit, boolean shortest)
TimeManager
date2EllapsedTime
in interface TimeManager
time
- The time in milisecondsminUnit
- The smallest unit to round down toshortest
- true for short form, false otherwisepublic java.lang.String date2BestShortEllapsedTime(long t)
TimeManager
date2BestShortEllapsedTime
in interface TimeManager
t
- time in millisecondspublic java.lang.String date2SmartEllapsedTime(long time, boolean shortest)
TimeManager
date2SmartEllapsedTime
in interface TimeManager
time
- The time in milisecondsshortest
- true for short form, false otherwisepublic java.lang.String date2SecondsString(long time)
TimeManager
date2SecondsString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2DateString(long time)
TimeManager
date2DateString
in interface TimeManager
time
- The time in milisecondspublic java.lang.String date2Date2String(long time)
TimeManager
date2Date2String
in interface TimeManager
time
- The time in milisecondspublic java.lang.String smtpDateFormat(long time)
TimeManager
smtpDateFormat
in interface TimeManager
time
- The time in milisecondspublic TimeClock globalClock()
TimeManager
globalClock
in interface TimeManager
TimeClock
public boolean isTickExpression(java.lang.String val)
TimeManager
isTickExpression
in interface TimeManager
val
- the expressionpublic int parseTickExpression(java.lang.String val)
TimeManager
parseTickExpression
in interface TimeManager
val
- the expressionpublic TimeClock localClock(Physical P)
TimeManager
localClock
in interface TimeManager
P
- an item, room, mob, whatever.TimeClock
public TimeClock homeClock(Physical P)
TimeManager
homeClock
in interface TimeManager
P
- an item, room, mob, whatever.TimeClock