Package com.storedobject.core
Class Month
java.lang.Object
java.util.Date
java.sql.Date
com.storedobject.core.Month
- All Implemented Interfaces:
Displayable,Serializable,Cloneable,Comparable<Date>
Represents a specific month by extending the
Date class. This class ensures that
the time is normalized to the first day of the month, with time components such as hours,
minutes, seconds, and milliseconds set to zero. It implements the Displayable
interface to provide a string representation suited for display purposes.- Author:
- Syam
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.sql.Date
getHours, getMinutes, getSeconds, setHours, setMinutes, setSeconds, toInstant, toLocalDate, valueOf, valueOf
-
Constructor Details
-
Month
public Month()Default constructor for the Month class. Initializes the instance to represent the current month with the time set to the first day of the month and all time components (hours, minutes, seconds, and milliseconds) set to zero. -
Month
public Month(long time) Constructs aMonthobject that represents a specific month based on the provided time in milliseconds. The time provided is normalized to the first day of the month with time components (hours, minutes, seconds, milliseconds) set to zero.- Parameters:
time- the time in milliseconds since the epoch (January 1, 1970, 00:00:00 GMT) corresponding to the month to be represented
-
-
Method Details
-
setTime
-
getTime
-
toString
-
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.
-