|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdriver.ted.utilities.T_Time
public class T_Time
Title: T_Time class
Description: Class defining basic time implementation
Copyright: (c) 2002 - 2006
Change History:
| Constructor Summary | |
|---|---|
T_Time()
T_Time constructor initializes each instance variable to zero. |
|
T_Time(int h)
T_Time constructor: hour supplied, minute and second defaulted to 0. |
|
T_Time(int h,
int m)
T_Time constructor: hour and minute supplied, second defaulted to 0. |
|
T_Time(int h,
int m,
int s)
T_Time constructor: hour, minute and second supplied. |
|
T_Time(T_Time time)
T_Time constructor with another T_Time object supplied. |
|
| Method Summary | |
|---|---|
void |
advanceTime(int h,
int m,
int s)
Advances the current time by the specified amounts |
int |
getHour()
Provides the current hour |
int |
getMinute()
Provides the current minute |
int |
getSecond()
Provides the current seconds |
void |
setHour(int h)
Sets the hour |
void |
setMinute(int m)
Sets the minutes |
void |
setSecond(int s)
Sets the seconds |
void |
setTime(int h,
int m,
int s)
Set the time to a new value using 24 hour time. |
java.lang.String |
toAMPMString()
Provides the current time in 12 hour (AM/PM) format. |
java.lang.String |
toString()
Provides a time output in string format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public T_Time()
public T_Time(int h)
h - The integer hour
public T_Time(int h,
int m)
h - The integer hourm - The integer minute
public T_Time(int h,
int m,
int s)
h - The integer hourm - The integer minutes - The integer secondspublic T_Time(T_Time time)
time - The T_Time object to base this one upon.| Method Detail |
|---|
public void setTime(int h,
int m,
int s)
h - The integer hour to setm - The integer minute to sets - The integer second to set
public void advanceTime(int h,
int m,
int s)
h - The number of hours to advance (positive or negative)m - The number of minutes to advance (positive or negative)s - The number of seconds to advance (positive or negative)public void setHour(int h)
h - The new hour valuepublic void setMinute(int m)
m - The new minute valuepublic void setSecond(int s)
s - the new seconds valuepublic int getHour()
public int getMinute()
public int getSecond()
public java.lang.String toString()
02:14:02 and 22:02:17
toString in class java.lang.Objectpublic java.lang.String toAMPMString()
02:14:02 AM and 10:02:17 PM
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||