|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmetab.DrinkTime
The DrinkTime class has use only in containing a time of day.
It does not specify a date for simplicity. It relies on hours, minutes, and
a 12-hour (non-military) clock to hold the time. This class was designed
instead of using the Date-types because neither milliseconds nor
specific dates were required.
| Field Summary | |
static int |
_AM
Standard value representing AM hours. |
static int |
_PM
Standard value representing PM hours. |
private int |
AMorPM
Specifies whether time is AM or PM. |
private int |
hours
Number of hours. |
private int |
minutes
Number of minutes. |
| Constructor Summary | |
(package private) |
DrinkTime(int hours,
int minutes,
int AMorPM)
Constructor for DrinkTime class. |
| Method Summary | |
int |
getAMorPM()
Retrieves 12-hour format information. |
DrinkTime |
getCopy()
Retrieves a copy of time encompassing drinking period. |
int |
getHours()
Retrieves number of hours. |
int |
getMinutes()
Retrieves number of minutes. |
void |
setAMorPM(int AMorPM)
Sets whether time is AM or PM. |
void |
setHours(int hours)
Sets number of hours. |
void |
setMinutes(int minutes)
Sets number of minutes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int _AM
public static final int _PM
private int hours
private int minutes
private int AMorPM
| Constructor Detail |
DrinkTime(int hours,
int minutes,
int AMorPM)
hours - Number of hours.minutes - Number of minutes.AMorPM - Specifies whether time is AM or PM.| Method Detail |
public int getHours()
int representing number of hours.public int getMinutes()
int representing number of minutes.public int getAMorPM()
int representing whether time is AM or PM.public DrinkTime getCopy()
DrinkTime representing new instance of current time.public void setHours(int hours)
hours - Number of hours.public void setMinutes(int minutes)
minutes - Number of minutes.public void setAMorPM(int AMorPM)
AMorPM - Specifies whether time is AM or PM.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||