Package net.sourceforge.uiq3.fx602p
Class L_Register
- java.lang.Object
-
- net.sourceforge.uiq3.fx602p.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 Summary
Fields Modifier and Type Field Description private static int
Base_N_Decimal
private static Logger
Logger
Class logger instance.static int
Max_Exponent
Maximum supported Exponent + 1private static int
Negative_Display_Precision
Minus 2 for the dot and the negative sign max negative precision.private int
Operation
Operation requested after this number was entered.(package private) static int
Operation_Constant
Level 7: constant operation stored(package private) static int
Operation_Division
Level 3: Operation division(package private) static int
Operation_Equal
Level 6: Equal operation finish all calculations on stack(package private) static int
Operation_Minus
Level 4: Operation minus(package private) static int
Operation_Multiplication
Level 3: Operation multiplication(package private) static int
Operation_Nop
Level 7: no operation stored(package private) static int
Operation_P_Close
Level 5: Close operation finish all calculations on stack ()(package private) static int
Operation_P_Open
Level 0: Operation ) of(package private) static int
Operation_P_To_R
Level 1: Operation Polar to Rectangular(package private) static int
Operation_Percent
Level 6: Operation % of(package private) static int
Operation_Plus
Level 4: Operation plus(package private) static int
Operation_Power
Level 2: Operation Power of(package private) static int
Operation_R_To_P
Level 1: Operation Rectangular to Polar(package private) static int
Operation_Root
Level 2: Operation Root ofprivate int
Parenthesis
Parenthesis opened before this number was entered - max is 3.(package private) static int
Positive_Display_Precision
Minus 1 for the dot gives max positive precision.private static int
Small_Display_Precision
i.E. 0.001 is displayed as 1.*10³private static String
TAG
Class logger tag.private static int @NotNull []
Ten_Power
powers of 10 needed to move the decimal point for Format_Engineering.private Number
Value
Value of the register.
-
Constructor Summary
Constructors Constructor Description L_Register()
Assign one L-Register to another one
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
Assign(@NotNull L_Register Right)
Assign one L-Register to another onevoid
Assign(IL_Register Right)
Assign one L-Register to another onevoid
Clear(boolean AC)
Clear content of Register(package private) void
Dec_Parenthesis()
Decrement parenthesis level (+-×÷ ... )short @NotNull []
Format()
Format in standard format.static short @NotNull []
Format(Number Value)
Format Value in standard formatstatic short @NotNull []
Format_Engineering(Number Value, @Nullable Integer Offset)
Format Value in standard format(package private) static short @NotNull []
Format_Fixed(@NotNull BCDFloat Value, int Digits)
Format Value in standard formatshort @NotNull []
Format_Print()
Format in printer formatstatic short @NotNull []
Format_Print(Number Value)
Format Value in standard format(package private) static short @NotNull []
Format_Round(Number Value, int Digits)
Format Value in standard formatvoid
Inc_Parenthesis()
Increment parenthesis level (+-×÷ ... )(package private) int
Operation()
Get operation (+-×÷ ... )void
Operation(int Operation)
Set operation (+-×÷ ... )int
Parenthesis()
Get parenthesis level (+-×÷ ... )void
Parenthesis(int Parenthesis)
Set parenthesis level (+-×÷ ... )void
Set_NaN()
Set value of the register to NaN(package private) void
Set_Value(@org.jetbrains.annotations.NotNull short @NotNull [] Text)
Set_Value of the register.@NotNull String
toString()
Number
Value()
Temp_Value of the register.void
Value(Number Value)
Set value of the register.
-
-
-
Field Detail
-
Base_N_Decimal
private static final int Base_N_Decimal
- See Also:
- Constant Field Values
-
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.
-
-
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 formatOffset
- 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 formatDigits
- 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 formatDigits
- 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 interfaceIL_Register
- Parameters:
Right
- Value to assign
-
Clear
public void Clear(boolean AC)
Clear content of Register- Specified by:
Clear
in interfaceIClear
- 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 interfaceIL_Register
- Returns:
- Formatted string
-
Format_Print
public final short @NotNull [] Format_Print()
Format in printer format- Specified by:
Format_Print
in interfaceIL_Register
- Returns:
- Formatted string
-
Inc_Parenthesis
public void Inc_Parenthesis()
Increment parenthesis level (+-×÷ ... )- Specified by:
Inc_Parenthesis
in interfaceIL_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 interfaceIL_Register
- Returns:
- parenthesis level (0 ... 3)
-
Parenthesis
public void Parenthesis(int Parenthesis)
Set parenthesis level (+-×÷ ... )- Specified by:
Parenthesis
in interfaceIL_Register
- Parameters:
Parenthesis
- level (0 ... 3)
-
Set_NaN
public void Set_NaN()
Set value of the register to NaN- Specified by:
Set_NaN
in interfaceIL_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 interfaceIL_Register
- Returns:
- current value
-
Value
public void Value(@NotNull Number Value) throws Error
Set value of the register.- Specified by:
Value
in interfaceIL_Register
- Parameters:
Value
- Value to set.- Throws:
Error
- number is large or NaN not a value executable for the FX-602P Simulator
-
-