Package com.storedobject.core
Class MinutesTime
java.lang.Object
java.util.Date
java.sql.Time
com.storedobject.core.MinutesTime
- All Implemented Interfaces:
Displayable,Serializable,Cloneable,Comparable<Date>
Represents a
Time instance rounded to the nearest minute.
This class is an extension of Time and implements
the Displayable interface, ensuring that the time component
is always precise to the minute.
The primary purpose of this class is to provide accurate time precision
in minutes by truncating seconds, offering a string
representation formatted to show hours and minutes.- Author:
- Syam
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newMinutesTimeobject, initializing it with the current system time rounded to the nearest minute.MinutesTime(long time) Constructs aMinutesTimeinstance with the specified time in milliseconds. -
Method Summary
Methods inherited from class java.sql.Time
getDate, getDay, getMonth, getYear, setDate, setMonth, setYear, toInstant, toLocalTime, valueOf, valueOfMethods inherited from class java.util.Date
after, before, clone, compareTo, equals, from, getHours, getMinutes, getSeconds, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC
-
Constructor Details
-
MinutesTime
public MinutesTime()Constructs a newMinutesTimeobject, initializing it with the current system time rounded to the nearest minute. This constructor leverages the no-argument constructor to fetch the current system time in milliseconds and ensures that the time value is truncated to the minute precision by stripping the seconds and milliseconds components. -
MinutesTime
public MinutesTime(long time) Constructs aMinutesTimeinstance with the specified time in milliseconds. The provided time is rounded down to the nearest minute by truncating the seconds and milliseconds components.- Parameters:
time- the time in milliseconds, representing the number of milliseconds since the Unix epoch (January 1, 1970, 00:00:00 GMT).
-
-
Method Details
-
setTime
-
getTime
-
toDisplay
Description copied from interface:DisplayableConvert to a displayable string. The default implementation returns theStringUtility.toStringInt(Object)value.- Specified by:
toDisplayin interfaceDisplayable- Returns:
- A displayable string.
-
toString
-