Package tech.units.indriya.quantity.time
Class TimeQuantities
- java.lang.Object
-
- tech.units.indriya.quantity.time.TimeQuantities
-
public final class TimeQuantities extends java.lang.Object- Since:
- 1.0
- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static javax.measure.Unit<javax.measure.quantity.Time>MICROSECONDstatic TransformedUnit<javax.measure.quantity.Time>MILLISECONDstatic TransformedUnit<javax.measure.quantity.Time>NANOSECOND
-
Constructor Summary
Constructors Modifier Constructor Description privateTimeQuantities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TemporalQuantitygetQuantity(java.lang.Integer number, java.time.temporal.TemporalUnit temporalUnit)static TimeUnitQuantitygetQuantity(java.lang.Integer number, java.util.concurrent.TimeUnit timeUnit)static javax.measure.Quantity<javax.measure.quantity.Time>getQuantity(java.time.LocalTime localTimeA, java.time.LocalTime localTimeB)Creates theQuantitybased in the difference of the twoLocalTimestatic javax.measure.Quantity<javax.measure.quantity.Time>getQuantity(java.time.LocalTime localTimeA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)Creates theQuantitybased in theTemporalwithSupplierstatic javax.measure.Quantity<javax.measure.quantity.Time>getQuantity(java.time.temporal.Temporal temporalA, java.time.temporal.Temporal temporalB)Creates theQuantitybased in the difference of the twoTemporalstatic javax.measure.Quantity<javax.measure.quantity.Time>getQuantity(java.time.temporal.Temporal temporalA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)Creates theQuantitybased in theTemporalwithTemporalAdjusterstatic TemporalQuantitytoTemporalSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)static TimeUnitQuantitytoTimeUnitSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
-
-
-
Field Detail
-
MICROSECOND
public static final javax.measure.Unit<javax.measure.quantity.Time> MICROSECOND
-
MILLISECOND
public static final TransformedUnit<javax.measure.quantity.Time> MILLISECOND
-
NANOSECOND
public static final TransformedUnit<javax.measure.quantity.Time> NANOSECOND
-
-
Method Detail
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.temporal.Temporal temporalA, java.time.temporal.Temporal temporalB)Creates theQuantitybased in the difference of the twoTemporal- Parameters:
temporalA- - First parameter to range, inclusivetemporalB- - second parameter to range, exclusive- Returns:
- the Quantity difference based in
Units.DAY. - Throws:
java.time.temporal.UnsupportedTemporalTypeException- if some temporal doesn't supportChronoUnit.DAYS
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.LocalTime localTimeA, java.time.LocalTime localTimeB)Creates theQuantitybased in the difference of the twoLocalTime- Parameters:
localTimeA- - First parameter to range, inclusivelocalTimeB- - second parameter to range, exclusive- Returns:
- the Quantity difference based in
Units.HOUR. - Throws:
java.time.temporal.UnsupportedTemporalTypeException- if some temporal doesn't supportChronoUnit.DAYS
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.temporal.Temporal temporalA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)Creates theQuantitybased in theTemporalwithTemporalAdjuster- Parameters:
temporalA- - temporalsupplier- the adjust @seeTemporalAdjuster- Returns:
- The Quantity based in Temporal with TemporalAdjuster in
Units.DAY. - Throws:
java.time.temporal.UnsupportedTemporalTypeException- if some temporal doesn't supportChronoUnit.DAYS
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(java.time.LocalTime localTimeA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)Creates theQuantitybased in theTemporalwithSupplier- Parameters:
localTimeA-supplier- he adjust @seeTemporalAdjuster- Returns:
- The Quantity based in Temporal with TemporalAdjuster in
Units.DAY. - Throws:
java.time.temporal.UnsupportedTemporalTypeException- if some temporal doesn't supportChronoUnit.DAYS
-
getQuantity
public static TimeUnitQuantity getQuantity(java.lang.Integer number, java.util.concurrent.TimeUnit timeUnit)
- Parameters:
value- - value to be usedtimeUnit- - time to be used
-
getQuantity
public static TemporalQuantity getQuantity(java.lang.Integer number, java.time.temporal.TemporalUnit temporalUnit)
- Parameters:
value- - value to be usedtimeUnit- - time to be used
-
toTimeUnitSeconds
public static TimeUnitQuantity toTimeUnitSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
- Parameters:
quantity- - quantity to be used- Returns:
- the
TimeUnitQuantityconverted be quantity in seconds.
-
toTemporalSeconds
public static TemporalQuantity toTemporalSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
- Parameters:
quantity- - quantity to be used- Returns:
- the
TemporalQuantityconverted be quantity in seconds.
-
-