Interface CalendarDate
- All Superinterfaces:
Temporal<CalendarDate>
- All Known Implementing Classes:
BadiCalendar
,CalendarVariant
,Calendrical
,ChineseCalendar
,CopticCalendar
,EastAsianCalendar
,EthiopianCalendar
,FrenchRepublicanCalendar
,HebrewCalendar
,HijriCalendar
,HinduCalendar
,HistoricCalendar
,IndianCalendar
,JapaneseCalendar
,JucheCalendar
,JulianCalendar
,KoreanCalendar
,MinguoCalendar
,PersianCalendar
,PlainDate
,ThaiSolarCalendar
,VietnameseCalendar
Represents a general calendar date.
- Since:
- 3.8/4.5
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends CalendarVariant<T>>
Tfrom(ChronoLocalDate threeten, CalendarFamily<T> target, String variant)
Converts the calendar date corresponding toChronoLocalDate
in given target chronology and variant.static <T extends CalendarVariant<T>>
Tfrom(ChronoLocalDate threeten, CalendarFamily<T> target, VariantSource variantSource)
Converts the calendar date corresponding toChronoLocalDate
in given target chronology and variant.static <T extends Calendrical<?, T>>
Tfrom(ChronoLocalDate threeten, Chronology<T> target)
Converts the calendar date corresponding toChronoLocalDate
in given target chronology.long
Counts the elapsed days since UTC epoch.default <T extends Calendrical<?, T>>
TConverts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].default <T extends CalendarVariant<T>>
TConverts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].default <T extends CalendarVariant<T>>
Ttransform(Class<T> target, VariantSource variantSource)
Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].default <T extends CalendarVariant<T>>
Ttransform(CalendarFamily<T> target, String variant)
Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].default <T extends CalendarVariant<T>>
Ttransform(CalendarFamily<T> target, VariantSource variantSource)
Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].default <T extends Calendrical<?, T>>
Ttransform(Chronology<T> target)
Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].Methods inherited from interface net.time4j.engine.Temporal
isAfter, isAfterAll, isAfterOrEqual, isBefore, isBeforeAll, isBeforeOrEqual, isSimultaneous
-
Method Details
-
getDaysSinceEpochUTC
long getDaysSinceEpochUTC()Counts the elapsed days since UTC epoch.
- Returns:
- count of days relative to UTC epoch [1972-01-01]
- Since:
- 3.8/4.5
- See Also:
EpochDays.UTC
-
transform
Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].
The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.
- Type Parameters:
T
- generic target date type- Parameters:
target
- chronology this date shall be converted to- Returns:
- converted date of target type T
- Throws:
ArithmeticException
- in case of numerical overflow- Since:
- 4.27
-
transform
Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].
The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.
- Type Parameters:
T
- generic target date type- Parameters:
target
- chronology this date shall be converted tovariant
- desired calendar variant- Returns:
- converted date of target type T
- Throws:
ChronoException
- if given variant is not recognizedArithmeticException
- in case of numerical overflow- Since:
- 4.27
-
transform
default <T extends CalendarVariant<T>> T transform(CalendarFamily<T> target, VariantSource variantSource)Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].
The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.
- Type Parameters:
T
- generic target date type- Parameters:
target
- chronology this date shall be converted tovariantSource
- source of desired calendar variant- Returns:
- converted date of target type T
- Throws:
ChronoException
- if the variant of given source is not recognizedArithmeticException
- in case of numerical overflow- Since:
- 4.27
-
transform
Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].
The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.
- Type Parameters:
T
- generic target date type- Parameters:
target
- chronological type this date shall be converted to- Returns:
- converted date of target type T
- Throws:
IllegalArgumentException
- if the target class does not have any chronologyArithmeticException
- in case of numerical overflow- Since:
- 4.27
-
transform
Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].
The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.
- Type Parameters:
T
- generic target date type- Parameters:
target
- chronological type this date shall be converted tovariant
- desired calendar variant- Returns:
- converted date of target type T
- Throws:
ChronoException
- if given variant is not recognizedIllegalArgumentException
- if the target class does not have any chronologyArithmeticException
- in case of numerical overflow- Since:
- 4.27
-
transform
Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].
The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.
- Type Parameters:
T
- generic target date type- Parameters:
target
- chronological type this date shall be converted tovariantSource
- source of desired calendar variant- Returns:
- converted date of target type T
- Throws:
ChronoException
- if the variant of given source is not recognizedIllegalArgumentException
- if the target class does not have any chronologyArithmeticException
- in case of numerical overflow- Since:
- 4.27
-
from
static <T extends CalendarVariant<T>> T from(ChronoLocalDate threeten, CalendarFamily<T> target, VariantSource variantSource)Converts the calendar date corresponding to
ChronoLocalDate
in given target chronology and variant.- Type Parameters:
T
- type of target chronology- Parameters:
threeten
- theChronoLocalDate
to be convertedtarget
- chronology given date shall be converted tovariantSource
- source of desired calendar variant- Returns:
- converted date of target type T
- Throws:
ChronoException
- if the variant of given source is not recognizedArithmeticException
- in case of numerical overflow- Since:
- 5.8
-
from
static <T extends CalendarVariant<T>> T from(ChronoLocalDate threeten, CalendarFamily<T> target, String variant)Converts the calendar date corresponding to
ChronoLocalDate
in given target chronology and variant.- Type Parameters:
T
- type of target chronology- Parameters:
threeten
- theChronoLocalDate
to be convertedtarget
- chronology given date shall be converted tovariant
- desired calendar variant- Returns:
- converted date of target type T
- Throws:
ChronoException
- if the variant of given source is not recognizedArithmeticException
- in case of numerical overflow- Since:
- 5.8
-
from
Converts the calendar date corresponding to
ChronoLocalDate
in given target chronology.- Type Parameters:
T
- type of target chronology- Parameters:
threeten
- theChronoLocalDate
to be convertedtarget
- chronology given date shall be converted to- Returns:
- converted date of target type T
- Throws:
ArithmeticException
- in case of numerical overflow- Since:
- 5.8
-