Class FloatDuration

All Implemented Interfaces:
Serializable, Cloneable, Comparable<FloatDuration>, Scalar<DurationUnit,​FloatDuration>, Scalar.Rel<DurationUnit,​FloatDuration>, Scalar.RelWithAbs<TimeUnit,​FloatTime,​DurationUnit,​FloatDuration>, ValueFunctions<DurationUnit,​FloatDuration>, Relative<DurationUnit,​FloatDuration>, Value<DurationUnit,​FloatDuration>, FloatScalarInterface<DurationUnit,​FloatDuration>, FloatScalarInterface.Rel<DurationUnit,​FloatDuration>, FloatScalarInterface.RelWithAbs<TimeUnit,​FloatTime,​DurationUnit,​FloatDuration>

@Generated(value="org.djunits.generator.GenerateDJUNIT",
           date="2020-01-19T15:21:24.964166400Z")
public class FloatDuration
extends AbstractFloatScalarRelWithAbs<TimeUnit,​FloatTime,​DurationUnit,​FloatDuration>
Easy access methods for the FloatDuration FloatScalar.

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • FloatDuration

      public FloatDuration​(float value, DurationUnit unit)
      Construct FloatDuration scalar.
      Parameters:
      value - float; the float value
      unit - DurationUnit; unit for the float value
    • FloatDuration

      public FloatDuration​(FloatDuration value)
      Construct FloatDuration scalar.
      Parameters:
      value - FloatDuration; Scalar from which to construct this instance
    • FloatDuration

      public FloatDuration​(double value, DurationUnit unit)
      Construct FloatDuration scalar using a double value.
      Parameters:
      value - double; the double value
      unit - DurationUnit; unit for the resulting float value
  • Method Details

    • instantiateRel

      public final FloatDuration instantiateRel​(float value, DurationUnit unit)
      Construct a new Relative Immutable FloatScalar of the right type. Each extending class must implement this method.
      Parameters:
      value - float; the float value
      unit - RU; the unit
      Returns:
      R a new relative instance of the FloatScalar of the right type
    • instantiateSI

      public static final FloatDuration instantiateSI​(float value)
      Construct FloatDuration scalar.
      Parameters:
      value - float; the float value in SI units
      Returns:
      FloatDuration; the new scalar with the SI value
    • instantiateAbs

      public final FloatTime instantiateAbs​(float value, TimeUnit unit)
      Construct a new Absolute Immutable FloatScalar of the right type. Each extending class must implement this method.
      Parameters:
      value - float; the float value
      unit - AU; the absolute unit
      Returns:
      A a new absolute instance of the FloatScalar of the right type
    • interpolate

      public static FloatDuration interpolate​(FloatDuration zero, FloatDuration one, float ratio)
      Interpolate between two values.
      Parameters:
      zero - FloatDuration; the low value
      one - FloatDuration; the high value
      ratio - double; the ratio between 0 and 1, inclusive
      Returns:
      FloatDuration; a Scalar at the ratio between
    • max

      public static FloatDuration max​(FloatDuration r1, FloatDuration r2)
      Return the maximum value of two relative scalars.
      Parameters:
      r1 - FloatDuration; the first scalar
      r2 - FloatDuration; the second scalar
      Returns:
      FloatDuration; the maximum value of two relative scalars
    • max

      public static FloatDuration max​(FloatDuration r1, FloatDuration r2, FloatDuration... rn)
      Return the maximum value of more than two relative scalars.
      Parameters:
      r1 - FloatDuration; the first scalar
      r2 - FloatDuration; the second scalar
      rn - FloatDuration...; the other scalars
      Returns:
      FloatDuration; the maximum value of more than two relative scalars
    • min

      public static FloatDuration min​(FloatDuration r1, FloatDuration r2)
      Return the minimum value of two relative scalars.
      Parameters:
      r1 - FloatDuration; the first scalar
      r2 - FloatDuration; the second scalar
      Returns:
      FloatDuration; the minimum value of two relative scalars
    • min

      public static FloatDuration min​(FloatDuration r1, FloatDuration r2, FloatDuration... rn)
      Return the minimum value of more than two relative scalars.
      Parameters:
      r1 - FloatDuration; the first scalar
      r2 - FloatDuration; the second scalar
      rn - FloatDuration...; the other scalars
      Returns:
      FloatDuration; the minimum value of more than two relative scalars
    • valueOf

      public static FloatDuration valueOf​(String text)
      Returns a FloatDuration representation of a textual representation of a value with a unit. The String representation that can be parsed is the double value in the unit, followed by the official abbreviation of the unit. Spaces are allowed, but not required, between the value and the unit.
      Parameters:
      text - String; the textual representation to parse into a FloatDuration
      Returns:
      FloatDuration; the Scalar representation of the value in its unit
      Throws:
      IllegalArgumentException - when the text cannot be parsed
      NullPointerException - when the text argument is null
    • of

      public static FloatDuration of​(float value, String unitString)
      Returns a FloatDuration based on a value and the textual representation of the unit.
      Parameters:
      value - double; the value to use
      unitString - String; the textual representation of the unit
      Returns:
      FloatDuration; the Scalar representation of the value in its unit
      Throws:
      IllegalArgumentException - when the unit cannot be parsed or is incorrect
      NullPointerException - when the unitString argument is null
    • divide

      public final FloatDimensionless divide​(FloatDuration v)
      Calculate the division of FloatDuration and FloatDuration, which results in a FloatDimensionless scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatDimensionless scalar as a division of FloatDuration and FloatDuration
    • times

      public final FloatDimensionless times​(FloatFrequency v)
      Calculate the multiplication of FloatDuration and FloatFrequency, which results in a FloatDimensionless scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatDimensionless scalar as a multiplication of FloatDuration and FloatFrequency
    • times

      public final FloatElectricalCharge times​(FloatElectricalCurrent v)
      Calculate the multiplication of FloatDuration and FloatElectricalCurrent, which results in a FloatElectricalCharge scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatElectricalCharge scalar as a multiplication of FloatDuration and FloatElectricalCurrent
    • times

      public final FloatMass times​(FloatFlowMass v)
      Calculate the multiplication of FloatDuration and FloatFlowMass, which results in a FloatMass scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatMass scalar as a multiplication of FloatDuration and FloatFlowMass
    • times

      public final FloatVolume times​(FloatFlowVolume v)
      Calculate the multiplication of FloatDuration and FloatFlowVolume, which results in a FloatVolume scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatVolume scalar as a multiplication of FloatDuration and FloatFlowVolume
    • times

      public final FloatSpeed times​(FloatAcceleration v)
      Calculate the multiplication of FloatDuration and FloatAcceleration, which results in a FloatSpeed scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatSpeed scalar as a multiplication of FloatDuration and FloatAcceleration
    • times

      public final FloatEnergy times​(FloatPower v)
      Calculate the multiplication of FloatDuration and FloatPower, which results in a FloatEnergy scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatEnergy scalar as a multiplication of FloatDuration and FloatPower
    • times

      public final FloatLength times​(FloatSpeed v)
      Calculate the multiplication of FloatDuration and FloatSpeed, which results in a FloatLength scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatLength scalar as a multiplication of FloatDuration and FloatSpeed
    • times

      public final FloatMagneticFlux times​(FloatElectricalPotential v)
      Calculate the multiplication of FloatDuration and FloatElectricalPotential, which results in a FloatMagneticFlux scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatMagneticFlux scalar as a multiplication of FloatDuration and FloatElectricalPotential
    • times

      Calculate the multiplication of FloatDuration and FloatElectricalResistance, which results in a FloatElectricalInductance scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatElectricalInductance scalar as a multiplication of FloatDuration and FloatElectricalResistance
    • times

      Calculate the multiplication of FloatDuration and FloatElectricalConductance, which results in a FloatElectricalCapacitance scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatElectricalCapacitance scalar as a multiplication of FloatDuration and FloatElectricalConductance
    • times

      public final FloatAngle times​(FloatAngularVelocity v)
      Calculate the multiplication of FloatDuration and FloatAngularVelocity, which results in a FloatAngle scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatAngle scalar as a multiplication of FloatDuration and FloatAngularVelocity
    • times

      Calculate the multiplication of FloatDuration and FloatAngularAcceleration, which results in a FloatAngularVelocity scalar.
      Parameters:
      v - FloatDuration scalar
      Returns:
      FloatAngularVelocity scalar as a multiplication of FloatDuration and FloatAngularAcceleration