public final class TimeUnit extends AbstractPrimaryUnit<Time,TimeUnit> implements java.time.temporal.TemporalUnit
TimeUnit
are a factor of one second.
Atomic clocks, which keep time using transition energies in atoms, revolutionised timekeeping. NPL developed the
first operational caesium-beam atomic clock in 1955. This clock was so accurate that it would only gain or lose one
second in three hundred years. Modern atomic clocks can be as much as a million times more accurate than this, and
underpin satellite technology, like GPS or the internet.
(ref. npl.co.uk)ComparableUsing.EqualityMode, ComparableUsing.Operator
Modifier and Type | Field and Description |
---|---|
static TimeUnit |
BASE |
static TimeUnit |
Century |
static TimeUnit |
Day |
static TimeUnit |
Decade |
static TimeUnit |
Era |
static TimeUnit |
Femto |
static TimeUnit |
Hour |
static TimeUnit |
Micro |
static TimeUnit |
Millennium |
static TimeUnit |
Milli |
static TimeUnit |
Minute |
static TimeUnit |
Month |
static TimeUnit |
Nano |
static TimeUnit |
Pico |
static TimeUnit |
Planck |
static TimeUnit |
Second |
static TimeUnit |
TrMonth |
static TimeUnit |
TrYear |
static TimeUnit |
Week |
static TimeUnit |
Year |
Modifier and Type | Method and Description |
---|---|
<R extends java.time.temporal.Temporal> |
addTo(R temporal,
long amount) |
long |
between(java.time.temporal.Temporal temporal1Inclusive,
java.time.temporal.Temporal temporal2Exclusive) |
static TimeUnit |
get(Rational secondFactor,
java.time.Duration duration,
boolean fuzzyDuration,
boolean isDateBased,
java.lang.String name,
java.lang.String symbol)
Get or create a unit based on the
secondFactor , which is a factor of the duration of one second. |
java.time.Duration |
getDuration() |
Rational |
getSeconds() |
boolean |
isDateBased() |
boolean |
isDurationEstimated() |
boolean |
isTimeBased() |
Time |
makeDimension(java.lang.Number amount) |
VelocityUnit |
times(AccelerationUnit acc) |
ChargeUnit |
times(CurrentUnit current) |
MomentumUnit |
times(ForceUnit force) |
AngleUnit |
times(FrequencyUnit frequency) |
EnergyUnit |
times(PowerUnit power) |
LengthUnit |
times(VelocityUnit v) |
equals, from, getName, getSymbol, hashCode, toBaseUnits, toNumber
clone, finalize, getClass, jailbreak, notify, notifyAll, toString, wait, wait, wait
compareTo, copy, fromNumber, getFullName, getFullSymbol, postfixBind
div, div, minus, plus, rem, rem, times, toBaseNumber, unaryMinus
compareToUsing, equalityMode
public static final TimeUnit Femto
public static final TimeUnit Pico
public static final TimeUnit Nano
public static final TimeUnit Micro
public static final TimeUnit Milli
public static final TimeUnit Second
public static final TimeUnit Minute
public static final TimeUnit Hour
public static final TimeUnit Day
public static final TimeUnit Week
public static final TimeUnit Month
public static final TimeUnit Year
public static final TimeUnit Decade
public static final TimeUnit Century
public static final TimeUnit Millennium
public static final TimeUnit Era
public static final TimeUnit TrMonth
public static final TimeUnit TrYear
public static final TimeUnit Planck
public static final TimeUnit BASE
public static TimeUnit get(Rational secondFactor, java.time.Duration duration, boolean fuzzyDuration, boolean isDateBased, java.lang.String name, java.lang.String symbol)
secondFactor
, which is a factor of the duration of one second. The
specified unit is cached and will be returned for subsequent calls to this method if the secondFactor
matches.
secondFactor
- A factor of the duration of one second expressed as a Rational
duration
- A factor of the duration of one second expressed as a Duration
(for compatibility with java.time
).fuzzyDuration
- true
if the duration
is possibly inexact.isDateBased
- true
if the duration
is date oriented i.e., is a function of non-constant spatial properties related to a calendar.name
- The standard full name of the unit e.g., "Hour".symbol
- The standard symbol used for the unit e.g., "hr".public Time makeDimension(java.lang.Number amount)
makeDimension
in interface Unit<Time,TimeUnit>
public Rational getSeconds()
public java.time.Duration getDuration()
getDuration
in interface java.time.temporal.TemporalUnit
public boolean isDurationEstimated()
isDurationEstimated
in interface java.time.temporal.TemporalUnit
public boolean isDateBased()
isDateBased
in interface java.time.temporal.TemporalUnit
public boolean isTimeBased()
isTimeBased
in interface java.time.temporal.TemporalUnit
public <R extends java.time.temporal.Temporal> R addTo(R temporal, long amount)
addTo
in interface java.time.temporal.TemporalUnit
public long between(java.time.temporal.Temporal temporal1Inclusive, java.time.temporal.Temporal temporal2Exclusive)
between
in interface java.time.temporal.TemporalUnit
public LengthUnit times(VelocityUnit v)
public VelocityUnit times(AccelerationUnit acc)
public ChargeUnit times(CurrentUnit current)
public AngleUnit times(FrequencyUnit frequency)
public EnergyUnit times(PowerUnit power)
public MomentumUnit times(ForceUnit force)
Copyright © 2021. All rights reserved.