|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTime100
An instance represents the time of day in a time zone, in
terms of hours, minutes, and seconds. The implemented time zones are:
GMT: Greenwich Mean Time, GMT
BST: British Summer Time, GMT+1
EST: Eastern Standard Time, GMT-5 hours (NY)
EDT: Eastern Daylight Savings Time, GMT-4 hours (NY)
CST: Central Standard Time, GMT-6 hours (Chicago)
CDT: Central Daylight Savings Time, GMT-5 hours (Chicago)
MST: Mountain Standard Time, GMT-7 hours (Phoenix)
MDT: Mountain Daylight Savings Time, GMT-6 (Phoenix)
PST: Pacific Standard Time, GMT-8 hours (LA)
PDT: Pacific Daylight Saving Time, GMT-7 hours (LA)
IND: India time, GMT+5:30 hours (New Delhi)
India (IND) is included only to show that times are not always on
hourly boundaries from GMT.
A time may appear negative or greater than 24 hours.
This is because we allow a conversion of a time from one time zone to another,
and a time of 0 hours GMT is -7 hours PDT (for example), while a time of
23:59 GMT is 29:29 IND.
An instance of the class can show the time using a 24-hour clock
or using the AM-PM designation; it is the user's choice.
Field Summary | |
static String |
BST
|
static String |
CDT
|
static String |
CST
|
static String |
EDT
|
static String |
EST
|
static String |
GMT
|
static String |
IND
|
static String |
MDT
|
static String |
MST
|
static String |
PDT
|
static String |
PST
|
Constructor Summary | |
Time100()
Constructor: an instance with time 0 in GMT and a 24-hour clock. |
|
Time100(int h,
int m,
int s,
String z,
boolean b)
Constructor: A time of day of h hours, m minutes, and s seconds in zone z. |
|
Time100(int s,
String z,
boolean b)
Constructor: A time of day of s seconds in zone z. |
Method Summary | |
int |
compareTo(Time100 t)
= -1 if this time < time t, 0 if this time equals time t, and 1 if this time > time t |
boolean |
getAmPm()
= the am-pm indication. |
int |
getTime()
= the time, in seconds. |
String |
getZone()
= the time zone. |
void |
setDisplay(boolean b)
If b is true, set the display mode to AM-PM; if b is false, set it to "twenty-four hours". |
Time100 |
timeInGMT()
= a new Time that is the same as this time but described in GMT |
Time100 |
timeInZone(String z)
= a new Time that is the same as this time but described in zone z. |
String |
toString()
= a string representation of the time. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String GMT
public static final String BST
public static final String EST
public static final String EDT
public static final String CST
public static final String CDT
public static final String MST
public static final String MDT
public static final String PST
public static final String PDT
public static final String IND
Constructor Detail |
public Time100()
public Time100(int s, String z, boolean b)
public Time100(int h, int m, int s, String z, boolean b)
Method Detail |
public int getTime()
public String getZone()
public boolean getAmPm()
public void setDisplay(boolean b)
public String toString()
public Time100 timeInGMT()
public Time100 timeInZone(String z)
public int compareTo(Time100 t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |