Package tech.units.indriya.quantity.time
Class TimeQuantities
java.lang.Object
tech.units.indriya.quantity.time.TimeQuantities
- Since:
- 1.0
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javax.measure.Unit
<javax.measure.quantity.Time> static final TransformedUnit
<javax.measure.quantity.Time> static final TransformedUnit
<javax.measure.quantity.Time> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TemporalQuantity
getQuantity
(Integer number, TemporalUnit temporalUnit) static TimeUnitQuantity
getQuantity
(Integer number, TimeUnit timeUnit) static javax.measure.Quantity
<javax.measure.quantity.Time> getQuantity
(LocalTime localTimeA, LocalTime localTimeB) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
based in the difference of the twoLocalTime
static javax.measure.Quantity
<javax.measure.quantity.Time> getQuantity
(LocalTime localTimeA, Supplier<TemporalAdjuster> supplier) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
based in theTemporal
withSupplier<TemporalAdjuster>
static javax.measure.Quantity
<javax.measure.quantity.Time> getQuantity
(Temporal temporalA, Temporal temporalB) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
based in the difference of the twoTemporal
static javax.measure.Quantity
<javax.measure.quantity.Time> getQuantity
(Temporal temporalA, Supplier<TemporalAdjuster> supplier) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
based in theTemporal
withTemporalAdjuster
static TemporalQuantity
toTemporalSeconds
(javax.measure.Quantity<javax.measure.quantity.Time> quantity) Creates aTemporalQuantity
based ajavax.measure.Quantity<javax.measure.quantity.Time>
converted toUnits.SECOND
.static TimeUnitQuantity
toTimeUnitSeconds
(javax.measure.Quantity<javax.measure.quantity.Time> quantity) Creates aTimeUnitQuantity
based ajavax.measure.Quantity<javax.measure.quantity.Time>
converted toUnits.SECOND
.
-
Field Details
-
MICROSECOND
public static final javax.measure.Unit<javax.measure.quantity.Time> MICROSECOND -
MILLISECOND
-
NANOSECOND
-
-
Constructor Details
-
TimeQuantities
private TimeQuantities()
-
-
Method Details
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(Temporal temporalA, Temporal temporalB) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
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:
UnsupportedTemporalTypeException
- if some temporal doesn't supportChronoUnit.DAYS
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(LocalTime localTimeA, LocalTime localTimeB) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
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:
UnsupportedTemporalTypeException
- if some temporal doesn't supportChronoUnit.DAYS
-
getQuantity
public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(Temporal temporalA, Supplier<TemporalAdjuster> supplier) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
based in theTemporal
withTemporalAdjuster
- 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 javax.measure.Quantity<javax.measure.quantity.Time> getQuantity(LocalTime localTimeA, Supplier<TemporalAdjuster> supplier) Creates thejavax.measure.Quantity<javax.measure.quantity.Time>
based in theTemporal
withSupplier<TemporalAdjuster>
- 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
- Parameters:
timeUnit
- - time to be usedvalue
- - value to be used
-
getQuantity
- Parameters:
value
- - value to be usedtimeUnit
- - time to be used
-
toTimeUnitSeconds
public static TimeUnitQuantity toTimeUnitSeconds(javax.measure.Quantity<javax.measure.quantity.Time> quantity) Creates aTimeUnitQuantity
based ajavax.measure.Quantity<javax.measure.quantity.Time>
converted toUnits.SECOND
.- 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) Creates aTemporalQuantity
based ajavax.measure.Quantity<javax.measure.quantity.Time>
converted toUnits.SECOND
.- Parameters:
quantity
- - quantity to be used- Returns:
- the
TemporalQuantity
converted be quantity in seconds.
-