Interface Unit

    • Method Detail

      • getName

        java.lang.String getName()
                          throws java.rmi.RemoteException
        Returns the name of this unit.
        Returns:
        name of this unit
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setName

        void setName​(java.lang.String name)
              throws ApiException,
                     java.rmi.RemoteException
        Set the name of this unit.
        Parameters:
        name - to be set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable, the given name has illegal characters or a unit with the same name or symbol already exists
      • getSymbol

        java.lang.String getSymbol()
                            throws java.rmi.RemoteException
        Returns the units symbol.
        Returns:
        symbol of this unit
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setSymbol

        void setSymbol​(java.lang.String symbol)
                throws ApiException,
                       java.rmi.RemoteException
        Set the symbol of this unit.
        Parameters:
        symbol - to be set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable, the given symbol has illegal characters or a unit with the same name or symbol already exists
      • getOffset

        double getOffset()
                  throws java.rmi.RemoteException
        Returns the offset of this unit
        Returns:
        unit offset
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setOffset

        void setOffset​(double offset)
                throws ApiException,
                       java.rmi.RemoteException
        Set the offset of this unit.
        Parameters:
        offset - to be set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getNominator

        @Deprecated
        int getNominator()
                  throws java.rmi.RemoteException
        Deprecated.
        Use getNumerator() instead. Will be removed in TPT 17.
        Returns the numerator of this units factor.
        Returns:
        numerator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setNominator

        @Deprecated
        void setNominator​(int numerator)
                   throws ApiException,
                          java.rmi.RemoteException
        Deprecated.
        Use setNumerator(int) instead. Will be removed in TPT 17.
        Set the numerator of this units factor.
        Parameters:
        numerator - to be set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getNumerator

        int getNumerator()
                  throws java.rmi.RemoteException
        Returns the numerator of this units factor.
        Returns:
        numerator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setNumerator

        void setNumerator​(int numerator)
                   throws ApiException,
                          java.rmi.RemoteException
        Set the numerator of this units factor.
        Parameters:
        numerator - to be set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getDenomintaor

        @Deprecated
        int getDenomintaor()
                    throws java.rmi.RemoteException
        Deprecated.
        Use getDenominator() instead. Will be removed in TPT-18.
        Returns the denominator of this units factor.
        Returns:
        denominator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getDenominator

        int getDenominator()
                    throws java.rmi.RemoteException
        Returns the denominator of this units factor.
        Returns:
        denominator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setDenominator

        void setDenominator​(int denominator)
                     throws ApiException,
                            java.rmi.RemoteException
        Set the denominator of this units factor.
        Parameters:
        denominator - to be set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getDecimalExponent

        int getDecimalExponent()
                        throws java.rmi.RemoteException
        Returns the power of ten of this units factor.
        Returns:
        decimal exponent for numerator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setDecimalExponent

        void setDecimalExponent​(int exponent)
                         throws ApiException,
                                java.rmi.RemoteException
        Set the exponent to the base of ten of this units factor
        Parameters:
        exponent - to be set
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getBinaryExponent

        int getBinaryExponent()
                       throws java.rmi.RemoteException
        Returns the power of two of this units factor.
        Returns:
        binary exponent for numerator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setBinaryExponent

        void setBinaryExponent​(int exponent)
                        throws ApiException,
                               java.rmi.RemoteException
        Set the exponent to the base of two of this units factor
        Parameters:
        exponent - to be set
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getPiExponent

        int getPiExponent()
                   throws java.rmi.RemoteException
        Returns the power of π of this units factor.
        Returns:
        PI exponent for numerator
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setPiExponent

        void setPiExponent​(int exponent)
                    throws ApiException,
                           java.rmi.RemoteException
        Set the exponent to the base of π of this units factor
        Parameters:
        exponent - to be set
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if unit is not editable
      • getDependencies

        java.util.Map<Unit,​java.lang.Short> getDependencies()
                                                           throws java.rmi.RemoteException
        Returns the units dependencies. To remove a dependency to an other unit set its exponent to 0.
        Returns:
        map of all base unit dependencies
        Throws:
        java.rmi.RemoteException - remote communication problem
        See Also:
        setDependency(Unit, short)
      • setDependency

        void setDependency​(Unit unit,
                           short exponent)
                    throws ApiException,
                           java.rmi.RemoteException
        Set the dependency of this unit to the given unit by defining an exponent. To remove a dependency set the exponent to 0.
        Parameters:
        unit - The unit this unit shall get a dependency to.
        exponent - The exponent of the dependency
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - if this unit is not editable, if the other unit is not a base unit.
      • isEditable

        boolean isEditable()
                    throws java.rmi.RemoteException
        Returns true if this unit is editable, false otherwise.
        Returns:
        true if this unit is editable
        Throws:
        java.rmi.RemoteException - remote communication problem
      • isBaseUnit

        boolean isBaseUnit()
                    throws java.rmi.RemoteException
        Returns true if this unit has no dependencies to other units, false otherwise.
        Returns:
        true if this unit has no dependencies to other units
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setFactor

        void setFactor​(int numerator,
                       int denominator,
                       int decimalExponent,
                       int binaryExponent,
                       int piExponent)
                throws ApiException,
                       java.rmi.RemoteException
        Sets the wholefactor of the Unit.
        Parameters:
        numerator - to be set.
        denominator - to be set.
        decimalExponent - to be set.
        binaryExponent - to be set.
        piExponent - to be set.
        Throws:
        ApiException - if unit is not editable
        java.rmi.RemoteException - remote communication problem