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 intBase_N_Decimalprivate static LoggerLoggerClass logger instance.static intMax_ExponentMaximum supported Exponent + 1private static intNegative_Display_PrecisionMinus 2 for the dot and the negative sign max negative precision.private intOperationOperation requested after this number was entered.(package private) static intOperation_ConstantLevel 7: constant operation stored(package private) static intOperation_DivisionLevel 3: Operation division(package private) static intOperation_EqualLevel 6: Equal operation finish all calculations on stack(package private) static intOperation_MinusLevel 4: Operation minus(package private) static intOperation_MultiplicationLevel 3: Operation multiplication(package private) static intOperation_NopLevel 7: no operation stored(package private) static intOperation_P_CloseLevel 5: Close operation finish all calculations on stack ()(package private) static intOperation_P_OpenLevel 0: Operation ) of(package private) static intOperation_P_To_RLevel 1: Operation Polar to Rectangular(package private) static intOperation_PercentLevel 6: Operation % of(package private) static intOperation_PlusLevel 4: Operation plus(package private) static intOperation_PowerLevel 2: Operation Power of(package private) static intOperation_R_To_PLevel 1: Operation Rectangular to Polar(package private) static intOperation_RootLevel 2: Operation Root ofprivate intParenthesisParenthesis opened before this number was entered - max is 3.(package private) static intPositive_Display_PrecisionMinus 1 for the dot gives max positive precision.private static intSmall_Display_Precisioni.E. 0.001 is displayed as 1.*10³private static StringTAGClass logger tag.private static int @NotNull []Ten_Powerpowers of 10 needed to move the decimal point for Format_Engineering.private NumberValueValue 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) voidAssign(@NotNull L_Register Right)Assign one L-Register to another onevoidAssign(IL_Register Right)Assign one L-Register to another onevoidClear(boolean AC)Clear content of Register(package private) voidDec_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 formatvoidInc_Parenthesis()Increment parenthesis level (+-×÷ ... )(package private) intOperation()Get operation (+-×÷ ... )voidOperation(int Operation)Set operation (+-×÷ ... )intParenthesis()Get parenthesis level (+-×÷ ... )voidParenthesis(int Parenthesis)Set parenthesis level (+-×÷ ... )voidSet_NaN()Set value of the register to NaN(package private) voidSet_Value(@org.jetbrains.annotations.NotNull short @NotNull [] Text)Set_Value of the register.@NotNull StringtoString()NumberValue()Temp_Value of the register.voidValue(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:
Assignin interfaceIL_Register- Parameters:
Right- Value to assign
-
Clear
public void Clear(boolean AC)
Clear content of Register- Specified by:
Clearin 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:
Formatin interfaceIL_Register- Returns:
- Formatted string
-
Format_Print
public final short @NotNull [] Format_Print()
Format in printer format- Specified by:
Format_Printin interfaceIL_Register- Returns:
- Formatted string
-
Inc_Parenthesis
public void Inc_Parenthesis()
Increment parenthesis level (+-×÷ ... )- Specified by:
Inc_Parenthesisin 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:
Parenthesisin interfaceIL_Register- Returns:
- parenthesis level (0 ... 3)
-
Parenthesis
public void Parenthesis(int Parenthesis)
Set parenthesis level (+-×÷ ... )- Specified by:
Parenthesisin interfaceIL_Register- Parameters:
Parenthesis- level (0 ... 3)
-
Set_NaN
public void Set_NaN()
Set value of the register to NaN- Specified by:
Set_NaNin interfaceIL_Register
-
Set_Value
void Set_Value(@NotNull @org.jetbrains.annotations.NotNull short @NotNull [] Text) throws ErrorSet_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:
Valuein interfaceIL_Register- Returns:
- current value
-
Value
public void Value(@NotNull Number Value) throws ErrorSet value of the register.- Specified by:
Valuein interfaceIL_Register- Parameters:
Value- Value to set.- Throws:
Error- number is large or NaN not a value executable for the FX-602P Simulator
-
-