Class AbstractDoubleScalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>

    • Field Detail

      • si

        public final double si
        The value, stored in the standard SI unit.
    • Constructor Detail

      • AbstractDoubleScalar

        AbstractDoubleScalar​(U unit,
                             double si)
        Construct a new AbstractDoubleScalar.
        Parameters:
        unit - U; the unit
        si - double; the si value to store
    • Method Detail

      • getInUnit

        public final double getInUnit​(U targetUnit)
        Retrieve the value converted into some specified unit.
        Specified by:
        getInUnit in interface DoubleScalarInterface<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        targetUnit - U; the unit to convert the value into
        Returns:
        double
      • lt

        public final boolean lt​(S o)
        Test if this DoubleScalar is less than another DoubleScalar.
        Specified by:
        lt in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        o - T, a relative typed DoubleScalar; the right hand side operand of the comparison
        Returns:
        boolean; true if this is less than other; false if this is not less than other
      • le

        public final boolean le​(S o)
        Test if this DoubleScalar is less than or equal to another DoubleScalar.
        Specified by:
        le in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        o - T, a relative typed DoubleScalar; the right hand side operand of the comparison
        Returns:
        boolean
      • gt

        public final boolean gt​(S o)
        Test if this DoubleScalar is greater than or equal to a DoubleScalar.
        Specified by:
        gt in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        o - T, a relative typed DoubleScalar; the right hand side operand of the comparison
        Returns:
        boolean; true if this is greater than or equal to other; false if this is not greater than or equal to other
      • ge

        public final boolean ge​(S o)
        Test if this DoubleScalar is greater than a DoubleScalar.
        Specified by:
        ge in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        o - T, a relative typed DoubleScalar; the right hand side operand of the comparison
        Returns:
        boolean; true if this is greater than other; false if this is not greater than other
      • eq

        public final boolean eq​(S o)
        Test if this DoubleScalar is equal to a DoubleScalar.
        Specified by:
        eq in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        o - T, a relative typed DoubleScalar; the right hand side operand of the comparison
        Returns:
        boolean; true if this is equal to other; false if this is not equal to other
      • ne

        public final boolean ne​(S o)
        Test if this DoubleScalar is not equal to a DoubleScalar.
        Specified by:
        ne in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        o - T, a relative typed DoubleScalar; the right hand side operand of the comparison
        Returns:
        boolean; true if this is not equal to other; false if this is equal to other
      • lt0

        public final boolean lt0()
        Test if this DoubleScalar is less than 0.0.
        Specified by:
        lt0 in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        boolean; true if this is less than 0.0; false if this is not less than 0.0
      • le0

        public final boolean le0()
        Test if this DoubleScalar is less than or equal to 0.0.
        Specified by:
        le0 in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        boolean; true if this is less than or equal to 0.0; false if this is not less than or equal to 0.0
      • gt0

        public final boolean gt0()
        Test if this DoubleScalar is greater than or equal to 0.0.
        Specified by:
        gt0 in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        boolean; true if this is greater than or equal to 0.0; false if this is not greater than or equal to 0.0
      • ge0

        public final boolean ge0()
        Test if this DoubleScalar is greater than 0.0.
        Specified by:
        ge0 in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        boolean; true if this is greater than 0.0; false if this is not greater than 0.0
      • eq0

        public final boolean eq0()
        Test if this DoubleScalar is equal to 0.0.
        Specified by:
        eq0 in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        boolean; true if this is equal to 0.0; false if this is not equal to 0.0
      • ne0

        public final boolean ne0()
        Test if this DoubleScalar is not equal to 0.0.
        Specified by:
        ne0 in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        boolean; true if this is not equal to 0.0; false if this is equal to 0.0
      • intValue

        public int intValue()
        Specified by:
        intValue in class Number
      • longValue

        public long longValue()
        Specified by:
        longValue in class Number
      • floatValue

        public float floatValue()
        Specified by:
        floatValue in class Number
      • doubleValue

        public double doubleValue()
        Specified by:
        doubleValue in class Number
      • toString

        public String toString​(U displayUnit)
        Somewhat verbose description of this value with the values expressed in the specified unit.
        Specified by:
        toString in interface Value<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        displayUnit - U; the unit into which the values are converted for display
        Returns:
        String; printable string with the value contents expressed in the specified unit
      • toString

        public String toString​(boolean verbose,
                               boolean withUnit)
        Somewhat verbose description of this value with optional type and unit information.
        Specified by:
        toString in interface Value<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        verbose - boolean; if true; include type info; if false; exclude type info
        withUnit - boolean; if true; include the unit; of false; exclude the unit
        Returns:
        String; printable string with the value contents
      • toString

        public String toString​(U displayUnit,
                               boolean verbose,
                               boolean withUnit)
        Somewhat verbose description of this value with the values expressed in the specified unit.
        Specified by:
        toString in interface Value<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        displayUnit - U; the unit into which the values are converted for display
        verbose - boolean; if true; include type info; if false; exclude type info
        withUnit - boolean; if true; include the unit; of false; exclude the unit
        Returns:
        String; printable string with the value contents
      • toStringSIPrefixed

        public String toStringSIPrefixed()
        Format this AbstractDoubleScalar in SI unit using prefixes when possible. If the value is too small or too large, e-notation and the plain SI unit are used.
        Returns:
        String; formatted value of this AbstractDoubleScalar
      • toStringSIPrefixed

        public String toStringSIPrefixed​(int smallestPower,
                                         int biggestPower)
        Format this AbstractDoubleScalar in SI unit using prefixes when possible and within the specified size range. If the value is too small or too large, e-notation and the plain SI unit are used.
        Parameters:
        smallestPower - int; the smallest exponent value that will be written using an SI prefix
        biggestPower - int; the largest exponent value that will be written using an SI prefix
        Returns:
        String; formatted value of this AbstractDoubleScalar
      • toTextualString

        public String toTextualString()
        Concise textual representation of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.
        Specified by:
        toTextualString in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        a String with the value with the default textual representation of the unit attached.
      • toTextualString

        public String toTextualString​(U displayUnit)
        Concise textual representation of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.
        Specified by:
        toTextualString in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        displayUnit - U; the display unit for the value
        Returns:
        a String with the value with the default textual representation of the provided unit attached.
      • toDisplayString

        public String toDisplayString()
        Concise display description of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.
        Specified by:
        toDisplayString in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Returns:
        a String with the value with the default display representation of the unit attached.
      • toDisplayString

        public String toDisplayString​(U displayUnit)
        Concise display description of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.
        Specified by:
        toDisplayString in interface Scalar<U extends Unit<U>,​S extends AbstractDoubleScalar<U,​S>>
        Parameters:
        displayUnit - U; the display unit for the value
        Returns:
        a String with the value with the default display representation of the provided unit attached.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object