| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.format.expert |
This package contains the expert-level format- and parse engine of Time4J.
|
| net.time4j.range |
Interval support.
|
| Modifier and Type | Field and Description |
|---|---|
static ChronoElement<ClockUnit> |
PlainTime.PRECISION
Defines the precision as the smallest non-zero time element and
truncates time parts of higher precision if necessary.
|
static Normalizer<ClockUnit> |
Duration.STD_CLOCK_PERIOD
Normalizes the wall time items of a duration on the base
1 day = 24 hours und 1 hour = 60 minutes and
1 minute = 60 seconds. |
static TemporalType<Duration,Duration<ClockUnit>> |
TemporalType.THREETEN_DURATION
Bridge between the JSR-310-class
java.time.Duration and
the class net.time4j.Duration. |
| Modifier and Type | Method and Description |
|---|---|
<T extends TimePoint<? super ClockUnit,T>> |
ClockUnit.between(T start,
T end)
Calculates the temporal distance between given wall times
in this unit.
|
| Modifier and Type | Method and Description |
|---|---|
static ClockUnit |
ClockUnit.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClockUnit[] |
ClockUnit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static Comparator<Duration<ClockUnit>> |
Duration.comparatorOnClock()
Obtains a comparator suitable for Durations based on clock units.
|
static Duration<ClockUnit> |
Duration.from(Duration threetenDuration)
Short cut for
TemporalType.THREETEN_DURATION.translate(threetenDuration). |
static TimeMetric<ClockUnit,Duration<ClockUnit>> |
Duration.inClockUnits()
Constructs a metric in hours, minutes, seconds and nanoseconds.
|
static TimeMetric<ClockUnit,Duration<ClockUnit>> |
Duration.inClockUnits()
Constructs a metric in hours, minutes, seconds and nanoseconds.
|
static Duration<ClockUnit> |
Duration.ofClockUnits(int hours,
int minutes,
int seconds)
Creates a positive duratioon in hours, minutes and seconds.
|
Normalizer<ClockUnit> |
ClockUnit.only()
Yields a normalizer which converts a given duration in another
duration with only this clock unit.
|
static Duration<ClockUnit> |
Duration.parseClockPeriod(String period)
Parses a canonical representation with only wall time units to a
time-only duration.
|
Normalizer<ClockUnit> |
ClockUnit.rounded()
Yields a normalizer which converts a given duration in another
normalized duration with smaller units truncated and this unit rounded.
|
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.
|
Normalizer<ClockUnit> |
ClockUnit.truncated()
Yields a normalizer which converts a given duration in another
duration with smaller units truncated.
|
| Modifier and Type | Method and Description |
|---|---|
long |
ClockUnit.convert(long sourceDuration,
ClockUnit sourceUnit)
Converts the given duration to a temporal amount measured in
this unit.
|
PlainTimestamp |
PlainTimestamp.minus(long amount,
ClockUnit unit)
Subtracts given amount in units from this timestamp and yields the result of subtraction.
|
PlainTime |
PlainTime.minus(long amount,
ClockUnit unit)
Subtracts given amount in units from this clock time and yields the result of subtraction.
|
GeneralTimestamp<C> |
GeneralTimestamp.minus(long amount,
ClockUnit unit)
Subtracts given count of days from this general timestamp and return the result.
|
PlainTimestamp |
PlainTimestamp.plus(long amount,
ClockUnit unit)
Adds given amount in units to this timestamp and yields the result of addition.
|
PlainTime |
PlainTime.plus(long amount,
ClockUnit unit)
Adds given amount in units to this clock time and yields the result of addition.
|
GeneralTimestamp<C> |
GeneralTimestamp.plus(long amount,
ClockUnit unit)
Adds given count of clock units to this general timestamp and return the result.
|
String |
PrettyTime.print(long amount,
ClockUnit unit,
TextWidth width)
Formats given duration in clock units.
|
DayCycles |
PlainTime.roll(long amount,
ClockUnit unit)
Rolls this time by the given duration (as amount and unit) and
also counts possible day overflow.
|
PrettyTime |
PrettyTime.withEmptyUnit(ClockUnit 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.
|
long |
ClockUnit.convert(TimeSpan<? extends ClockUnit> duration)
Converts the given duration to an amount in this unit and performs
any necessary truncation if needed.
|
| Modifier and Type | Method and Description |
|---|---|
static ChronoPrinter<PlainTime> |
Iso8601Format.ofBasicTime(IsoDecimalStyle decimalStyle,
ClockUnit precision)
Obtains a printer with given decimal style for printing a clock time
in basic format "HHmm[ss[,SSSSSSSSS]]".
|
static ChronoPrinter<PlainTime> |
Iso8601Format.ofExtendedTime(IsoDecimalStyle decimalStyle,
ClockUnit precision)
Obtains a printer with given decimal style for printing a clock time
in extended format "HH:mm[:ss[,SSSSSSSSS]]".
|
static ChronoPrinter<Moment> |
Iso8601Format.ofMoment(IsoDateStyle dateStyle,
IsoDecimalStyle decimalStyle,
ClockUnit precision,
ZonalOffset offset)
Obtains a printer with given styles for printing a moment.
|
static ChronoPrinter<PlainTimestamp> |
Iso8601Format.ofTimestamp(IsoDateStyle dateStyle,
IsoDecimalStyle decimalStyle,
ClockUnit precision)
Obtains a printer with given styles for printing a timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
Duration<ClockUnit> |
ClockInterval.getDuration()
Yields the length of this interval.
|
| Modifier and Type | Method and Description |
|---|---|
String |
ClockInterval.formatBasicISO(IsoDecimalStyle decimalStyle,
ClockUnit precision)
Prints the canonical form of this interval in given basic ISO-8601 style.
|
String |
ClockInterval.formatExtendedISO(IsoDecimalStyle decimalStyle,
ClockUnit precision)
Prints the canonical form of this interval in given extended ISO-8601 style.
|
String |
TimestampInterval.formatISO(IsoDateStyle dateStyle,
IsoDecimalStyle decimalStyle,
ClockUnit precision,
InfinityStyle infinityStyle)
Prints the canonical form of this interval in given ISO-8601 style.
|
String |
MomentInterval.formatISO(IsoDateStyle dateStyle,
IsoDecimalStyle decimalStyle,
ClockUnit precision,
ZonalOffset offset,
InfinityStyle infinityStyle)
Prints the canonical form of this interval in given ISO-8601 style.
|
String |
TimestampInterval.formatReduced(IsoDateStyle dateStyle,
IsoDecimalStyle decimalStyle,
ClockUnit precision,
InfinityStyle infinityStyle)
Prints the canonical form of this interval in given reduced ISO-8601 style.
|
String |
MomentInterval.formatReduced(IsoDateStyle dateStyle,
IsoDecimalStyle decimalStyle,
ClockUnit precision,
ZonalOffset offset,
InfinityStyle infinityStyle)
Prints the canonical form of this interval in given reduced ISO-8601 style.
|
ClockInterval |
ClockInterval.move(long amount,
ClockUnit unit)
Moves this interval along the time axis by given units.
|
| Modifier and Type | Method and Description |
|---|---|
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.