| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.range |
Interval support.
|
| Modifier and Type | Field and Description |
|---|---|
static TemporalType<Duration,Duration<ClockUnit>> |
TemporalType.THREETEN_DURATION
Bridge between the JSR-310-class
java.time.Duration and
the class net.time4j.Duration. |
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 |
|---|---|
Duration<U> |
Duration.abs()
Gets the absolute always non-negative copy of this duration.
|
Duration<IsoUnit> |
Duration.Builder.build()
Creates a new duration conforming to ISO-8601.
|
static Duration<IsoUnit> |
Duration.compose(Duration<CalendarUnit> calendarPeriod,
Duration<ClockUnit> clockPeriod)
Creates a composition of a calendar period and a clock period.
|
static Duration<ClockUnit> |
Duration.from(Duration threetenDuration)
Short cut for
TemporalType.THREETEN_DURATION.translate(threetenDuration). |
static Duration<CalendarUnit> |
Duration.from(Period threetenPeriod)
Short cut for
TemporalType.THREETEN_PERIOD.translate(threetenPeriod). |
static Duration<IsoUnit> |
Duration.from(TemporalAmount threeten)
Tries to convert given temporal amount to a duration.
|
Duration<U> |
Duration.inverse()
Gets a copy of this duration with reversed sign.
|
Duration<U> |
Duration.multipliedBy(int factor)
Multiplies all partial amounts of this duration by given factor.
|
Duration<CalendarUnit> |
PlainDate.normalize(TimeSpan<? extends CalendarUnit> timespan)
Normalized given timespan using years, months and days.
|
Duration<IsoUnit> |
PlainTimestamp.normalize(TimeSpan<? extends IsoUnit> timespan)
Normalizes given timespan using years, months, days and
all clock units.
|
static <U extends IsoUnit> |
Duration.of(long amount,
U unit)
Creates a new duration which only knows one unit.
|
static Duration<CalendarUnit> |
Duration.ofCalendarUnits(int years,
int months,
int days)
Creates a positive duration in years, months and days.
|
static Duration<ClockUnit> |
Duration.ofClockUnits(int hours,
int minutes,
int seconds)
Creates a positive duratioon in hours, minutes and seconds.
|
static <U extends IsoUnit> |
Duration.ofZero()
Gets an empty duration without units.
|
static Duration<CalendarUnit> |
Duration.parseCalendarPeriod(String period)
Parses a canonical representation with only date units to a
calendrical duration.
|
static Duration<ClockUnit> |
Duration.parseClockPeriod(String period)
Parses a canonical representation with only wall time units to a
time-only duration.
|
static Duration<IsoUnit> |
Duration.parsePeriod(String period)
Parses a canonical representation to a duration.
|
static Duration<IsoDateUnit> |
Duration.parseWeekBasedPeriod(String period)
Parses a canonical representation with only week-based units (Y, W and D) to a
calendrical duration where years are interpreted as week-based years with either 364 days
(= 52 weeks) or 371 days (= 53 weeks).
|
Duration<U> |
Duration.plus(long amount,
U unit)
Gets a copy of this duration where given amount will be added
to the partial amount of this duration in given unit.
|
Duration<U> |
Duration.plus(TimeSpan<? extends U> timespan)
Creates a duration as union of this instance and given timespan
where partial amounts of equal units will be summed up.
|
Duration<CalendarUnit> |
Duration.toCalendarPeriod()
Extracts a new duration with all contained calendar units only.
|
Duration<ClockUnit> |
Duration.toClockPeriod()
Extracts a new duration with all contained clock units only.
|
Duration<ClockUnit> |
Duration.toClockPeriodWithDaysAs24Hours()
Extracts a new duration with all contained clock units only.
|
Duration<U> |
Duration.truncatedTo(U unit)
Sets all duration parts to zero whose unit has a smaller length than given unit.
|
Duration<U> |
Duration.with(long amount,
U unit)
Gets a copy of this duration where the partial amount associated
with given time unit is changed.
|
Duration<U> |
Duration.with(Normalizer<U> normalizer)
Normalizes this duration by given normalizer.
|
| Modifier and Type | Method and Description |
|---|---|
static <U extends IsoUnit,T extends TimePoint<U,T>> |
Duration.comparator(T base)
Creates a
Comparator which compares durations based on
their lengths. |
static Comparator<Duration<ClockUnit>> |
Duration.comparatorOnClock()
Obtains a comparator suitable for Durations based on clock units.
|
static <U extends IsoUnit> |
Duration.in(Collection<? extends U> units)
Constructs a metric for any kind of standard units in normalized form.
|
static TimeMetric<IsoUnit,Duration<IsoUnit>> |
Duration.in(Timezone tz,
IsoUnit... units)
Helps to evaluate the zonal duration between two timestamps
and applies an offset correction if necessary.
|
static <U extends IsoUnit> |
Duration.in(U... units)
Constructs a metric for any kind of standard units in
normalized form.
|
static TimeMetric<ClockUnit,Duration<ClockUnit>> |
Duration.inClockUnits()
Constructs a metric in hours, minutes, seconds and nanoseconds.
|
static TimeMetric<IsoDateUnit,Duration<IsoDateUnit>> |
Duration.inWeekBasedUnits()
Constructs a metric in week-based years, weeks and days.
|
static TimeMetric<CalendarUnit,Duration<CalendarUnit>> |
Duration.inYearsMonthsDays()
Constructs a metric in years, months and days.
|
static <U extends IsoUnit> |
Duration.summingUp()
Helps to sum up durations of a stream.
|
static <U extends IsoUnit> |
Duration.summingUp()
Helps to sum up durations of a stream.
|
List<Duration<U>> |
Duration.union(TimeSpan<? extends U> timespan)
Creates a duration as union of this instance and given timespan
where partial amounts of equal units will be summed up.
|
| 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.
|
static Duration<IsoUnit> |
Duration.compose(Duration<CalendarUnit> calendarPeriod,
Duration<ClockUnit> clockPeriod)
Creates a composition of a calendar period and a clock period.
|
String |
PrettyTime.print(Duration<?> duration)
Formats the total given duration.
|
String |
PrettyTime.print(Duration<?> duration,
TextWidth width)
Formats the total given duration.
|
String |
PrettyTime.print(Duration<?> duration,
TextWidth width,
boolean printZero,
int maxLength)
Formats given duration.
|
| Modifier and Type | Method and Description |
|---|---|
Duration<ClockUnit> |
ClockInterval.getDuration()
Yields the length of this interval.
|
Duration<CalendarUnit> |
DateInterval.getDuration(CalendarUnit... units)
Yields the length of this interval in given calendrical units.
|
Duration<IsoUnit> |
TimestampInterval.getDuration(Timezone tz,
IsoUnit... units)
Yields the length of this interval in given units and applies
a timezone offset correction .
|
<U extends IsoUnit> |
TimestampInterval.getDuration(U... units)
Yields the length of this interval in given units.
|
Duration<CalendarUnit> |
DateInterval.getDurationInYearsMonthsDays()
Yields the length of this interval in years, months and days.
|
Duration<IsoUnit> |
MomentInterval.getNominalDuration(Timezone tz,
IsoUnit... units)
Yields the nominal duration of this interval in given timezone and units.
|
Duration<U> |
SingleUnitTimeSpan.toStdDuration()
Converts this instance to a general duration with the same amount and unit.
|
| Modifier and Type | Method and Description |
|---|---|
static IsoRecurrence<MomentInterval> |
IsoRecurrence.of(int count,
Duration<?> duration,
Moment end,
ZonalOffset offset)
Creates a recurrent backward sequence of moment intervals having given duration.
|
static IsoRecurrence<TimestampInterval> |
IsoRecurrence.of(int count,
Duration<?> duration,
PlainTimestamp end)
Creates a recurrent backward sequence of timestamp intervals having given duration.
|
static IsoRecurrence<DateInterval> |
IsoRecurrence.of(int count,
Duration<? extends IsoDateUnit> duration,
PlainDate end)
Creates a recurrent backward sequence of date intervals having given duration.
|
static IsoRecurrence<MomentInterval> |
IsoRecurrence.of(int count,
Moment start,
Duration<?> duration,
ZonalOffset offset)
Creates a recurrent sequence of moment intervals having given duration.
|
static IsoRecurrence<DateInterval> |
IsoRecurrence.of(int count,
PlainDate start,
Duration<? extends IsoDateUnit> duration)
Creates a recurrent sequence of date intervals having given duration.
|
static IsoRecurrence<TimestampInterval> |
IsoRecurrence.of(int count,
PlainTimestamp start,
Duration<?> duration)
Creates a recurrent sequence of timestamp intervals having given duration.
|
Stream<PlainTimestamp> |
TimestampInterval.stream(Duration<?> duration)
Obtains a stream iterating over every timestamp which is the result of addition of given duration
to start until the end of this interval is reached.
|
static Stream<PlainTimestamp> |
TimestampInterval.stream(Duration<?> duration,
PlainTimestamp start,
PlainTimestamp end)
Obtains a stream iterating over every timestamp which is the result of addition of given duration
to start until the end is reached.
|
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.
|
Stream<PlainTime> |
ClockInterval.stream(Duration<ClockUnit> duration)
Obtains a stream iterating over every clock time which is the result of addition of given duration
to start until the end of this interval is reached.
|
static Stream<PlainTime> |
ClockInterval.stream(Duration<ClockUnit> duration,
PlainTime start,
PlainTime end)
Obtains a stream iterating over every clock time which is the result of addition of given duration
to start until the end is reached.
|
Copyright © 2014–2021. All rights reserved.