Uses of Enum Class
net.time4j.CalendarUnit
Packages that use CalendarUnit
Package
Description
The main package contains four basic types of ISO-8601, namely
PlainDate
, PlainTime
, PlainTimestamp
and Moment
.Support for various regional calendars.
Interval support.
-
Uses of CalendarUnit in net.time4j
Fields in net.time4j with type parameters of type CalendarUnitModifier and TypeFieldDescriptionstatic Normalizer<CalendarUnit>
Duration.STD_CALENDAR_PERIOD
Normalizes the calendrical items of a duration on the base1 year = 12 months
- without converting the days to months.static TemporalType<Period,Duration<CalendarUnit>>
TemporalType.THREETEN_PERIOD
Bridge between the JSR-310-classjava.time.Period
and the classnet.time4j.Duration
.Methods in net.time4j with type parameters of type CalendarUnitModifier and TypeMethodDescription<T extends TimePoint<? super CalendarUnit, T>>
longCalendarUnit.between(T start, T end)
Calculates the temporal distance between given calendar dates in this calendar unit.Methods in net.time4j that return CalendarUnitModifier and TypeMethodDescriptionstatic CalendarUnit
Returns the enum constant of this class with the specified name.static CalendarUnit[]
CalendarUnit.values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods in net.time4j that return types with arguments of type CalendarUnitModifier and TypeMethodDescriptionstatic Duration<CalendarUnit>
Short cut forTemporalType.THREETEN_PERIOD.translate(threetenPeriod)
.static TimeMetric<CalendarUnit,Duration<CalendarUnit>>
Duration.inYearsMonthsDays()
Constructs a metric in years, months and days.static TimeMetric<CalendarUnit,Duration<CalendarUnit>>
Duration.inYearsMonthsDays()
Constructs a metric in years, months and days.PlainDate.normalize(TimeSpan<? extends CalendarUnit> timespan)
Normalized given timespan using years, months and days.static Duration<CalendarUnit>
Duration.ofCalendarUnits(int years, int months, int days)
Creates a positive duration in years, months and days.static Duration<CalendarUnit>
Duration.parseCalendarPeriod(String period)
Parses a canonical representation with only date units to a calendrical duration.Duration.toCalendarPeriod()
Extracts a new duration with all contained calendar units only.Methods in net.time4j with parameters of type CalendarUnitModifier and TypeMethodDescriptionPlainDate.minus(long amount, CalendarUnit unit)
Subtracts given amount in units from this date and yields the result of subtraction.PlainTimestamp.minus(long amount, CalendarUnit unit)
Subtracts given amount in units from this timestamp and yields the result of subtraction.PlainDate.plus(long amount, CalendarUnit unit)
Adds given amount in units to this date and yields the result of addition.PlainTimestamp.plus(long amount, CalendarUnit unit)
Adds given amount in units to this timestamp and yields the result of addition.PrettyTime.print(long amount, CalendarUnit unit, TextWidth width)
Formats given duration in calendar units.PrettyTime.printRelativeOrDate(PlainDate date, TZID tzid, CalendarUnit maxRelativeUnit, TemporalFormatter<PlainDate> formatter)
Formats given date relative to the current date ofPrettyTime.getReferenceClock()
as duration or as absolute date.PrettyTime.printRelativeOrDateTime(UnixTime moment, Timezone tz, TimeUnit precision, CalendarUnit maxRelativeUnit, TemporalFormatter<Moment> formatter)
Formats given time point relative to the current time ofPrettyTime.getReferenceClock()
as duration in given precision or as absolute date-time.PrettyTime.withEmptyUnit(CalendarUnit emptyUnit)
Defines the time unit used for formatting an empty duration.Method parameters in net.time4j with type arguments of type CalendarUnitModifier and TypeMethodDescriptionDuration.compose(Duration<CalendarUnit> calendarPeriod, Duration<ClockUnit> clockPeriod)
Creates a composition of a calendar period and a clock period.PlainDate.normalize(TimeSpan<? extends CalendarUnit> timespan)
Normalized given timespan using years, months and days. -
Uses of CalendarUnit in net.time4j.calendar
Methods in net.time4j.calendar that return types with arguments of type CalendarUnitModifier and TypeMethodDescriptionstatic TimeAxis<CalendarUnit,JucheCalendar>
JucheCalendar.axis()
Returns the associated time axis.static TimeAxis<CalendarUnit,MinguoCalendar>
MinguoCalendar.axis()
Returns the associated time axis.static TimeAxis<CalendarUnit,ThaiSolarCalendar>
ThaiSolarCalendar.axis()
Returns the associated time axis. -
Uses of CalendarUnit in net.time4j.range
Fields in net.time4j.range with type parameters of type CalendarUnitModifier and TypeFieldDescriptionstatic Years<CalendarUnit>
Years.ONE
Constant for exactly one gregorian year.static Years<CalendarUnit>
Years.ZERO
Constant for zero gregorian years.Methods in net.time4j.range with type parameters of type CalendarUnitModifier and TypeMethodDescriptionstatic <T extends TimePoint<? super CalendarUnit, T>>
MonthsMonths.between(T t1, T t2)
Determines the temporal distance between given dates/time-points in gregorian months.static <T extends TimePoint<? super CalendarUnit, T>>
QuartersQuarters.between(T t1, T t2)
Determines the temporal distance between given dates/time-points in gregorian quarter years.static <T extends TimePoint<? super CalendarUnit, T>>
WeeksWeeks.between(T t1, T t2)
Determines the temporal distance between given dates/time-points in weeks.static <T extends TimePoint<? super CalendarUnit, T>>
Years<CalendarUnit>Years.between(T t1, T t2)
Determines the temporal distance between given dates/time-points in gregorian years.Methods in net.time4j.range that return types with arguments of type CalendarUnitModifier and TypeMethodDescriptionstatic Years<CalendarUnit>
Years.between(CalendarMonth m1, CalendarMonth m2)
Determines the difference in years between given calendar months.static Years<CalendarUnit>
Years.between(CalendarQuarter q1, CalendarQuarter q2)
Determines the difference in years between given quarter years.static Years<CalendarUnit>
Years.between(CalendarYear y1, CalendarYear y2)
Determines the difference in years between given calendar years.static <T extends TimePoint<? super CalendarUnit, T>>
Years<CalendarUnit>Years.between(T t1, T t2)
Determines the temporal distance between given dates/time-points in gregorian years.DateInterval.getDuration(CalendarUnit... units)
Yields the length of this interval in given calendrical units.DateInterval.getDurationInYearsMonthsDays()
Yields the length of this interval in years, months and days.static Years<CalendarUnit>
Years.ofGregorian(int years)
Obtains a time span in given gregorian years.static Years<CalendarUnit>
Years.parseGregorian(String period)
Parses the canonical ISO-8601-format "PnY" with possible preceding minus-char.Methods in net.time4j.range with parameters of type CalendarUnitModifier and TypeMethodDescriptionDateInterval.getDuration(CalendarUnit... units)
Yields the length of this interval in given calendrical units.Method parameters in net.time4j.range with type arguments of type CalendarUnitModifier and TypeMethodDescriptionCalendarMonth.minus(Years<CalendarUnit> years)
Subtracts given years from this calendar month.CalendarQuarter.minus(Years<CalendarUnit> years)
Subtracts given years from this quarter year.CalendarYear.minus(Years<CalendarUnit> years)
Subtracts given years from this year.CalendarMonth.plus(Years<CalendarUnit> years)
Adds given years to this calendar month.CalendarQuarter.plus(Years<CalendarUnit> years)
Adds given years to this quarter year.CalendarYear.plus(Years<CalendarUnit> years)
Adds given years to this year.DateInterval.stream(Duration<CalendarUnit> duration)
Obtains a stream iterating over every calendar date which is the result of addition of given duration to start until the end of this interval is reached.DateInterval.stream(Duration<CalendarUnit> duration, PlainDate start, PlainDate end)
Obtains a stream iterating over every calendar date which is the result of addition of given duration to start until the end is reached.