Class TimeQuantities


  • public final class TimeQuantities
    extends java.lang.Object
    Since:
    1.0
    Version:
    1.0
    • 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)
      creates the TemporalQuantity using TemporalUnit and Integer
      static TimeUnitQuantity getQuantity​(java.lang.Integer number, java.util.concurrent.TimeUnit timeUnit)
      creates the TimeUnitQuantity using TimeUnit and Integer
      static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity​(java.time.LocalTime localTimeA, java.time.LocalTime localTimeB)
      Creates the Quantity based in the difference of the two LocalTime
      static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity​(java.time.LocalTime localTimeA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
      Creates the Quantity based in the Temporal with Supplier
      static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity​(java.time.temporal.Temporal temporalA, java.time.temporal.Temporal temporalB)
      Creates the Quantity based in the difference of the two Temporal
      static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity​(java.time.temporal.Temporal temporalA, java.util.function.Supplier<java.time.temporal.TemporalAdjuster> supplier)
      Creates the Quantity based in the Temporal with TemporalAdjuster
      static TemporalQuantity toTemporalSeconds​(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
      Creates a TemporalQuantity based a Quantity converted to Units.SECOND.
      static TimeUnitQuantity toTimeUnitSeconds​(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
      Creates a TimeUnitQuantity based a Quantity converted to Units.SECOND.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • TimeQuantities

        private TimeQuantities()
    • Method Detail

      • getQuantity

        public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity​(java.time.temporal.Temporal temporalA,
                                                                                      java.time.temporal.Temporal temporalB)
        Creates the Quantity based in the difference of the two Temporal
        Parameters:
        temporalA - - First parameter to range, inclusive
        temporalB - - second parameter to range, exclusive
        Returns:
        the Quantity difference based in Units.DAY.
        Throws:
        java.time.temporal.UnsupportedTemporalTypeException - if some temporal doesn't support ChronoUnit.DAYS
      • getQuantity

        public static javax.measure.Quantity<javax.measure.quantity.Time> getQuantity​(java.time.LocalTime localTimeA,
                                                                                      java.time.LocalTime localTimeB)
        Creates the Quantity based in the difference of the two LocalTime
        Parameters:
        localTimeA - - First parameter to range, inclusive
        localTimeB - - second parameter to range, exclusive
        Returns:
        the Quantity difference based in Units.HOUR.
        Throws:
        java.time.temporal.UnsupportedTemporalTypeException - if some temporal doesn't support ChronoUnit.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 the Quantity based in the Temporal with TemporalAdjuster
        Parameters:
        temporalA - - temporal
        supplier - the adjust @see TemporalAdjuster
        Returns:
        The Quantity based in Temporal with TemporalAdjuster in Units.DAY.
        Throws:
        java.time.temporal.UnsupportedTemporalTypeException - if some temporal doesn't support ChronoUnit.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 the Quantity based in the Temporal with Supplier
        Parameters:
        localTimeA -
        supplier - he adjust @see TemporalAdjuster
        Returns:
        The Quantity based in Temporal with TemporalAdjuster in Units.DAY.
        Throws:
        java.time.temporal.UnsupportedTemporalTypeException - if some temporal doesn't support ChronoUnit.DAYS
      • getQuantity

        public static TimeUnitQuantity getQuantity​(java.lang.Integer number,
                                                   java.util.concurrent.TimeUnit timeUnit)
        creates the TimeUnitQuantity using TimeUnit and Integer
        Parameters:
        value - - value to be used
        timeUnit - - time to be used
      • getQuantity

        public static TemporalQuantity getQuantity​(java.lang.Integer number,
                                                   java.time.temporal.TemporalUnit temporalUnit)
        creates the TemporalQuantity using TemporalUnit and Integer
        Parameters:
        value - - value to be used
        timeUnit - - time to be used
      • toTimeUnitSeconds

        public static TimeUnitQuantity toTimeUnitSeconds​(javax.measure.Quantity<javax.measure.quantity.Time> quantity)
        Creates a TimeUnitQuantity based a Quantity converted to Units.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 a TemporalQuantity based a Quantity converted to Units.SECOND.
        Parameters:
        quantity - - quantity to be used
        Returns:
        the TemporalQuantity converted be quantity in seconds.