public final class TimeQuantities extends Object
Modifier and Type | Field | Description |
---|---|---|
static javax.measure.Unit<javax.measure.quantity.Time> |
MICROSECOND |
|
static TransformedUnit<javax.measure.quantity.Time> |
MILLISECOND |
|
static TransformedUnit<javax.measure.quantity.Time> |
NANOSECOND |
Modifier and Type | Method | Description |
---|---|---|
static TemporalQuantity |
getQuantity(Long number,
TemporalUnit temporalUnit) |
|
static TimeUnitQuantity |
getQuantity(Long number,
TimeUnit timeUnit) |
|
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(LocalTime localTimeA,
LocalTime localTimeB) |
Creates the
Quantity based in the difference of the two
LocalTime |
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(LocalTime localTimeA,
Supplier<TemporalAdjuster> supplier) |
|
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(Temporal temporalA,
Temporal temporalB) |
Creates the
Quantity based in the difference of the two
Temporal |
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(Temporal temporalA,
Supplier<TemporalAdjuster> supplier) |
|
static TemporalQuantity |
toTemporalSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity) |
|
static TimeUnitQuantity |
toTimeUnitSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity) |
public static final javax.measure.Unit<javax.measure.quantity.Time> MICROSECOND
public static final TransformedUnit<javax.measure.quantity.Time> MILLISECOND
public static final TransformedUnit<javax.measure.quantity.Time> NANOSECOND
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(Temporal temporalA, Temporal temporalB)
Quantity
based in the difference of the two
Temporal
temporalA
- - First parameter to range, inclusivetemporalB
- - second parameter to range, exclusiveUnits.DAY
.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(LocalTime localTimeA, LocalTime localTimeB)
Quantity
based in the difference of the two
LocalTime
localTimeA
- - First parameter to range, inclusivelocalTimeB
- - second parameter to range, exclusiveUnits.HOUR
.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(Temporal temporalA, Supplier<TemporalAdjuster> supplier)
temporalA
- - temporalsupplier
- the adjust @see TemporalAdjuster
Units.DAY
.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(LocalTime localTimeA, Supplier<TemporalAdjuster> supplier)
localTimeA
- supplier
- he adjust @see TemporalAdjuster
Units.DAY
.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static TimeUnitQuantity getQuantity(Long number, TimeUnit timeUnit)
value
- - value to be usedtimeUnit
- - time to be usedpublic static TemporalQuantity getQuantity(Long number, TemporalUnit temporalUnit)
value
- - value to be usedtimeUnit
- - time to be usedpublic static TimeUnitQuantity toTimeUnitSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
quantity
- - quantity to be usedTimeUnitQuantity
converted be quantity in seconds.public static TemporalQuantity toTemporalSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
quantity
- - quantity to be usedTemporalQuantity
converted be quantity in seconds.Copyright © 2005–2020 Units of Measurement project. All rights reserved.