public final class HinduDay extends HinduPrimitive implements Comparable<HinduDay>, ChronoCondition<HinduCalendar>, Serializable
The Hindu day of month extends between 1 and at maximum 32 and might also have a leap state when used in lunisolar context.
ADHIKA_INDICATOR, ADHIKA_IS_TRAILING| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(HinduDay other)
Uses the comparing order of the lunisolar calendar.
|
boolean |
equals(Object obj) |
int |
getValue()
Obtains the numerical value.
|
int |
hashCode() |
boolean |
isLeap()
Determines if this day of month is in leap state (intercalated day).
|
boolean |
test(HinduCalendar context)
Decides if given context matches this condition.
|
String |
toString() |
static HinduDay |
valueOf(int dayOfMonth)
Gets the Hindu day of month which corresponds to the given numerical value.
|
HinduDay |
withLeap()
Obtains the leap day version of this day.
|
public static HinduDay valueOf(int dayOfMonth)
Gets the Hindu day of month which corresponds to the given numerical value.
Users have to invoke the method withLeap() in order to obtain a leap day
in lunisolar context.
dayOfMonth - numerical value in the range [1-32]IllegalArgumentException - if given argument is out of range 1-32public int getValue()
Obtains the numerical value.
Important note: Hindu days in lunisolar context might be expunged which simply means that there are gaps in the numbering of the days per month. And intercalated days have the same number.
public boolean isLeap()
Determines if this day of month is in leap state (intercalated day).
A leap day follows after an ordinary day while a leap month is before the ordinary month.
isLeap in class HinduPrimitivepublic HinduDay withLeap()
Obtains the leap day version of this day.
public int compareTo(HinduDay other)
Uses the comparing order of the lunisolar calendar.
Leap days are sorted after days with same number.
compareTo in interface Comparable<HinduDay>other - another month to be compared withpublic boolean test(HinduCalendar context)
ChronoConditionDecides if given context matches this condition.
Due to better readability it is recommended to use following equivalent approach instead of this method::
import static net.time4j.Weekday.SATURDAY; import static net.time4j.Month.JANUARY; PlainDate date = PlainDate.of(2014, JANUARY, 25); System.out.println(SATURDAY.test(date)); // direct use System.out.println(date.matches(SATURDAY)); // recommended callback
test in interface Predicate<HinduCalendar>test in interface ChronoCondition<HinduCalendar>context - context as base of testing this conditiontrue if given time context matches this condition
else falseCopyright © 2014–2021. All rights reserved.