From 2c146c894972e2c6ab701b3c66dcf242d7be656f Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 24 Dec 2019 16:16:13 -0500 Subject: Added Javadoc to the project. --- doc/org/unitConverter/unit/BaseUnit.html | 452 +++++++++++++++++++++++++++++++ 1 file changed, 452 insertions(+) create mode 100644 doc/org/unitConverter/unit/BaseUnit.html (limited to 'doc/org/unitConverter/unit/BaseUnit.html') diff --git a/doc/org/unitConverter/unit/BaseUnit.html b/doc/org/unitConverter/unit/BaseUnit.html new file mode 100644 index 0000000..56fb19c --- /dev/null +++ b/doc/org/unitConverter/unit/BaseUnit.html @@ -0,0 +1,452 @@ + + + + + +BaseUnit + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.unitConverter.unit
+

Class BaseUnit

+
+
+ +
+
    +
  • +
    +
    +
    public final class BaseUnit
    +extends Unit
    +
    A unit that other units are defined by. +

    + Note that BaseUnits must have names and symbols. This is because they are used for toString code. Therefore, + the Optionals provided by Unit.getPrimaryName() and Unit.getSymbol() will always contain a value.

    +
    +
    Since:
    +
    2019-10-16
    +
    Author:
    +
    Adrien Hopkins
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        valueOf

        +
        public static BaseUnit valueOf(BaseDimension dimension,
        +                               java.lang.String name,
        +                               java.lang.String symbol)
        +
        Gets a base unit from the dimension it measures, its name and its symbol.
        +
        +
        Parameters:
        +
        dimension - dimension measured by this unit
        +
        name - name of unit
        +
        symbol - symbol of unit
        +
        Returns:
        +
        base unit
        +
        Since:
        +
        2019-10-16
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static BaseUnit valueOf(BaseDimension dimension,
        +                               java.lang.String name,
        +                               java.lang.String symbol,
        +                               java.util.Set<java.lang.String> otherNames)
        +
        Gets a base unit from the dimension it measures, its name and its symbol.
        +
        +
        Parameters:
        +
        dimension - dimension measured by this unit
        +
        name - name of unit
        +
        symbol - symbol of unit
        +
        Returns:
        +
        base unit
        +
        Since:
        +
        2019-10-21
        +
        +
      • +
      + + + +
        +
      • +

        asLinearUnit

        +
        public LinearUnit asLinearUnit()
        +
        Returns a LinearUnit with this unit as a base and a conversion factor of 1. This operation must be done + in order to allow units to be created with operations.
        +
        +
        Returns:
        +
        this unit as a LinearUnit
        +
        Since:
        +
        2019-10-16
        +
        +
      • +
      + + + +
        +
      • +

        convertFromBase

        +
        public double convertFromBase(double value)
        +
        Description copied from class: Unit
        +
        Converts from a value expressed in this unit's base unit to a value expressed in this unit. +

        + This must be the inverse of convertToBase, so convertFromBase(convertToBase(value)) must be equal + to value for any value, ignoring precision loss by roundoff error. +

        +

        + If this unit is a base unit, this method should return value. +

        +
        +
        Specified by:
        +
        convertFromBase in class Unit
        +
        Parameters:
        +
        value - value expressed in base unit
        +
        Returns:
        +
        value expressed in this unit
        +
        +
      • +
      + + + +
        +
      • +

        convertToBase

        +
        public double convertToBase(double value)
        +
        Description copied from class: Unit
        +
        Converts from a value expressed in this unit to a value expressed in this unit's base unit. +

        + This must be the inverse of convertFromBase, so convertToBase(convertFromBase(value)) must be + equal to value for any value, ignoring precision loss by roundoff error. +

        +

        + If this unit is a base unit, this method should return value. +

        +
        +
        Specified by:
        +
        convertToBase in class Unit
        +
        Parameters:
        +
        value - value expressed in this unit
        +
        Returns:
        +
        value expressed in base unit
        +
        +
      • +
      + + + +
        +
      • +

        getBaseDimension

        +
        public final BaseDimension getBaseDimension()
        +
        +
        Returns:
        +
        dimension
        +
        Since:
        +
        2019-10-16
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class Unit
        +
        +
      • +
      + + + +
        +
      • +

        withName

        +
        public BaseUnit withName(NameSymbol ns)
        +
        +
        Overrides:
        +
        withName in class Unit
        +
        Parameters:
        +
        ns - name(s) and symbol to use
        +
        Returns:
        +
        a copy of this unit with provided name(s) and symbol
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + -- cgit v1.2.3