Package com.storedobject.core
Class Year
java.lang.Object
java.util.Date
java.sql.Date
com.storedobject.core.Year
- All Implemented Interfaces:
Displayable,Serializable,Cloneable,Comparable<Date>
Represents a specific year. This class extends
Date and is designed to handle
date-related operations specifically at the year level, resetting all other components
(month, day, time, etc.) to default values.- 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
-
Year
public Year()Default constructor for theYearclass. Initializes aYearinstance representing the current year by using the current date provided byDateUtility.today(). The time components (month, day, hour, minute, second, millisecond) are stripped, leaving only the year component. -
Year
public Year(long time) Constructs aYearinstance initialized to the specified time in milliseconds. The time is processed to represent only the year component by resetting all other date and time values (e.g., month, day, hour, minute, second, and millisecond) to their default values.- Parameters:
time- the milliseconds since the Unix epoch (January 1, 1970, 00:00:00 GMT) representing the initial year to set for thisYearinstance.
-
-
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.
-