| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.calendar |
Support for various regional calendars.
|
| net.time4j.range |
Interval support.
|
| Modifier and Type | Field and Description |
|---|---|
static Normalizer<CalendarUnit> |
Duration.STD_CALENDAR_PERIOD
Normalizes the calendrical items of a duration on the base
1 year = 12 months - without converting the days to months. |
static TemporalType<Period,Duration<CalendarUnit>> |
TemporalType.THREETEN_PERIOD
Bridge between the JSR-310-class
java.time.Period and
the class net.time4j.Duration. |
| Modifier and Type | Method and Description |
|---|---|
<T extends TimePoint<? super CalendarUnit,T>> |
CalendarUnit.between(T start,
T end)
Calculates the temporal distance between given calendar dates
in this calendar unit.
|
| Modifier and Type | Method and Description |
|---|---|
static CalendarUnit |
CalendarUnit.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CalendarUnit[] |
CalendarUnit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static Duration<CalendarUnit> |
Duration.from(Period threetenPeriod)
Short cut for
TemporalType.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.
|
Duration<CalendarUnit> |
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<CalendarUnit> |
Duration.toCalendarPeriod()
Extracts a new duration with all contained calendar units only.
|
| Modifier and Type | Method and Description |
|---|---|
PlainTimestamp |
PlainTimestamp.minus(long amount,
CalendarUnit unit)
Subtracts given amount in units from this timestamp and yields the result of subtraction.
|
PlainDate |
PlainDate.minus(long amount,
CalendarUnit unit)
Subtracts given amount in units from this date and yields the result of subtraction.
|
PlainTimestamp |
PlainTimestamp.plus(long amount,
CalendarUnit unit)
Adds given amount in units to this timestamp and yields the result of addition.
|
PlainDate |
PlainDate.plus(long amount,
CalendarUnit unit)
Adds given amount in units to this date and yields the result of addition.
|
String |
PrettyTime.print(long amount,
CalendarUnit unit,
TextWidth width)
Formats given duration in calendar units.
|
String |
PrettyTime.printRelativeOrDate(PlainDate date,
TZID tzid,
CalendarUnit maxRelativeUnit,
TemporalFormatter<PlainDate> formatter)
Formats given date relative to the current date of
PrettyTime.getReferenceClock()
as duration or as absolute date. |
String |
PrettyTime.printRelativeOrDateTime(UnixTime moment,
Timezone tz,
TimeUnit precision,
CalendarUnit maxRelativeUnit,
TemporalFormatter<Moment> formatter)
Formats given time point relative to the current time of
PrettyTime.getReferenceClock()
as duration in given precision or as absolute date-time. |
PrettyTime |
PrettyTime.withEmptyUnit(CalendarUnit emptyUnit)
Defines the time unit used for formatting an empty duration.
|
| Modifier and Type | Method and Description |
|---|---|
static Duration<IsoUnit> |
Duration.compose(Duration<CalendarUnit> calendarPeriod,
Duration<ClockUnit> clockPeriod)
Creates a composition of a calendar period and a clock period.
|
Duration<CalendarUnit> |
PlainDate.normalize(TimeSpan<? extends CalendarUnit> timespan)
Normalized given timespan using years, months and days.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeAxis<CalendarUnit,ThaiSolarCalendar> |
ThaiSolarCalendar.axis()
Returns the associated time axis.
|
static TimeAxis<CalendarUnit,MinguoCalendar> |
MinguoCalendar.axis()
Returns the associated time axis.
|
static TimeAxis<CalendarUnit,JucheCalendar> |
JucheCalendar.axis()
Returns the associated time axis.
|
| Modifier and Type | Field and Description |
|---|---|
static Years<CalendarUnit> |
Years.ONE
Constant for exactly one gregorian year.
|
static Years<CalendarUnit> |
Years.ZERO
Constant for zero gregorian years.
|
| Modifier and Type | Method and Description |
|---|---|
static <T extends TimePoint<? super CalendarUnit,T>> |
Years.between(T t1,
T t2)
Determines the temporal distance between given dates/time-points in gregorian years.
|
static <T extends TimePoint<? super CalendarUnit,T>> |
Weeks.between(T t1,
T t2)
Determines the temporal distance between given dates/time-points in weeks.
|
static <T extends TimePoint<? super CalendarUnit,T>> |
Quarters.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>> |
Months.between(T t1,
T t2)
Determines the temporal distance between given dates/time-points in gregorian months.
|
| Modifier and Type | Method and Description |
|---|---|
static 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.between(T t1,
T t2)
Determines the temporal distance between given dates/time-points in gregorian years.
|
Duration<CalendarUnit> |
DateInterval.getDuration(CalendarUnit... units)
Yields the length of this interval in given calendrical units.
|
Duration<CalendarUnit> |
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.
|
| Modifier and Type | Method and Description |
|---|---|
Duration<CalendarUnit> |
DateInterval.getDuration(CalendarUnit... units)
Yields the length of this interval in given calendrical units.
|
| Modifier and Type | Method and Description |
|---|---|
CalendarYear |
CalendarYear.minus(Years<CalendarUnit> years)
Subtracts given years from this year.
|
CalendarQuarter |
CalendarQuarter.minus(Years<CalendarUnit> years)
Subtracts given years from this quarter year.
|
CalendarMonth |
CalendarMonth.minus(Years<CalendarUnit> years)
Subtracts given years from this calendar month.
|
CalendarYear |
CalendarYear.plus(Years<CalendarUnit> years)
Adds given years to this year.
|
CalendarQuarter |
CalendarQuarter.plus(Years<CalendarUnit> years)
Adds given years to this quarter year.
|
CalendarMonth |
CalendarMonth.plus(Years<CalendarUnit> years)
Adds given years to this calendar month.
|
Stream<PlainDate> |
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.
|
static Stream<PlainDate> |
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.
|
Copyright © 2014–2021. All rights reserved.