Class L_Register

  • All Implemented Interfaces:
    IClear, IL_Register

    public final class L_Register
    extends Object
    implements IL_Register
    L-Register need addition information to convert in-fix to post-fix. Note that Internally all calculators are UPN calculators.
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Field Detail

      • Logger

        private static final Logger Logger

        Class logger instance.

      • Negative_Display_Precision

        private static final int Negative_Display_Precision
        Minus 2 for the dot and the negative sign max negative precision.
        See Also:
        Constant Field Values
      • Small_Display_Precision

        private static final int Small_Display_Precision
        i.E. 0.001 is displayed as 1.*10³
        See Also:
        Constant Field Values
      • TAG

        private static final String TAG
        Class logger tag.
      • Ten_Power

        private static final int @NotNull [] Ten_Power
        powers of 10 needed to move the decimal point for Format_Engineering.
      • Operation_Constant

        static final int Operation_Constant
        Level 7: constant operation stored
        See Also:
        Constant Field Values
      • Operation_Division

        static final int Operation_Division
        Level 3: Operation division
        See Also:
        Constant Field Values
      • Operation_Equal

        static final int Operation_Equal
        Level 6: Equal operation finish all calculations on stack
        See Also:
        Constant Field Values
      • Operation_Minus

        static final int Operation_Minus
        Level 4: Operation minus
        See Also:
        Constant Field Values
      • Operation_Multiplication

        static final int Operation_Multiplication
        Level 3: Operation multiplication
        See Also:
        Constant Field Values
      • Operation_Nop

        static final int Operation_Nop
        Level 7: no operation stored
        See Also:
        Constant Field Values
      • Operation_P_Close

        static final int Operation_P_Close
        Level 5: Close operation finish all calculations on stack ()
        See Also:
        Constant Field Values
      • Operation_P_Open

        static final int Operation_P_Open
        Level 0: Operation ) of
        See Also:
        Constant Field Values
      • Operation_P_To_R

        static final int Operation_P_To_R
        Level 1: Operation Polar to Rectangular
        See Also:
        Constant Field Values
      • Operation_Percent

        static final int Operation_Percent
        Level 6: Operation % of
        See Also:
        Constant Field Values
      • Max_Exponent

        public static final int Max_Exponent
        Maximum supported Exponent + 1
      • Operation_Plus

        static final int Operation_Plus
        Level 4: Operation plus
        See Also:
        Constant Field Values
      • Operation_Power

        static final int Operation_Power
        Level 2: Operation Power of
        See Also:
        Constant Field Values
      • Operation_R_To_P

        static final int Operation_R_To_P
        Level 1: Operation Rectangular to Polar
        See Also:
        Constant Field Values
      • Operation_Root

        static final int Operation_Root
        Level 2: Operation Root of
        See Also:
        Constant Field Values
      • Positive_Display_Precision

        static final int Positive_Display_Precision
        Minus 1 for the dot gives max positive precision.
        See Also:
        Constant Field Values
      • Operation

        private int Operation
        Operation requested after this number was entered.
      • Parenthesis

        private int Parenthesis
        Parenthesis opened before this number was entered - max is 3.
      • Value

        @NotNull
        private Number Value
        Value of the register.
    • Constructor Detail

      • L_Register

        public L_Register()
        Assign one L-Register to another one
    • Method Detail

      • Format

        public static short @NotNull [] Format​(@NotNull
                                               Number Value)
        Format Value in standard format
        Parameters:
        Value - value to format
        Returns:
        Formatted string
      • Format_Engineering

        public static short @NotNull [] Format_Engineering​(@NotNull
                                                           Number Value,
                                                           @Nullable
                                                           @Nullable Integer Offset)
        Format Value in standard format
        Parameters:
        Value - value to format
        Offset - Eng offset null no offset, 0 same 3 divisor, 1 next larger 3 divisor, -1 next smaller 3 divisor
        Returns:
        Formatted string
      • Format_Fixed

        static short @NotNull [] Format_Fixed​(@NotNull
                                              @NotNull BCDFloat Value,
                                              int Digits)
        Format Value in standard format
        Parameters:
        Value - value to format
        Digits - digits after the .
        Returns:
        Formatted string
      • Format_Print

        public static short @NotNull [] Format_Print​(@NotNull
                                                     Number Value)
        Format Value in standard format
        Parameters:
        Value - value to format
        Returns:
        Formatted string
      • Format_Round

        static short @NotNull [] Format_Round​(@NotNull
                                              Number Value,
                                              int Digits)
        Format Value in standard format
        Parameters:
        Value - value to format
        Digits - Digits to display
        Returns:
        Formatted string
      • Assign

        void Assign​(@NotNull
                    @NotNull L_Register Right)
        Assign one L-Register to another one
        Parameters:
        Right - Value to assign
      • Assign

        public void Assign​(@NotNull
                           IL_Register Right)
        Assign one L-Register to another one
        Specified by:
        Assign in interface IL_Register
        Parameters:
        Right - Value to assign
      • Clear

        public void Clear​(boolean AC)
        Clear content of Register
        Specified by:
        Clear in interface IClear
        Parameters:
        AC - true when AC (all clear) is requested.
        See Also:
        IClear.Clear(boolean)
      • Dec_Parenthesis

        void Dec_Parenthesis()
        Decrement parenthesis level (+-×÷ ... )
      • Format

        public final short @NotNull [] Format()
        Format in standard format.
        Specified by:
        Format in interface IL_Register
        Returns:
        Formatted string
      • Format_Print

        public final short @NotNull [] Format_Print()
        Format in printer format
        Specified by:
        Format_Print in interface IL_Register
        Returns:
        Formatted string
      • Inc_Parenthesis

        public void Inc_Parenthesis()
        Increment parenthesis level (+-×÷ ... )
        Specified by:
        Inc_Parenthesis in interface IL_Register
      • Operation

        int Operation()
        Get operation (+-×÷ ... )
        Returns:
        current operation
      • Operation

        public void Operation​(int Operation)
        Set operation (+-×÷ ... )
        Parameters:
        Operation - Mathematical operation
      • Parenthesis

        public int Parenthesis()
        Get parenthesis level (+-×÷ ... )
        Specified by:
        Parenthesis in interface IL_Register
        Returns:
        parenthesis level (0 ... 3)
      • Parenthesis

        public void Parenthesis​(int Parenthesis)
        Set parenthesis level (+-×÷ ... )
        Specified by:
        Parenthesis in interface IL_Register
        Parameters:
        Parenthesis - level (0 ... 3)
      • Set_NaN

        public void Set_NaN()
        Set value of the register to NaN
        Specified by:
        Set_NaN in interface IL_Register
      • Set_Value

        void Set_Value​(@NotNull
                       @org.jetbrains.annotations.NotNull short @NotNull [] Text)
                throws Error
        Set_Value of the register.
        Parameters:
        Text - text with new value
        Throws:
        Error - value out of range
      • Value

        @NotNull
        public final Number Value()
        Temp_Value of the register.
        Specified by:
        Value in interface IL_Register
        Returns:
        current value
      • Value

        public void Value​(@NotNull
                          Number Value)
                   throws Error
        Set value of the register.
        Specified by:
        Value in interface IL_Register
        Parameters:
        Value - Value to set.
        Throws:
        Error - number is large or NaN not a value executable for the FX-602P Simulator
      • toString

        @NotNull
        @TestOnly
        public @NotNull String toString()
        Overrides:
        toString in class Object