| Constructor and Description |
|---|
Time(short hour,
short minutes,
short seconds)
Constructs a new
Time object from the specified values. |
Time(String tm)
Constructs a new
Time object from the specified time string. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
after(Time time)
Returns
true if the this Time object contains a time
which is later the time in the parameter time. |
Time |
clone() |
boolean |
equals(Object obj) |
short |
getHours()
Returns the hours as short.
|
short |
getMinutes()
Returns the minutes as short.
|
int |
hashCode() |
static Time |
now()
Creates a new Time instance which is set to the current time.
|
void |
setHours(short hours)
Sets the hours of this
Time. |
void |
setMinutes(short minutes)
Sets the minutes of this
Time. |
String |
toString() |
public Time(String tm)
Time object from the specified time string.
The format of time must be hh:mm
An empty string can also be used to create a Time object which contains "00:00".tm - String containing a timepublic Time(short hour,
short minutes,
short seconds)
Time object from the specified values.hour - Hourminutes - Minuteseconds - Secondpublic short getHours()
public void setHours(short hours)
Time.hours - Short containing the new value for hourspublic short getMinutes()
public void setMinutes(short minutes)
Time.minutes - Short containing the new value for minutespublic boolean after(Time time)
true if the this Time object contains a time
which is later the time in the parameter time.time - Time which should be testedtrue if this time is later than the time in the paramterpublic static Time now()
Copyright © 2021. All rights reserved.