Class Calculator

  • All Implemented Interfaces:
    Runnable, net.sourceforge.uiq3.calculator.ICalculator, IClear, net.sourceforge.uiq3.IPropertyNotifier
    Direct Known Subclasses:
    Desktop_Calculator

    public abstract class Calculator
    extends Object
    implements net.sourceforge.uiq3.calculator.ICalculator, IClear, net.sourceforge.uiq3.IPropertyNotifier
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Calculator.Token_Plane_Type
      Available Token Planes
      • Nested classes/interfaces inherited from interface net.sourceforge.uiq3.calculator.ICalculator

        net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType, net.sourceforge.uiq3.calculator.ICalculator.Companion, net.sourceforge.uiq3.calculator.ICalculator.DefaultImpls, net.sourceforge.uiq3.calculator.ICalculator.DisplayType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private @NotNull A_Register @NotNull [] A
      The A Register contains the Keyboard_Alpha data of the display.
      private net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A_Active
      Active A register.
      static int A_Size  
      private boolean Calculator_Running
      Calculator is running - needed for power saving.
      private boolean Calculator_Shutdown
      Calculator is not running - needed for end program.
      private short Current_Program
      Current Current_Program
      (package private) static int Display_Alpha
      The Display currently displays the content of an Alpha register.
      (package private) boolean Display_Enable
      Display enable - used to switch off the display so that intermediate result are not shown to the user.
      static String Display_Error
      Error Message displayed on using the wrong display mode!
      private net.sourceforge.uiq3.calculator.ICalculator.DisplayType Display_Mode
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formatted Displays the content of the L0 aka X register inside an alpha
      (package private) static int Execution_Alpha_Pause
      Calculator debugging a program.
      (package private) static int Execution_Clear
      Execution Mode.
      (package private) static String Execution_Error
      Error Message displayed on using the wrong execution mode!
      (package private) static int Execution_Halt
      Calculator debugging a program.
      static int Execution_Interactive
      Calculator is used interactively.
      private int Execution_Mode
      Current Execution mode.
      (package private) static int Execution_One_Step
      Do a single step and return to Execution_Halt.
      (package private) static int Execution_Pause
      final Calculator debugging a program.
      (package private) static int Execution_Running
      Calculator running a program.
      (package private) static int Execution_Write
      Execution Mode.
      (package private) Tape FA2
      A simulated cassette Printer
      (package private) net.sourceforge.uiq3.ui.ICalculatorCanvas Form
      Canvas class where we display our result or get our keycodes
      (package private) Printer FP10
      A simulated Printer Printer
      private int Hlt_Position
      Return Position for HLT Mode.
      (package private) boolean Ignore_Clear
      The last operation was one of the operations (+-) which disable the clear key.
      static int Indicator_Alpha
      Keyboard Mode Alpha: Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe The mode show that the Alpha Keyboard mode is active.
      static int Indicator_Count
      Indicator count: Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode 2, write programms Pcl Mode 3, clear, save, load programs. Deg Mode 4, Tr Rad Mode 5 Gra Mode 6 Keyboard_Alpha Alpha entry and display mofe
      static int Indicator_Deg
      Trigonometric functions in degrees (360° based) Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe
      static int Indicator_Gra
      Trigonometric functions in gradians (400 based) Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe
      static int Indicator_Hlt
      Program halt wait for user response Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe
      static int Indicator_Hyp
      Hyperbolic function active.
      static int Indicator_Inv
      Inverse functions active.
      static int Indicator_K
      Arithmetic with constants.
      static int Indicator_Pcl
      Clear program and memory.
      static int Indicator_Rad
      Trigonometric functions in radians (2π based) Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe
      static int Indicator_Run
      Run and calculation mode.
      static int Indicator_Wrt
      Write Programs Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe
      private boolean @NotNull [] Indicators
      Indicators: Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted programm - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programms Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mofe
      private boolean Indirect
      Currently indirect addressing is active
      (package private) static int Internal_Steps_High
      The memory from 1000 .. 1022 is used internally. 1023 is reserved as stop marker.
      (package private) static int Internal_Steps_Low
      The memory from 1000 .. 1023 is used internally.
      private int IO_Count
      Number of virtual CPU cycles until next IO run.
      private static int IO_Speed
      defines how many steps are executed before the display is updated.
      private int Key_Buffer
      last key pressed
      private boolean Key_Flag
      a key was pressed
      private Keyboard[] Key_Operations
      Operations as they come from the keyboard.
      private long Key_Time
      System time when last Key was clicked.
      static int Keyboard_Alpha
      Keyboard is in alpha mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      (package private) static String Keyboard_Error
      Error Message displayed on using the wrong keyboard mode!
      static int Keyboard_Hyp
      Keyboard is in hyperbolic mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      static int Keyboard_Inv
      Keyboard is in inverse mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      static int Keyboard_Inv_Alpha
      Keyboard is in inverse alpha mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      static int Keyboard_Inv_Hyp
      Keyboard is in inverse hyperbolic mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      static int Keyboard_Normal
      Keyboard is in normal mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      private L_Register[] L
      The L-Register are used for general calculations.
      static String L_CHANGED
      The L or A register where changed.
      static int L_Count  
      (package private) int L_Used
      Amount of L Register used
      static int L_X
      L [0] is also the X register.
      static int L_Y
      L [1] is also the Y register.
      (package private) int Last_Operation
      Last operation choosen by user - used for the K option.
      private static Logger Logger
      Class logger instance.
      private Number[] M
      The M-Register are used for general data storage.
      static String M_CHANGED
      An M or MF register has changed.
      (package private) int M_n
      M [9] is also the statistical register n.
      (package private) int M_Sx
      M [8] is also the statistical register Σx.
      (package private) int M_Sx2
      M [7] is also the statistical register Σx².
      (package private) @Nullable Keyboard Merge_Key
      Key Operations which currently merged to a Calculator operation.
      private IProgrammable_Operation Merge_Token
      Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      @NotNull IProgrammable_Operation @NotNull [] Merged_Operations
      Operations as they executed by the calculator.
      private Number[] MF
      The MF-Register are used for special data storage.
      (package private) static int Null_Return
      The memory from 1000 .. 1022 is used internally. 1023 is reserved as stop marker - which is also used as a null value on the program and hlt stack.
      private static short[] Off_Text
      Text to display when ( is pressed
      private static short[] Parenthesis_Text
      Text to display when ( is pressed
      (package private) int Pause_Repeat  
      private int Program_Counter
      Current Program counter .
      (package private) int @NotNull [] Program_Stack
      Program stack used for GSB commands .
      private int Program_Stack_Pointer
      Program stack poiunter used for GSB commands .
      private int Program_Store
      Where to store the next merged operations.
      private PropertyChangeSupport propertyChangeSupport
      Handle property changes.
      (package private) boolean Realistic_Speed
      Run calculator with realistic speed - just about as fast as the original.
      static short[] Running_Text
      Text to display when ( is pressed
      private net.sourceforge.uiq3.calculator.IService Service
      Canvas class where we display our result or get our keycodes
      static int Stack_Count
      deeps of the program stack.
      static String STATUS_CHANGED
      Program or program counter where changes where changed.
      static String STEP_CHANGED
      Program or program counter where changes where changed.
      (package private) short @NotNull [] Steps
      Calculator Program Memory
      static int Steps_Count
      Amount of Steps.
      private static String TAG
      Class logger tag.
      private Calculator.Token_Plane_Type Token_Plane
      Active plane: 0: Keyboard_Normal 1: Memory + 20, Fix instead of RND 2; Memory + 40 3: Memory + 60 4: Memory + 80
      (package private) static int User_Steps_High
      The memory from 0 .. 998 (999 steps) is available to user programs. 999 is reserved as stop marker
      (package private) static int User_Steps_Low
      The memory from 0 .. 998 (999 steps) is available for user programs.
      • Fields inherited from interface net.sourceforge.uiq3.calculator.ICalculator

        Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      Calculator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      A_Register A​(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Index)  
      net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A_Active()
      Active A register for row.
      void A_Active​(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A)
      Active A register for row.
      private void Add_Debug_Info​(int Position, short[] Text)
      Add debug info.
      private void Add_Steps​(int Steps, short[] Text)
      Add step count to text field
      void addPropertyChangeListener​(@NotNull String propertyName, PropertyChangeListener listener)
      Add a PropertyChangeListener for a specific property.
      void addPropertyChangeListener​(PropertyChangeListener listener)
      Add a PropertyChangeListener to the listener list.
      private void ARegister_Display_Value_Changed​(PropertyChangeEvent event)  
      void Clear​(boolean AC)
      Clean Calculator
      (package private) void Decrement_Program_Store()
      Decrement where to store the next merged operations.
      void Display_A​(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Register_Number)
      Display A register
      void Display_Error​(short @NotNull [] Text)
      Display an error message until C or AC is pressed.
      (package private) void Display_Fatal​(short @NotNull [] Text)
      Display an error message until C or AC is pressed.
      (package private) void Display_Program()
      Display program overview
      void Display_Program_Overview()
      Display program overview
      void Display_Steps()
      Display Program Steps
      void displayClear()
      Clear all alpha register.
      void displayFormatted​(short @NotNull [] text)
      Display value as formatted text
      void displayKey​(short @NotNull [] text)
      * Display Key merge info.
      void displayL()
      Reset current value Display
      void displayMessage​(short @NotNull [] text)
      Display text as message
      private void Error_Reset()
      Brings the calculator into a defined state after an error condition.
      private void Execute_Mode_Pcl()
      Handles the program clear, save and load.
      (package private) void Execute_Mode_Run()
      Handles running the calculator
      private void Execute_Mode_Wrt()
      Handles the programm editing
      Tape FA2()
      A simulated cassette Printer
      (package private) void forceIO​(boolean resetKeyTime)
      Force IO Handling next round.
      void Form​(net.sourceforge.uiq3.ui.ICalculatorCanvas Form)
      Set Canvas to display result read keyboard
      Printer FP10()
      A simulated cassette Printer
      (package private) void Free_Steps​(short[] Text)
      Add total amount of free steps to text;
      (package private) boolean Get_Alpha_Mode()
      Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
      (package private) short Get_Current_Program()  
      private short @NotNull [] Get_Program_Text​(boolean For_Debug)
      Display Program Steps
      net.sourceforge.uiq3.calculator.ICalculator.DisplayType getDisplayMode()
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formatted Displays the content of the L0 aka X register inside an alpha
      int getExecutionMode()
      Execution mode
      int getLastStep()
      locate the last step to display the free steps or for debugging.
      int getStackPointer()
      return current stack pointer
      Number Half_Circle()
      convert an angle to Deg/Rad/Grad
      void Half_Circle​(Number Half_Circle)
      convert an angle to Deg/Rad/Grad
      (package private) void Handle_IO()
      Display result and read keyboard
      private short[] Handle_IO_HLT​(short[] text)
      Handles I/O for HLT and PAUSE mode
      private void Handle_IO_Mode_Pcl()
      Handles the IO in program-clear mode
      private void Handle_IO_Mode_Wrt()
      Handles I/O for program-write mode
      int Hlt_Position()
      Return Position for HLT Mode.
      (package private) void Hlt_Position​(int Hlt_Position)
      Return Position for HLT Mode.
      (package private) void Increment_Hlt_Position()
      Increment Current Program counter.
      (package private) void Increment_Program_Counter()
      Increment Current Program counter.
      (package private) void Increment_Program_Store()
      Increment where to store the next merged operations.
      void Init_A()
      Clears A-register
      void Init_Keycodes()
      Clears internal Memory
      void Init_L()
      Clears L-register
      void Init_M()
      Clears M-register.
      void Init_MF()
      Clears MF-register.
      void Init_Opcodes()
      Sets the opcodes.
      (package private) void Init_Program_Stack()
      init the GSB stack
      void Init_Steps()
      Clears Program Steps
      boolean Is_Alpha​(int Step_Nr)
      check if Step "Nr" is an Alpha character
      boolean Is_Alpha_Mode()
      Alpha Mode?
      boolean Is_Constant_Mode()
      Current mode
      private boolean Is_Executing_Program()
      checks if we are running a program
      (package private) boolean Is_HLT_Pause​(int Step_Nr)
      check if Step "Nr" is an Alpha character
      (package private) boolean Is_Program_Stack_Empty()
      Program stack used for GSB commands .
      (package private) boolean Is_Program_Stack_Full()
      Program stack used for GSB commands .
      boolean Is_Shutdown()
      Calculator is not running - needed for end program.
      boolean isIndirect()  
      boolean isRunning()
      Calculator is running - needed for power saving.
      boolean isWaiting()
      is waiting in interactive mode for user input.
      int Keyboard_Mode()
      Get current Keyboard mode
      (package private) void Keyboard_Mode​(int Keyboard_Mode)
      set input mode
      L_Register L​(int Nr)
      The M-Register are used for general data storage.
      void load​(@NotNull String filename)
      Load the current status of the system
      (package private) void Load_Status()
      Load the current status of the system
      Number M​(int Register)
      The M-Register are used for general data storage.
      void M​(int Register, Number M)
      The M-Register are used for general data storage.
      int M_Length()
      The M-Register are used for general data storage.
      @Nullable Keyboard Merge_Key()
      Key Operations which currently merged to a Calculator operation.
      (package private) void Merge_Key​(@Nullable Keyboard Merge_Key)
      Key Operations which currently merged to a Calculator operation.
      IProgrammable_Operation Merge_Token()
      Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      (package private) void Merge_Token​(IProgrammable_Operation Merge_Token)
      Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      Number MF​(int Register)
      The M-Register are used for general data storage.
      void MF​(int Register, Number MF)
      The M-Register are used for general data storage.
      int MF_Length()
      The M-Register are used for general data storage.
      (package private) void Pop_L()
      Pop values from stack by triggering an calculation run up the the level Operation
      (package private) void Pop_L​(int Operation)
      Pop values from stack by triggering an calculation run up the the level Operation
      (package private) int Pop_Program_Stack()
      Program stack used for GSB commands .
      int Program_Counter()
      Get current Program counter.
      (package private) short Program_Position​(short Program_Token)
      Return step-postion of given program
      int Program_Store()
      get where to store the next merged operations.
      private void Push_L()
      Push stack one down.
      (package private) void Push_L​(int Operation)
      Push value and given operation to stack. depending on what operation is used this might also trigger a calculation run.
      (package private) void Push_Program_Stack​(int Program_Counter)
      Program stack used for GSB commands .
      (package private) void Read_Display​(boolean Is_X_Register)
      Read Steps from Simulated Cassette interface.
      (package private) void Read_M()
      Read M register from file
      (package private) void Read_Steps()
      Read Steps from Simulated Cassette interface.
      void removePropertyChangeListener​(@NotNull String propertyName, PropertyChangeListener listener)
      Remove a PropertyChangeListener for a specific property.
      void removePropertyChangeListener​(PropertyChangeListener listener)
      Remove a PropertyChangeListener from the listener list.
      void reset()
      Total Reset calculator.
      (package private) void Resize_M​(int New_Size)
      Set new size for M-register.
      (package private) void Resize_MF​(int New_Size)
      Set new size for F-register.
      void run()
      Start Calculator
      (package private) void Save_Status()
      Save the current status of the system
      void Service​(net.sourceforge.uiq3.calculator.IService Service)
      Set Canvas to display result read keyboard
      (package private) void Set_Alpha_Mode​(boolean Alpha_Mode)
      Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
      void Set_Constant_Mode​(boolean Constant_Mode)
      Current mode
      (package private) void Set_Current_Program()
      Set Current program to program at program counter
      (package private) void Set_Current_Program​(short Current_Program)  
      (package private) void Set_Program_Counter​(int Program_Counter)
      Set Current Program counter.
      (package private) void Set_Program_Store​(int Program_Store)
      Set where to store the next merged operations.
      void setDisplayMode​(net.sourceforge.uiq3.calculator.ICalculator.DisplayType displayMode)
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formated Displays the content of the L0 aka X register inside an alpha
      (package private) void setExecutionMode​(int Execution_Mode)
      Set new Execution mode
      void setIndirect​(boolean indirect)  
      short Steps​(int Step)
      Calculator Program Memory
      void Steps​(int Step, short Value)
      Calculator Program Memory
      void stop()
      Stop virtual CPU and the thread it runs in
      (package private) void Stop_Execute()
      Stop calculator executing an reset interactive mode.
      (package private) void Store_Operation​(short Operation)
      Store an operation at into calculator memory
      short @Nullable [] Text_To_Display()
      Text to be displayed.
      Calculator.Token_Plane_Type Token_Plane()
      Active plane: 0: Keyboard_Normal 1: Memory + 20, Fix instead of RND 2; Memory + 40 3: Memory + 60 4: Memory + 80
      (package private) void Token_Plane​(Calculator.Token_Plane_Type Token_Plane)
      Active plane: 0: Keyboard_Normal 1: Memory + 20, Fix instead of RND 2; Memory + 40 3: Memory + 60 4: Memory + 80
      @NotNull String toString()  
      (package private) void Write_M()
      Writes memory register to simulated cassette interface.
      (package private) void Write_Steps()
      Writes program steps to simulated cassette interface.
      (package private) boolean Wrt_Is_Alpha​(boolean For_Debug)
      check if - in wrt mode - we are currently in alpha mode.
      • Methods inherited from interface net.sourceforge.uiq3.calculator.ICalculator

        displayException, enableSaveEnergy, getPauseTime, getPauseWait, getRealisticSpeedWait, load, load, resetAll, save, save, save
    • Field Detail

      • IO_Speed

        private static final int IO_Speed

        defines how many steps are executed before the display is updated. Higher values speed up the calculator.

        See Also:
        Constant Field Values
      • STATUS_CHANGED

        public static final String STATUS_CHANGED
        Program or program counter where changes where changed. This flag is used by the debug calculator to notify debug panels.
        See Also:
        Constant Field Values
      • STEP_CHANGED

        public static final String STEP_CHANGED
        Program or program counter where changes where changed. This flag is used by the debug calculator to notify debug panels.
        See Also:
        Constant Field Values
      • M_CHANGED

        public static final String M_CHANGED
        An M or MF register has changed. This flag is used by the debug calculator to notify debug
        See Also:
        Constant Field Values
      • L_CHANGED

        public static final String L_CHANGED
        The L or A register where changed. This flag is used by the debug calculator to notify debug panels.
        See Also:
        Constant Field Values
      • Display_Alpha

        static final int Display_Alpha
        The Display currently displays the content of an Alpha register.
        Display_Alpha
        Displays the content of an Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formated
        Displays the content of the L0 aka X register inside an alpha register.
        See Also:
        Constant Field Values
      • Logger

        private static final Logger Logger

        Class logger instance.

      • Off_Text

        private static final short[] Off_Text
        Text to display when ( is pressed
      • Parenthesis_Text

        private static final short[] Parenthesis_Text
        Text to display when ( is pressed
      • TAG

        private static final String TAG

        Class logger tag.

      • Execution_Alpha_Pause

        static final int Execution_Alpha_Pause
        Calculator debugging a program.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Execution_Clear

        static final int Execution_Clear
        Execution Mode.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write program mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Execution_Error

        static final String Execution_Error
        Error Message displayed on using the wrong execution mode!
        See Also:
        Constant Field Values
      • Execution_Halt

        static final int Execution_Halt
        Calculator debugging a program.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Execution_One_Step

        static final int Execution_One_Step
        Do a single step and return to Execution_Halt.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Execution_Pause

        static final int Execution_Pause
        final Calculator debugging a program.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Execution_Running

        static final int Execution_Running
        Calculator running a program.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Execution_Write

        static final int Execution_Write
        Execution Mode.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Internal_Steps_High

        static final int Internal_Steps_High
        The memory from 1000 .. 1022 is used internally. 1023 is reserved as stop marker.
        See Also:
        Constant Field Values
      • Internal_Steps_Low

        static final int Internal_Steps_Low
        The memory from 1000 .. 1023 is used internally.
        See Also:
        Constant Field Values
      • Keyboard_Error

        static final String Keyboard_Error
        Error Message displayed on using the wrong keyboard mode!
        See Also:
        Constant Field Values
      • Null_Return

        static final int Null_Return
        The memory from 1000 .. 1022 is used internally. 1023 is reserved as stop marker - which is also used as a null value on the program and hlt stack.
        See Also:
        Constant Field Values
      • User_Steps_High

        static final int User_Steps_High
        The memory from 0 .. 998 (999 steps) is available to user programs. 999 is reserved as stop marker
      • User_Steps_Low

        static final int User_Steps_Low
        The memory from 0 .. 998 (999 steps) is available for user programs.
      • Display_Error

        public static final String Display_Error
        Error Message displayed on using the wrong display mode!
        See Also:
        Constant Field Values
      • Execution_Interactive

        public static final int Execution_Interactive
        Calculator is used interactively.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
        See Also:
        Constant Field Values
      • Indicator_Alpha

        public static final int Indicator_Alpha
        Keyboard Mode Alpha:
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        The mode show that the Alpha Keyboard mode is active. The indicator also blinks twice in that 2 sec pause when displaying an string > 11 characters.
        See Also:
        Constant Field Values
      • Indicator_Count

        public static final int Indicator_Count
        Indicator count:
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode 2, write programms
        Pcl
        Mode 3, clear, save, load programs.
        Deg
        Mode 4, Tr
        Rad
        Mode 5
        Gra
        Mode 6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Deg

        public static final int Indicator_Deg
        Trigonometric functions in degrees (360° based)
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Gra

        public static final int Indicator_Gra
        Trigonometric functions in gradians (400 based)
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Hlt

        public static final int Indicator_Hlt
        Program halt wait for user response
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Hyp

        public static final int Indicator_Hyp
        Hyperbolic function active. Also used for Password entry.
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Inv

        public static final int Indicator_Inv
        Inverse functions active.
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_K

        public static final int Indicator_K
        Arithmetic with constants.
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Pcl

        public static final int Indicator_Pcl
        Clear program and memory. Also used for save and load.
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Rad

        public static final int Indicator_Rad
        Trigonometric functions in radians (2π based)
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Run

        public static final int Indicator_Run
        Run and calculation mode.
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Indicator_Wrt

        public static final int Indicator_Wrt
        Write Programs
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
        See Also:
        Constant Field Values
      • Keyboard_Alpha

        public static final int Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        See Also:
        Constant Field Values
      • Keyboard_Hyp

        public static final int Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        See Also:
        Constant Field Values
      • Keyboard_Inv

        public static final int Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        See Also:
        Constant Field Values
      • Keyboard_Inv_Alpha

        public static final int Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        See Also:
        Constant Field Values
      • Keyboard_Inv_Hyp

        public static final int Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        See Also:
        Constant Field Values
      • Keyboard_Normal

        public static final int Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
        See Also:
        Constant Field Values
      • Running_Text

        public static final short[] Running_Text
        Text to display when ( is pressed
      • Steps_Count

        public static final int Steps_Count

        Amount of Steps.

      • Indicators

        private final boolean @NotNull [] Indicators
        Indicators:
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
      • Realistic_Speed

        final boolean Realistic_Speed
        Run calculator with realistic speed - just about as fast as the original.
      • Steps

        final short @NotNull [] Steps
        Calculator Program Memory
      • A

        @NotNull
        private @NotNull A_Register @NotNull [] A

        The A Register contains the Keyboard_Alpha data of the display. There are two of them - one for input and one for temporary messages.

      • A_Active

        private net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A_Active
        Active A register.
        A_Numeric
        Alpha register to enter and display numeric results.
        A_Text
        Alpha register to enter and display textual results.
        A_Message
        Alpha register to display messages.
        A_Key
        Alpha register to merge key operations.
      • Calculator_Running

        private volatile boolean Calculator_Running
        Calculator is running - needed for power saving. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and being full shutdown.
      • Calculator_Shutdown

        private volatile boolean Calculator_Shutdown
        Calculator is not running - needed for end program. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and being full shutdown
      • Current_Program

        private short Current_Program
        Current Current_Program
      • Display_Mode

        private net.sourceforge.uiq3.calculator.ICalculator.DisplayType Display_Mode
        Current display mode
        Display_Alpha
        Displays the content of the Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formatted
        Displays the content of the L0 aka X register inside an alpha
      • Execution_Mode

        private int Execution_Mode
        Current Execution mode.
        Execution_Interactive
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
      • Hlt_Position

        private int Hlt_Position
        Return Position for HLT Mode.
      • IO_Count

        private int IO_Count
        Number of virtual CPU cycles until next IO run.
      • Key_Buffer

        private int Key_Buffer
        last key pressed
      • Key_Flag

        private boolean Key_Flag
        a key was pressed
      • Key_Operations

        private Keyboard[] Key_Operations
        Operations as they come from the keyboard.
      • Key_Time

        private long Key_Time
        System time when last Key was clicked.
      • L

        private L_Register[] L
        The L-Register are used for general calculations. There is a total of 12 register. L0 is also called X L1 is also called Y
      • M

        private Number[] M
        The M-Register are used for general data storage.
      • MF

        private Number[] MF
        The MF-Register are used for special data storage.
      • Merge_Token

        @Nullable
        private IProgrammable_Operation Merge_Token
        Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      • Program_Counter

        private int Program_Counter
        Current Program counter .
      • Program_Stack_Pointer

        private int Program_Stack_Pointer
        Program stack poiunter used for GSB commands .
      • Program_Store

        private int Program_Store
        Where to store the next merged operations.
      • Service

        @Nullable
        private net.sourceforge.uiq3.calculator.IService Service
        Canvas class where we display our result or get our keycodes
      • Token_Plane

        private Calculator.Token_Plane_Type Token_Plane
        Active plane:
        • 0: Keyboard_Normal
        • 1: Memory + 20, Fix instead of RND
        • 2; Memory + 40
        • 3: Memory + 60
        • 4: Memory + 80
        • Display_Enable

          boolean Display_Enable
          Display enable - used to switch off the display so that intermediate result are not shown to the user.
        • FA2

          @Nullable
          Tape FA2
          A simulated cassette Printer
        • FP10

          @Nullable
          Printer FP10
          A simulated Printer Printer
        • Form

          @Nullable
          net.sourceforge.uiq3.ui.ICalculatorCanvas Form
          Canvas class where we display our result or get our keycodes
        • Ignore_Clear

          boolean Ignore_Clear
          The last operation was one of the operations (+-) which disable the clear key.
        • Indirect

          private boolean Indirect
          Currently indirect addressing is active
        • L_Used

          int L_Used
          Amount of L Register used
        • Last_Operation

          int Last_Operation
          Last operation choosen by user - used for the K option.
        • Merge_Key

          @Nullable
          @Nullable Keyboard Merge_Key
          Key Operations which currently merged to a Calculator operation.
        • Program_Stack

          int @NotNull [] Program_Stack
          Program stack used for GSB commands .
        • Stack_Count

          public static final int Stack_Count

          deeps of the program stack.

          See Also:
          Constant Field Values
        • Merged_Operations

          @NotNull
          public @NotNull IProgrammable_Operation @NotNull [] Merged_Operations

          Operations as they executed by the calculator.

          The field in initialized in Init_Opcodes after which the array and all array elements will not be null.

        • propertyChangeSupport

          private final PropertyChangeSupport propertyChangeSupport
          Handle property changes. We don't use the full feature with oldValue and new newValue as that would be overkill.
        • Pause_Repeat

          int Pause_Repeat
      • Constructor Detail

        • Calculator

          Calculator()
      • Method Detail

        • isIndirect

          public boolean isIndirect()
        • setIndirect

          public void setIndirect​(boolean indirect)
        • addPropertyChangeListener

          public void addPropertyChangeListener​(@NotNull
                                                PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.
          Specified by:
          addPropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
          Parameters:
          listener - The PropertyChangeListener to be added
        • addPropertyChangeListener

          public void addPropertyChangeListener​(@NotNull
                                                @NotNull String propertyName,
                                                @NotNull
                                                PropertyChangeListener listener)
          Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property.
          Specified by:
          addPropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
          Parameters:
          propertyName - The name of the property to listen on.
          listener - The PropertyChangeListener to be added
          Since:
          1.2
        • removePropertyChangeListener

          public void removePropertyChangeListener​(@NotNull
                                                   PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener was added more than once to the same event source, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.
          Specified by:
          removePropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
          Parameters:
          listener - The PropertyChangeListener to be removed
        • removePropertyChangeListener

          public void removePropertyChangeListener​(@NotNull
                                                   @NotNull String propertyName,
                                                   @NotNull
                                                   PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property. If `listener` was added more than once to the same event source for the specified property, it will be notified one less time after being removed.
          Specified by:
          removePropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
          Parameters:
          propertyName - The name of the property that was listened on.
          listener - The PropertyChangeListener to be removed
          Since:
          1.2
        • ARegister_Display_Value_Changed

          private void ARegister_Display_Value_Changed​(PropertyChangeEvent event)
        • A

          public final A_Register A​(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Index)
        • A_Active

          public net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A_Active()
          Active A register for row. With Row 0
          A_Numeric
          Alpha register to enter and display numeric results.
          A_Text
          Alpha register to enter and display textual results.
          A_Message
          Alpha register to display messages.
          A_Key
          Alpha register to merge key operations.
        • A_Active

          public void A_Active​(@NotNull
                               net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A)
          Active A register for row. With Row 0
          A_Numeric
          Alpha register to enter and display numeric results.
          A_Text
          Alpha register to enter and display textual results.
          A_Message
          Alpha register to display messages.
          A_Key
          Alpha register to merge key operations.
        • Add_Debug_Info

          private void Add_Debug_Info​(int Position,
                                      short[] Text)

          Add debug info. Either to an error message or a program listing in single step mode.

          Parameters:
          Text - text to add the program info. first to and last three characters must be free
        • Add_Steps

          private void Add_Steps​(int Steps,
                                 short[] Text)
          Add step count to text field
          Parameters:
          Steps - Steps to add to exponent
          Text - Text to add steps to
        • Clear

          public void Clear​(boolean AC)

          Clean Calculator

          Specified by:
          Clear in interface IClear
          Parameters:
          AC - true when AC (all clear) is requested.
          See Also:
          IClear.Clear(boolean)
        • Decrement_Program_Store

          void Decrement_Program_Store()
          Decrement where to store the next merged operations.
        • Display_A

          public void Display_A​(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Register_Number)
          Display A register
          Parameters:
          Register_Number - A-register to display
        • displayClear

          public void displayClear()
          Clear all alpha register. And just calling "Clear" is not enough.
          Specified by:
          displayClear in interface net.sourceforge.uiq3.calculator.ICalculator
        • Display_Error

          public void Display_Error​(short @NotNull [] Text)
          Display an error message until C or AC is pressed.
          Parameters:
          Text - Test to be displayed
        • Display_Fatal

          void Display_Fatal​(short @NotNull [] Text)
          Display an error message until C or AC is pressed.
          Parameters:
          Text - Test to be displayed
        • displayFormatted

          public void displayFormatted​(short @NotNull [] text)
          Display value as formatted text
          Specified by:
          displayFormatted in interface net.sourceforge.uiq3.calculator.ICalculator
          Parameters:
          text - to be displayed
        • displayKey

          public void displayKey​(short @NotNull [] text)
          * Display Key merge info.
          Specified by:
          displayKey in interface net.sourceforge.uiq3.calculator.ICalculator
          Parameters:
          text - info to be displayed
        • displayL

          public void displayL()
          Reset current value Display
          Specified by:
          displayL in interface net.sourceforge.uiq3.calculator.ICalculator
        • displayMessage

          public void displayMessage​(short @NotNull [] text)
          Display text as message
          Specified by:
          displayMessage in interface net.sourceforge.uiq3.calculator.ICalculator
          Parameters:
          text - to be displayed
        • getDisplayMode

          @NotNull
          public net.sourceforge.uiq3.calculator.ICalculator.DisplayType getDisplayMode()
          Current display mode
          Display_Alpha
          Displays the content of the Alpha register.
          Display_L
          Displays the content of the L0 aka X register.
          Display_Formatted
          Displays the content of the L0 aka X register inside an alpha
          Specified by:
          getDisplayMode in interface net.sourceforge.uiq3.calculator.ICalculator
          Returns:
          current new display mode
        • setDisplayMode

          public void setDisplayMode​(@NotNull
                                     net.sourceforge.uiq3.calculator.ICalculator.DisplayType displayMode)
          Current display mode
          Display_Alpha
          Displays the content of the Alpha register.
          Display_L
          Displays the content of the L0 aka X register.
          Display_Formated
          Displays the content of the L0 aka X register inside an alpha
          Specified by:
          setDisplayMode in interface net.sourceforge.uiq3.calculator.ICalculator
          Parameters:
          displayMode - new display mode
        • Display_Program

          final void Display_Program()
          Display program overview
        • Display_Program_Overview

          public void Display_Program_Overview()
          Display program overview
        • Display_Steps

          public void Display_Steps()
          Display Program Steps
        • Error_Reset

          private void Error_Reset()
          Brings the calculator into a defined state after an error condition.
        • Execute_Mode_Pcl

          private void Execute_Mode_Pcl()
                                 throws Error
          Handles the program clear, save and load.
          Throws:
          Error - General calculator error
        • Execute_Mode_Run

          void Execute_Mode_Run()
                         throws Error
          Handles running the calculator
          Throws:
          Error - an error occurred while executing
        • Execute_Mode_Wrt

          private void Execute_Mode_Wrt()
          Handles the programm editing
        • getExecutionMode

          public int getExecutionMode()
          Execution mode
          Returns:
          Execution_Interactiv
          Calculator is used interactively.
          Execution_Running
          Calculator running a program.
          Execution_Halt
          Calculator debugging a program.
          Execution_Pause
          Calculator pauses for a sec.
          Execution_1_Step
          Do a single step and return to Execution_Halt.
          Execution_Write
          Calcluator is in write programm mode.
          Execution_Clear
          Calcluator is in clear memory mode.
          Execution_Alpha_Pause
          Initial pause when alpha starts scrolling.
        • setExecutionMode

          void setExecutionMode​(int Execution_Mode)

          Set new Execution mode

          Execution_Interactiv
          Calculator is used interactively.
          Execution_Running
          Calculator running a program.
          Execution_Halt
          Calculator debugging a program.
          Execution_Pause
          Calculator pauses for a sec.
          Execution_1_Step
          Do a single step and return to Execution_Halt.
          Execution_Write
          Calcluator is in write programm mode.
          Execution_Clear
          Calcluator is in clear memory mode.
          Execution_Alpha_Pause
          Initial pause when alpha starts scrolling.
          Execution_Alpha_Step
          Pause between each character when alpha starts scrolling.
          Parameters:
          Execution_Mode - new mode
        • FA2

          @Nullable
          public final Tape FA2()
          A simulated cassette Printer
          Returns:
          FA-2 interface
        • FP10

          @Nullable
          public final Printer FP10()
          A simulated cassette Printer
          Returns:
          FP-10 Printer
        • forceIO

          void forceIO​(boolean resetKeyTime)
          Force IO Handling next round.
          Parameters:
          resetKeyTime - Reset keyboard as well.
        • Form

          public void Form​(net.sourceforge.uiq3.ui.ICalculatorCanvas Form)
          Set Canvas to display result read keyboard
          Parameters:
          Form - Formular where calculator is displayed in
        • Free_Steps

          final void Free_Steps​(short[] Text)
          Add total amount of free steps to text;
          Parameters:
          Text - Text to add the free steps to
        • Get_Alpha_Mode

          boolean Get_Alpha_Mode()
          Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
          Returns:
          true when in Alpha mode.
        • Get_Current_Program

          short Get_Current_Program()
          Returns:
          the current_Program
        • Get_Program_Text

          private short @NotNull [] Get_Program_Text​(boolean For_Debug)
          Display Program Steps
          Parameters:
          For_Debug - Show active program as well
          Returns:
          Debug Text
        • getStackPointer

          public int getStackPointer()
          return current stack pointer
          Returns:
          stack pointer
        • Half_Circle

          @NotNull
          public final Number Half_Circle()
          convert an angle to Deg/Rad/Grad
          Returns:
          angle in Deg/Rad/Grad.
        • Half_Circle

          public final void Half_Circle​(@NotNull
                                        Number Half_Circle)
          convert an angle to Deg/Rad/Grad
          Parameters:
          Half_Circle - new Half circle to use
        • Handle_IO

          void Handle_IO()
          Display result and read keyboard
        • Handle_IO_HLT

          private short[] Handle_IO_HLT​(short[] text)

          Handles I/O for HLT and PAUSE mode

        • Handle_IO_Mode_Pcl

          private void Handle_IO_Mode_Pcl()
          Handles the IO in program-clear mode
        • Handle_IO_Mode_Wrt

          private void Handle_IO_Mode_Wrt()
          Handles I/O for program-write mode
        • Hlt_Position

          public int Hlt_Position()
          Return Position for HLT Mode.
          Returns:
          current halt position
        • Hlt_Position

          void Hlt_Position​(int Hlt_Position)
          Return Position for HLT Mode.
          Parameters:
          Hlt_Position - new halt position
        • Increment_Hlt_Position

          void Increment_Hlt_Position()
          Increment Current Program counter.
        • Increment_Program_Counter

          void Increment_Program_Counter()
          Increment Current Program counter.
        • Increment_Program_Store

          void Increment_Program_Store()
          Increment where to store the next merged operations.
        • Init_A

          public void Init_A()
          Clears A-register
        • Init_Keycodes

          public void Init_Keycodes()
          Clears internal Memory
        • Init_L

          public void Init_L()
          Clears L-register
        • Init_M

          public void Init_M()
          Clears M-register. The M-Register are used for general data storage.
        • Init_MF

          public void Init_MF()
          Clears MF-register. The MF-register are used for special data storage.
        • Init_Opcodes

          public void Init_Opcodes()

          Sets the opcodes.

          Operations temporarily set to null will be set in the for loop at the end of the method. Once this method ends all array elements are not null

        • Init_Program_Stack

          void Init_Program_Stack()
          init the GSB stack
        • Init_Steps

          public void Init_Steps()
          Clears Program Steps
        • Is_Alpha

          public boolean Is_Alpha​(int Step_Nr)
          check if Step "Nr" is an Alpha character
          Parameters:
          Step_Nr - Step to test
          Returns:
          true if we are writing alpha characters
        • Is_Alpha_Mode

          public boolean Is_Alpha_Mode()
          Alpha Mode?
          Returns:
          true when Alpha is aktiv
        • Is_Constant_Mode

          public final boolean Is_Constant_Mode()
          Current mode
          Returns:
          current constant calculation mode
        • Is_Executing_Program

          private boolean Is_Executing_Program()
          checks if we are running a program
          Returns:
          true wen a program is running
        • Is_HLT_Pause

          boolean Is_HLT_Pause​(int Step_Nr)
          check if Step "Nr" is an Alpha character
          Parameters:
          Step_Nr - Step to test
          Returns:
          true if we are writing alpha characters
        • Is_Program_Stack_Empty

          boolean Is_Program_Stack_Empty()
          Program stack used for GSB commands .
          Returns:
          true when stack is empty
        • Is_Program_Stack_Full

          boolean Is_Program_Stack_Full()
          Program stack used for GSB commands .
          Returns:
          true when stack us full
        • isRunning

          public boolean isRunning()
          Calculator is running - needed for power saving. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and beeing full shutdown.
          Specified by:
          isRunning in interface net.sourceforge.uiq3.calculator.ICalculator
          Returns:
          true when calculator is running
          See Also:
          ICalculator.isRunning()
        • Is_Shutdown

          @TestOnly
          public boolean Is_Shutdown()
          Calculator is not running - needed for end program. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and being fully shutdown.
          Returns:
          when calculators is shut down
        • isWaiting

          public boolean isWaiting()
          is waiting in interactive mode for user input.
          Specified by:
          isWaiting in interface net.sourceforge.uiq3.calculator.ICalculator
          Returns:
          true when in interactive mode.
        • Keyboard_Mode

          public int Keyboard_Mode()
          Get current Keyboard mode
          Returns:
          Keyboard_Normal
          Keyboard is in normal mode
          Keyboard_Inv
          Keyboard is in inverse mode
          Keyboard_Hyp
          Keyboard is in hyperbolic mode
          Keyboard_Inv_Hyp
          Keyboard is in inverse hyperbolic mode
          Keyboard_Alpha
          Keyboard is in alpha mode
          Keyboard_Inv_Alpha
          Keyboard is in inverse alpha mode
        • Keyboard_Mode

          void Keyboard_Mode​(int Keyboard_Mode)
          set input mode
          Parameters:
          Keyboard_Mode - new input mode
        • L

          public final L_Register L​(int Nr)
          The M-Register are used for general data storage.
        • getLastStep

          public int getLastStep()

          locate the last step to display the free steps or for debugging.

          Specified by:
          getLastStep in interface net.sourceforge.uiq3.calculator.ICalculator
          Returns:
          last step
        • load

          public void load​(@NotNull
                           @NotNull String filename)
          Load the current status of the system
          Specified by:
          load in interface net.sourceforge.uiq3.calculator.ICalculator
          Parameters:
          filename - Filename to load data from
        • Load_Status

          void Load_Status()
          Load the current status of the system
        • M

          @NotNull
          public Number M​(int Register)
          The M-Register are used for general data storage.
        • M

          public final void M​(int Register,
                              @NotNull
                              Number M)
          The M-Register are used for general data storage.
          Parameters:
          Register - register to get
          M - a single M register
        • MF

          @NotNull
          public Number MF​(int Register)
          The M-Register are used for general data storage.
        • MF

          public final void MF​(int Register,
                               @NotNull
                               Number MF)
          The M-Register are used for general data storage.
          Parameters:
          Register - register to get
          MF - a single M register
        • MF_Length

          public int MF_Length()
          The M-Register are used for general data storage.
        • M_Length

          public int M_Length()
          The M-Register are used for general data storage.
        • Merge_Key

          @Nullable
          public @Nullable Keyboard Merge_Key()
          Key Operations which currently merged to a Calculator operation.
          Returns:
          currend key merged
        • Merge_Key

          void Merge_Key​(@Nullable
                         @Nullable Keyboard Merge_Key)
          Key Operations which currently merged to a Calculator operation.
          Parameters:
          Merge_Key - new key to merge
        • Merge_Token

          @Nullable
          public IProgrammable_Operation Merge_Token()
          Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
          Returns:
          current token merged
        • Merge_Token

          void Merge_Token​(@Nullable
                           IProgrammable_Operation Merge_Token)
          Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
          Parameters:
          Merge_Token - new token to merge
        • Pop_L

          void Pop_L()
          Pop values from stack by triggering an calculation run up the the level Operation
        • Pop_L

          void Pop_L​(int Operation)
              throws Error
          Pop values from stack by triggering an calculation run up the the level Operation
          Parameters:
          Operation - last operation requested by user
          Throws:
          Error - stack exhausted
        • Pop_Program_Stack

          int Pop_Program_Stack()
          Program stack used for GSB commands .
          Returns:
          current programm stack
        • Program_Counter

          public int Program_Counter()
          Get current Program counter.
          Returns:
          Current Program counter.
        • Program_Position

          short Program_Position​(short Program_Token)
          Return step-postion of given program
          Parameters:
          Program_Token - program we seatch
          Returns:
          program step
        • Program_Store

          public int Program_Store()
          get where to store the next merged operations.
          Returns:
          where the next merged operations is stored.
        • Push_L

          private void Push_L()
                       throws P_Error
          Push stack one down.
          Throws:
          P_Error - I/O Error
        • Push_L

          void Push_L​(int Operation)
               throws Error
          Push value and given operation to stack. depending on what operation is used this might also trigger a calculation run.
          Parameters:
          Operation - last operation requested by user
          Throws:
          P_Error - "() Error" - Stack exhausted
          Error - stack exhausted
        • Push_Program_Stack

          void Push_Program_Stack​(int Program_Counter)
          Program stack used for GSB commands .
          Parameters:
          Program_Counter - New programm counter
        • Read_Display

          void Read_Display​(boolean Is_X_Register)
                     throws Op_Error
          Read Steps from Simulated Cassette interface.
          Throws:
          Op_Error - I/O Error
        • Read_M

          void Read_M()
               throws Op_Error
          Read M register from file
          Throws:
          Op_Error - io error
        • Read_Steps

          void Read_Steps()
                   throws Op_Error
          Read Steps from Simulated Cassette interface.
          Throws:
          Op_Error - I/O error
        • reset

          public void reset()
          Total Reset calculator.
          Specified by:
          reset in interface net.sourceforge.uiq3.calculator.ICalculator
          See Also:
          ICalculator.reset()
        • Resize_M

          void Resize_M​(int New_Size)
          Set new size for M-register. The M-register are used for general data storage.
          Parameters:
          New_Size - The new size
        • Resize_MF

          void Resize_MF​(int New_Size)
          Set new size for F-register. The MF-register are used for special data storage.
          Parameters:
          New_Size - The new size
        • Save_Status

          void Save_Status()
          Save the current status of the system
        • Service

          public void Service​(@Nullable
                              net.sourceforge.uiq3.calculator.IService Service)
          Set Canvas to display result read keyboard
          Parameters:
          Service - Service executing the calculator
        • Set_Alpha_Mode

          void Set_Alpha_Mode​(boolean Alpha_Mode)
          Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
          Parameters:
          Alpha_Mode - new alpha mode
        • Set_Constant_Mode

          public final void Set_Constant_Mode​(boolean Constant_Mode)
          Current mode
          Parameters:
          Constant_Mode - new constant calculation mode
        • Set_Current_Program

          void Set_Current_Program()
          Set Current program to program at program counter
        • Set_Current_Program

          void Set_Current_Program​(short Current_Program)
          Parameters:
          Current_Program - the current_Program to set
        • Set_Program_Counter

          void Set_Program_Counter​(int Program_Counter)
          Set Current Program counter.
          Parameters:
          Program_Counter - new position
        • Set_Program_Store

          void Set_Program_Store​(int Program_Store)
          Set where to store the next merged operations.
          Parameters:
          Program_Store - new position
        • Steps

          public final short Steps​(int Step)
          Calculator Program Memory
          Parameters:
          Step - Step to get
          Returns:
          a single Step
        • Steps

          public final void Steps​(int Step,
                                  short Value)
          Calculator Program Memory
          Parameters:
          Step - Step to set
          Value - a single Step
        • Stop_Execute

          void Stop_Execute()

          Stop calculator executing an reset interactive mode.

        • Store_Operation

          void Store_Operation​(short Operation)
                        throws M_Error
          Store an operation at into calculator memory
          Parameters:
          Operation - Operation to be stored
          Throws:
          M_Error - Calculator memory exhausted
        • Text_To_Display

          public short @Nullable [] Text_To_Display()
          Text to be displayed. Depends on on the active register, curent display and execution modes.
          Returns:
          the text to display
        • Token_Plane

          public Calculator.Token_Plane_Type Token_Plane()
          Active plane:
          • 0: Keyboard_Normal
          • 1: Memory + 20, Fix instead of RND
          • 2; Memory + 40
          • 3: Memory + 60
          • 4: Memory + 80
            Returns:
            current token plane
          • Token_Plane

            void Token_Plane​(Calculator.Token_Plane_Type Token_Plane)
            Active plane:
            • 0: Keyboard_Normal
            • 1: Memory + 20, Fix instead of RND
            • 2; Memory + 40
            • 3: Memory + 60
            • 4: Memory + 80
              Parameters:
              Token_Plane - new token plane
            • Write_M

              void Write_M()
                    throws Op_Error
              Writes memory register to simulated cassette interface.
              Throws:
              Op_Error - Could not write data
            • Write_Steps

              void Write_Steps()
                        throws Op_Error
              Writes program steps to simulated cassette interface.
              Throws:
              Op_Error - Could not write data
            • Wrt_Is_Alpha

              boolean Wrt_Is_Alpha​(boolean For_Debug)
              check if - in wrt mode - we are currently in alpha mode.
              Parameters:
              For_Debug - debug mode
              Returns:
              true if we are writing alpha characters
            • run

              public final void run()
              Start Calculator
              Specified by:
              run in interface net.sourceforge.uiq3.calculator.ICalculator
              Specified by:
              run in interface Runnable
              See Also:
              ICalculator.run()
            • stop

              public void stop()

              Stop virtual CPU and the thread it runs in

              Specified by:
              stop in interface net.sourceforge.uiq3.calculator.ICalculator
              See Also:
              ICalculator.stop()
            • toString

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