Package rs.baselib.util
Class RsMonth
java.lang.Object
java.util.Calendar
java.util.GregorianCalendar
rs.baselib.util.RsDate
rs.baselib.util.RsMonth
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<java.util.Calendar>
public class RsMonth extends RsDate
A month.
- Author:
- Ralph
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields inherited from class java.util.Calendar
ALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, LONG_FORMAT, LONG_STANDALONE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NARROW_FORMAT, NARROW_STANDALONE, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SHORT_FORMAT, SHORT_STANDALONE, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET -
Constructor Summary
Constructors Constructor Description RsMonth()Constructor.RsMonth(int month, int year)Constructor.RsMonth(long timeInMillis)Constructor.RsMonth(java.util.Calendar calendar)Constructor.RsMonth(java.util.Date date)Constructor.RsMonth(java.util.TimeZone timezone)Constructor.RsMonth(java.util.TimeZone timezone, int month, int year)Constructor.RsMonth(java.util.TimeZone timezone, long timeInMillis)Constructor.RsMonth(java.util.TimeZone timezone, java.util.Date date)Constructor. -
Method Summary
Modifier and Type Method Description protected voidensureBegin()Adjusts the time stamp to the start of the month.booleanequals(java.lang.Object o)RsDategetBegin()Returns the begin of this month.RsDategetEnd()Returns the end of this month.java.lang.StringgetKey()Returns the key of this month.static RsMonthgetMonth(java.lang.String key)Returns a month object for the given key.RsMonthgetNext()Returns the next month.RsMonthgetPrevious()Returns the previous month.inthashCode()java.lang.StringtoString()Methods inherited from class java.util.GregorianCalendar
add, clone, computeFields, computeTime, from, getActualMaximum, getActualMinimum, getCalendarType, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, getWeeksInWeekYear, getWeekYear, isLeapYear, isWeekDateSupported, roll, roll, setGregorianChange, setTimeZone, setWeekDate, toZonedDateTimeMethods inherited from class java.util.Calendar
after, before, clear, clear, compareTo, complete, get, getAvailableCalendarTypes, getAvailableLocales, getDisplayName, getDisplayNames, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toInstant
-
Constructor Details
-
RsMonth
public RsMonth()Constructor. -
RsMonth
public RsMonth(java.util.TimeZone timezone)Constructor.- Parameters:
timezone- - init with this timezone- Since:
- 1.2.8
-
RsMonth
public RsMonth(java.util.Date date)Constructor.- Parameters:
date- - init with date
-
RsMonth
public RsMonth(java.util.TimeZone timezone, java.util.Date date)Constructor.- Parameters:
timezone- - init with this timezonedate- - init with date
-
RsMonth
public RsMonth(long timeInMillis)Constructor.- Parameters:
timeInMillis- - init with timestamp
-
RsMonth
public RsMonth(java.util.TimeZone timezone, long timeInMillis)Constructor.- Parameters:
timezone- - init with this timezonetimeInMillis- - init with timestamp
-
RsMonth
public RsMonth(java.util.Calendar calendar)Constructor.- Parameters:
calendar- - init with calendar value
-
RsMonth
public RsMonth(int month, int year)Constructor.- Parameters:
month- month value (0-11)year- year value
-
RsMonth
public RsMonth(java.util.TimeZone timezone, int month, int year)Constructor.- Parameters:
timezone- - init with this timezonemonth- month value (0-11)year- year value- Since:
- 1.2.8
-
-
Method Details
-
ensureBegin
protected void ensureBegin()Adjusts the time stamp to the start of the month. -
getKey
public java.lang.String getKey()Returns the key of this month.- Returns:
- the key of this month
-
getBegin
Returns the begin of this month.- Returns:
- begin of month
-
getEnd
Returns the end of this month.- Returns:
- begin of month
-
getNext
Returns the next month.- Returns:
- next month
-
getPrevious
Returns the previous month.- Returns:
- previous month
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.util.GregorianCalendar
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.util.GregorianCalendar
-
toString
public java.lang.String toString() -
getMonth
Returns a month object for the given key.- Parameters:
key- key of month- Returns:
- month object
-