Package com.uc4.api
Class Time
java.lang.Object
com.uc4.api.Time
- All Implemented Interfaces:
Cloneable
This class represents a
Time which consits of hours and minutes only.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the thisTimeobject contains a time which is later the time in the parametertime.clone()booleanshortgetHours()Returns the hours as short.shortReturns the minutes as short.inthashCode()static Timenow()Creates a new Time instance which is set to the current time.voidsetHours(short hours) Sets the hours of thisTime.voidsetMinutes(short minutes) Sets the minutes of thisTime.toString()
-
Constructor Details
-
Time
Constructs a newTimeobject from the specified time string. The format oftimemust be hh:mm An empty string can also be used to create aTimeobject which contains "00:00".- Parameters:
tm- String containing a time
-
Time
public Time(short hour, short minutes, short seconds) Constructs a newTimeobject from the specified values.- Parameters:
hour- Hourminutes- Minuteseconds- Second
-
Time
creates a uc4 Time from a jdk java.time.LocalTime.- Parameters:
jdkLocalTime- . if null, the time at midnight (0:00:00) will be used
-
-
Method Details
-
clone
-
toLocalTime
-
getHours
public short getHours()Returns the hours as short.- Returns:
- Short containing the hours
-
setHours
public void setHours(short hours) Sets the hours of thisTime.- Parameters:
hours- Short containing the new value for hours
-
getMinutes
public short getMinutes()Returns the minutes as short.- Returns:
- Short containing the minutes
-
setMinutes
public void setMinutes(short minutes) Sets the minutes of thisTime.- Parameters:
minutes- Short containing the new value for minutes
-
equals
-
hashCode
public int hashCode() -
after
Returnstrueif the thisTimeobject contains a time which is later the time in the parametertime.- Parameters:
time- Time which should be tested- Returns:
- Boolean value which is set to
trueif this time is later than the time in the paramter
-
toString
-
now
Creates a new Time instance which is set to the current time.- Returns:
- Time
-