Class FloatLength

    • Field Detail

      • ZERO

        public static final FloatLength ZERO
        Constant with value zero.
      • ONE

        public static final FloatLength ONE
        Constant with value one.
      • NaN

        public static final FloatLength NaN
        Constant with value NaN.
      • POSITIVE_INFINITY

        public static final FloatLength POSITIVE_INFINITY
        Constant with value POSITIVE_INFINITY.
      • NEGATIVE_INFINITY

        public static final FloatLength NEGATIVE_INFINITY
        Constant with value NEGATIVE_INFINITY.
      • POS_MAXVALUE

        public static final FloatLength POS_MAXVALUE
        Constant with value MAX_VALUE.
      • NEG_MAXVALUE

        public static final FloatLength NEG_MAXVALUE
        Constant with value -MAX_VALUE.
    • Constructor Detail

      • FloatLength

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

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

        public FloatLength​(double value,
                           LengthUnit unit)
        Construct FloatLength scalar using a double value.
        Parameters:
        value - double; the double value
        unit - LengthUnit; unit for the resulting float value
    • Method Detail

      • instantiateRel

        public final FloatLength instantiateRel​(float value,
                                                LengthUnit 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 FloatLength instantiateSI​(float value)
        Construct FloatLength scalar.
        Parameters:
        value - float; the float value in SI units
        Returns:
        FloatLength; the new scalar with the SI value
      • instantiateAbs

        public final FloatPosition instantiateAbs​(float value,
                                                  PositionUnit 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 FloatLength interpolate​(FloatLength zero,
                                              FloatLength one,
                                              float ratio)
        Interpolate between two values.
        Parameters:
        zero - FloatLength; the low value
        one - FloatLength; the high value
        ratio - double; the ratio between 0 and 1, inclusive
        Returns:
        FloatLength; a Scalar at the ratio between
      • max

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

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

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

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

        public static FloatLength valueOf​(String text)
        Returns a FloatLength 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 FloatLength
        Returns:
        FloatLength; 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 FloatLength of​(float value,
                                     String unitString)
        Returns a FloatLength 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:
        FloatLength; 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​(FloatLength v)
        Calculate the division of FloatLength and FloatLength, which results in a FloatDimensionless scalar.
        Parameters:
        v - FloatLength scalar
        Returns:
        FloatDimensionless scalar as a division of FloatLength and FloatLength
      • times

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

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

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

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

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

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

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

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

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