| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| 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)
Normalized 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.
|
Duration<U> |
Duration.Formatter.parse(CharSequence text)
Equivalent to
parse(text, 0). |
Duration<U> |
Duration.Formatter.parse(CharSequence text,
int offset)
Analyzes given text according to format pattern and parses the
text to a duration.
|
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.
|
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<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<? super U,T>> |
Duration.comparator(T base)
Creates a
Comparator which compares durations based on
their lengths. |
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<CalendarUnit,Duration<CalendarUnit>> |
Duration.inYearsMonthsDays()
Constructs a metric in years, months and days.
|
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 |
Duration.Formatter.format(Duration<?> duration)
Creates a textual output of given duration.
|
String |
PrettyTime.print(Duration<?> duration)
Formats the total given duration.
|
void |
Duration.Formatter.print(Duration<?> duration,
Appendable buffer)
Creates a textual output of given duration and writes to
the buffer.
|
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.
|
Copyright © 2014–2015. All rights reserved.