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