|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.applib.value.Magnitude
org.nakedobjects.applib.value.Time
public class Time
Value object representing a time value.
TODO: other methods to implement:
| Field Summary | |
|---|---|
static int |
DAY
|
static int |
HOUR
|
static int |
MINUTE
|
| Constructor Summary | |
|---|---|
Time()
Create a Time object set to the current time. |
|
Time(Date date)
Create a Time object for storing a time with the time set to the specified time of the Java Date object. |
|
Time(int hour,
int minute)
Create a Time object for storing a time with the time set to the specified hours and minutes. |
|
| Method Summary | |
|---|---|
Time |
add(int hours,
int minutes)
Add the specified hours and minutes to this time value, returned as a new Time object. |
protected Time |
createTime(Date date)
|
protected Time |
createTime(int hours,
int minutes)
|
Date |
dateValue()
|
boolean |
equals(Object obj)
|
int |
getHour()
|
int |
getMinute()
|
boolean |
isEqualTo(Magnitude time)
returns true if the time of this object has the same value as the specified time |
boolean |
isLessThan(Magnitude time)
returns true if the time of this object is earlier than the specified time |
long |
longValue()
The number of seconds since midnight. |
Time |
onTheHour()
|
boolean |
sameHourAs(Time time)
|
boolean |
sameMinuteAs(Time time)
|
String |
titleString()
|
String |
toString()
|
| Methods inherited from class org.nakedobjects.applib.value.Magnitude |
|---|
isBetween, isGreaterThan, isGreaterThanOrEqualTo, isLessThanOrEqualTo, max, min |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MINUTE
public static final int HOUR
public static final int DAY
| Constructor Detail |
|---|
public Time()
public Time(int hour,
int minute)
public Time(Date date)
| Method Detail |
|---|
public Time add(int hours,
int minutes)
protected Time createTime(int hours,
int minutes)
protected Time createTime(Date date)
public Date dateValue()
public boolean equals(Object obj)
equals in class Objectpublic int getHour()
public int getMinute()
public boolean isEqualTo(Magnitude time)
isEqualTo in class Magnitudepublic boolean isLessThan(Magnitude time)
isLessThan in class Magnitudepublic long longValue()
public String titleString()
public String toString()
toString in class Objectpublic boolean sameHourAs(Time time)
public boolean sameMinuteAs(Time time)
public Time onTheHour()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||