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>
MICROSECOND
static TransformedUnit<javax.measure.quantity.Time>
MILLISECOND
static TransformedUnit<javax.measure.quantity.Time>
NANOSECOND
-
Constructor Summary
Constructors Modifier Constructor Description private
TimeQuantities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TemporalQuantity
getQuantity(java.lang.Integer number, java.time.temporal.TemporalUnit temporalUnit)
static TimeUnitQuantity
getQuantity(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 theQuantity
based in the difference of the twoLocalTime
static javax.measure.Quantity<javax.measure.quantity.Time>
getQuantity(java.time.LocalTime localTimeA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
Creates theQuantity
based in theTemporal
withSupplier
static javax.measure.Quantity<javax.measure.quantity.Time>
getQuantity(java.time.temporal.Temporal temporalA, java.time.temporal.Temporal temporalB)
Creates theQuantity
based in the difference of the twoTemporal
static javax.measure.Quantity<javax.measure.quantity.Time>
getQuantity(java.time.temporal.Temporal temporalA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
Creates theQuantity
based in theTemporal
withTemporalAdjuster
static TemporalQuantity
toTemporalSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
static TimeUnitQuantity
toTimeUnitSeconds(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 theQuantity
based 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 theQuantity
based 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 theQuantity
based in theTemporal
withTemporalAdjuster
- 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 theQuantity
based in theTemporal
withSupplier
- 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
TimeUnitQuantity
converted 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
TemporalQuantity
converted be quantity in seconds.
-
-