Top Fields Constructors Methods
tech.units.indriya.quantity.time

public final Class TimeQuantities

extends Object
Class Inheritance
Static Imports
tech.units.indriya.unit.Units.DAY, .Units.HOUR, .Units.SECOND

Authors
Otavio, Werner, Andi Huber
Since
1.0
Version
1.1

Field Summary

Modifier and TypeField and Description
public static final Unit<Time>
public static final TransformedUnit<Time>
public static final TransformedUnit<Time>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Quantity<Time>

Returns:

the Quantity difference based in Units#DAY.
getQuantity
(Temporal
- First parameter to range, inclusive
temporalA
,
Temporal
- second parameter to range, exclusive
temporalB
)

Creates the Quantity<Time> based in the difference of the two Temporal

public static Quantity<Time>

Returns:

the Quantity difference based in Units#HOUR.
getQuantity
(LocalTime
- First parameter to range, inclusive
localTimeA
,
LocalTime
- second parameter to range, exclusive
localTimeB
)

Creates the Quantity<Time> based in the difference of the two LocalTime

public static Quantity<Time>

Returns:

The Quantity based in Temporal with TemporalAdjuster in Units#DAY.
getQuantity
(Temporal
- temporal
temporalA
,
Supplier<TemporalAdjuster>
the adjust @see TemporalAdjuster
supplier
)

Creates the Quantity<Time> based in the Temporal with TemporalAdjuster

public static Quantity<Time>

Returns:

The Quantity based in Temporal with TemporalAdjuster in Units#DAY.
getQuantity
(LocalTime localTimeA, Supplier<TemporalAdjuster>
he adjust @see TemporalAdjuster
supplier
)

Creates the Quantity<Time> based in the Temporal with Supplier<TemporalAdjuster>

public static TimeUnitQuantity
getQuantity(Long number, TimeUnit
- time to be used
timeUnit
)

creates the TimeUnitQuantity using TimeUnit and Integer

public static TemporalQuantity
getQuantity(Long number, TemporalUnit temporalUnit)

creates the TemporalQuantity using TemporalUnit and Long

public static TemporalQuantity

Returns:

the TemporalQuantity converted be quantity in seconds.
toTemporalSeconds
(Quantity<Time>
- quantity to be used
quantity
)

Creates a TemporalQuantity based a Quantity<Time> converted to Units#SECOND.

public static TimeUnitQuantity

Returns:

the TimeUnitQuantity converted be quantity in seconds.
toTimeUnitSeconds
(Quantity<Time>
- quantity to be used
quantity
)

Creates a TimeUnitQuantity based a Quantity<Time> converted to Units#SECOND.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MICROSECONDback to summary
public static final Unit<Time> MICROSECOND
MILLISECONDback to summary
public static final TransformedUnit<Time> MILLISECOND
NANOSECONDback to summary
public static final TransformedUnit<Time> NANOSECOND

Constructor Detail

TimeQuantitiesback to summary
private TimeQuantities()

Method Detail

getQuantityback to summary
public static Quantity<Time> getQuantity(Temporal temporalA, Temporal temporalB)

Creates the Quantity<Time> based in the difference of the two Temporal

Parameters
temporalA:Temporal

- First parameter to range, inclusive

temporalB:Temporal

- second parameter to range, exclusive

Returns:Quantity<Time>

the Quantity difference based in Units#DAY.

Exceptions
UnsupportedTemporalTypeException:
if some temporal doesn't support ChronoUnit#DAYS
getQuantityback to summary
public static Quantity<Time> getQuantity(LocalTime localTimeA, LocalTime localTimeB)

Creates the Quantity<Time> based in the difference of the two LocalTime

Parameters
localTimeA:LocalTime

- First parameter to range, inclusive

localTimeB:LocalTime

- second parameter to range, exclusive

Returns:Quantity<Time>

the Quantity difference based in Units#HOUR.

Exceptions
UnsupportedTemporalTypeException:
if some temporal doesn't support ChronoUnit#DAYS
getQuantityback to summary
public static Quantity<Time> getQuantity(Temporal temporalA, Supplier<TemporalAdjuster> supplier)

Creates the Quantity<Time> based in the Temporal with TemporalAdjuster

Parameters
temporalA:Temporal

- temporal

supplier:Supplier<TemporalAdjuster>

the adjust @see TemporalAdjuster

Returns:Quantity<Time>

The Quantity based in Temporal with TemporalAdjuster in Units#DAY.

Exceptions
UnsupportedTemporalTypeException:
if some temporal doesn't support ChronoUnit#DAYS
getQuantityback to summary
public static Quantity<Time> getQuantity(LocalTime localTimeA, Supplier<TemporalAdjuster> supplier)

Creates the Quantity<Time> based in the Temporal with Supplier<TemporalAdjuster>

Parameters
supplier:Supplier<TemporalAdjuster>

he adjust @see TemporalAdjuster

Returns:Quantity<Time>

The Quantity based in Temporal with TemporalAdjuster in Units#DAY.

Exceptions
UnsupportedTemporalTypeException:
if some temporal doesn't support ChronoUnit#DAYS
See Also
LocalTime
getQuantityback to summary
public static TimeUnitQuantity getQuantity(Long number, TimeUnit timeUnit)

creates the TimeUnitQuantity using TimeUnit and Integer

Parameters
timeUnit:TimeUnit

- time to be used

getQuantityback to summary
public static TemporalQuantity getQuantity(Long number, TemporalUnit temporalUnit)

creates the TemporalQuantity using TemporalUnit and Long

toTemporalSecondsback to summary
public static TemporalQuantity toTemporalSeconds(Quantity<Time> quantity)

Creates a TemporalQuantity based a Quantity<Time> converted to Units#SECOND.

Parameters
quantity:Quantity<Time>

- quantity to be used

Returns:TemporalQuantity

the TemporalQuantity converted be quantity in seconds.

toTimeUnitSecondsback to summary
public static TimeUnitQuantity toTimeUnitSeconds(Quantity<Time> quantity)

Creates a TimeUnitQuantity based a Quantity<Time> converted to Units#SECOND.

Parameters
quantity:Quantity<Time>

- quantity to be used

Returns:TimeUnitQuantity

the TimeUnitQuantity converted be quantity in seconds.