public final class TimeQuantities extends Object
Modifier and Type | Field and 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 and Description |
---|---|
static TemporalQuantity |
getQuantity(Integer number,
java.time.temporal.TemporalUnit temporalUnit)
|
static TimeUnitQuantity |
getQuantity(Integer number,
TimeUnit timeUnit)
|
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(java.time.LocalTime localTimeA,
java.time.LocalTime localTimeB)
Creates the
Quantity based in the difference of the two LocalTime |
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(java.time.LocalTime localTimeA,
java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
Creates the
Quantity based in the Temporal with Supplier |
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(java.time.temporal.Temporal temporalA,
java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
Creates the
Quantity based in the Temporal with TemporalAdjuster |
static javax.measure.Quantity<javax.measure.quantity.Time> |
getQuantity(java.time.temporal.Temporal temporalA,
java.time.temporal.Temporal temporalB)
Creates the
Quantity based in the difference of the two Temporal |
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(java.time.temporal.Temporal temporalA, java.time.temporal.Temporal temporalB)
Quantity
based in the difference of the two Temporal
temporalA
- - First parameter to range, inclusivetemporalB
- - second parameter to range, exclusiveUnits#DAY
.java.time.temporal.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.LocalTime localTimeA, java.time.LocalTime localTimeB)
Quantity
based in the difference of the two LocalTime
localTimeA
- - First parameter to range, inclusivelocalTimeB
- - second parameter to range, exclusiveUnits#HOUR
.java.time.temporal.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.temporal.Temporal temporalA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
Quantity
based in the Temporal
with TemporalAdjuster
temporalA
- - temporalsupplier
- the adjust @see TemporalAdjuster
Units#DAY
.java.time.temporal.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.LocalTime localTimeA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
Quantity
based in the Temporal
with Supplier
localTimeA
- supplier
- he adjust @see TemporalAdjuster
Units#DAY
.java.time.temporal.UnsupportedTemporalTypeException
- if some temporal doesn't support ChronoUnit.DAYS
LocalTime}
public static TimeUnitQuantity getQuantity(Integer number, TimeUnit timeUnit)
value
- - value to be usedtimeUnit
- - time to be usedpublic static TemporalQuantity getQuantity(Integer number, java.time.temporal.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-2018 Units of Measurement project. All Rights Reserved.