Package net.sourceforge.uiq3.fx603p
Class L_Register
- java.lang.Object
-
- net.sourceforge.uiq3.fx603p.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»
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classL_Register.Operation_Typeinfix operations and there level
-
Field Summary
Fields Modifier and Type Field Description (package private) static intBase_N_BinaryBase for binary(package private) static intBase_N_DecimalBase for Decimal(package private) static intBase_N_HexadecimalBase for Hexadecimal(package private) static intBase_N_OctalBase for Octal(package private) static intDisplay_Precisionon FX-603P the display precision is always 10 event with the display not being able to show moreprivate static intInternal_PrecisionThe Casio had an internal precision of 12 digits - BCDFloat are approximately 18 digits.private static LoggerLoggerclass logger instancestatic intMax_ExponentMaximum supported Exponent + 1private L_Register.Operation_TypeOperationOperation requested after this number was entered.private CalculatorOwnerprivate intParenthesisParenthesis opened before this number was entered - max is 3.private static intSmall_Display_Precisioni.E. 0.001 is displayed as 1.*10³private static StringTAGclass logger tag.private static int[]Ten_Powerpowers of 10 needed to move the decimal point for Format_Engineering.private static longTwo_Power_15±1¹⁵private static longTwo_Power_312³¹private NumberValueValue of the register for BCD Calculations
-
Constructor Summary
Constructors Constructor Description L_Register(Calculator Owner)Assign one L-Register to another one
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 (+-×÷ ... )@org.jetbrains.annotations.NotNull short[]Format()Format in standard format.static short @NotNull []Format_Binary(Number Value)Format Value in standard formatprivate static intFormat_Decimal(short[] Text, long Value, int Index)format a decimal integer and add it ot the given alpha sting.static short @NotNull []Format_Decimal(Number Value)Format Value in standard formatstatic short @NotNull []Format_Engineering(Number Value, int Offset)Format Value in standard format(package private) static short @NotNull []Format_Fixed(@NotNull BCDFloat Value, int Digits)Format Value in standard formatstatic short @NotNull []Format_Float(Number Value)Format Value in standard formatstatic short @NotNull []Format_Fraction_ABC(Number Value)Format Value in standard formatstatic short @NotNull []Format_Fraction_DC(Number Value)Format Value in standard formatstatic short @NotNull []Format_Hexadecimal(Number Value)Format Value in standard formatstatic short @NotNull []Format_Octal(Number Value)Format Value in standard format@org.jetbrains.annotations.NotNull short[]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 formatstatic @NotNull StringFormat_Serial(Number Value)Format Value for use with Serial portprivate static StringFormat_Serial_Float(BCDFloat Value)Format Fraction Value for use with Serial portprivate static StringFormat_Serial_Fraction(BCDFraction Value)Format Fraction Value for use with Serial portprivate static longGet_16bit(Number Value)Converts a signed long into an 16 unsigned integerprivate static longGet_32bit(Number Value)Converts a signed long into an 32 unsigned integervoidInc_Parenthesis()Increment parenthesis level (+-×÷ ... )(package private) booleanIs_Finite()check value is normal realL_Register.Operation_TypeOperation()Get operation (+-×÷ ... )voidOperation(L_Register.Operation_Type Operation)Set operation (+-×÷ ... )intParenthesis()Get parenthesis level (+-×÷ ... )voidParenthesis(int Parenthesis)Set parenthesis level (+-×÷ ... )static NumberParse_Serial(String Text)parse a text representing a numbervoidSet_NaN()Set value of the register to NaNStringtoString()Convert object to string representationNumberValue()Temp_Value of the register.voidValue(Number Value)Set value of the register.
-
-
-
Field Detail
-
Base_N_Binary
static final int Base_N_Binary
Base for binary- See Also:
- Constant Field Values
-
Base_N_Decimal
static final int Base_N_Decimal
Base for Decimal- See Also:
- Constant Field Values
-
Base_N_Hexadecimal
static final int Base_N_Hexadecimal
Base for Hexadecimal- See Also:
- Constant Field Values
-
Base_N_Octal
static final int Base_N_Octal
Base for Octal- See Also:
- Constant Field Values
-
Display_Precision
static final int Display_Precision
on FX-603P the display precision is always 10 event with the display not being able to show more
-
Internal_Precision
private static final int Internal_Precision
The Casio had an internal precision of 12 digits - BCDFloat are approximately 18 digits.
-
Logger
private static final Logger Logger
class logger instance
-
Max_Exponent
public static final int Max_Exponent
Maximum supported Exponent + 1
-
Small_Display_Precision
private static final int Small_Display_Precision
i.E. 0.001 is displayed as 1.*10³
-
TAG
private static final String TAG
class logger tag.
-
Ten_Power
private static int[] Ten_Power
powers of 10 needed to move the decimal point for Format_Engineering.
-
Two_Power_15
private static final long Two_Power_15
±1¹⁵- See Also:
- Constant Field Values
-
Two_Power_31
private static final long Two_Power_31
2³¹- See Also:
- Constant Field Values
-
Operation
private L_Register.Operation_Type Operation
Operation requested after this number was entered.
-
Owner
private final Calculator Owner
-
Parenthesis
private int Parenthesis
Parenthesis opened before this number was entered - max is 3.
-
Value
private Number Value
Value of the register for BCD Calculations
-
-
Constructor Detail
-
L_Register
public L_Register(Calculator Owner)
Assign one L-Register to another one- Parameters:
Owner- the Owner of this L-Register
-
-
Method Detail
-
Format_Binary
public static short @NotNull [] Format_Binary(@NotNull Number Value) throws ErrorFormat Value in standard format- Parameters:
Value- value to format- Returns:
- Formatted string
- Throws:
Error
-
Format_Decimal
public static short @NotNull [] Format_Decimal(@NotNull Number Value)Format Value in standard format- Parameters:
Value- value to format- Returns:
- Formatted string
-
Format_Decimal
private static int Format_Decimal(short[] Text, long Value, int Index)format a decimal integer and add it ot the given alpha sting.
- Parameters:
Text- string to add the decimal toValue- value to addIndex- index where the lest significant digit is added- Returns:
- index of next free character (most significant digits + 1)
-
Format_Engineering
public static short @NotNull [] Format_Engineering(@NotNull Number Value, int Offset)Format Value in standard format- Parameters:
Value- value to formatOffset- Eng offset 0 no offset, 1 next lager 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_Float
public static short @NotNull [] Format_Float(@NotNull Number Value)Format Value in standard format- Parameters:
Value- value to format- Returns:
- Formated string
-
Format_Fraction_ABC
public static short @NotNull [] Format_Fraction_ABC(@NotNull Number Value)Format Value in standard format- Parameters:
Value- value to format- Returns:
- Formated string
-
Format_Fraction_DC
public static short @NotNull [] Format_Fraction_DC(@NotNull Number Value)Format Value in standard format- Parameters:
Value- value to format- Returns:
- Formated string
-
Format_Hexadecimal
public static short @NotNull [] Format_Hexadecimal(@NotNull Number Value) throws ErrorFormat Value in standard format- Parameters:
Value- value to format- Returns:
- Formated string
- Throws:
Error
-
Format_Octal
public static short @NotNull [] Format_Octal(@NotNull Number Value) throws ErrorFormat Value in standard format- Parameters:
Value- value to format- Returns:
- Formated string
- Throws:
Error
-
Format_Print
public static short @NotNull [] Format_Print(@NotNull Number Value)Format Value in standard format- Parameters:
Value- value to format- Returns:
- Formated 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
-
Format_Serial
@NotNull public static @NotNull String Format_Serial(@NotNull Number Value)
Format Value for use with Serial port- Parameters:
Value- value to format- Returns:
- Formatted string
-
Format_Serial_Float
private static String Format_Serial_Float(BCDFloat Value)
Format Fraction Value for use with Serial port- Parameters:
Value- value to format- Returns:
- Formatted string
-
Format_Serial_Fraction
private static String Format_Serial_Fraction(BCDFraction Value)
Format Fraction Value for use with Serial port- Parameters:
Value- value to format- Returns:
- Formatted string
-
Get_16bit
private static long Get_16bit(@NotNull Number Value) throws ErrorConverts a signed long into an 16 unsigned integer
- Parameters:
Value- signed long- Returns:
- unsigned 16 bit
- Throws:
Error- value does not fit into 16 bit
-
Get_32bit
private static long Get_32bit(@NotNull Number Value) throws ErrorConverts a signed long into an 32 unsigned integer
- Parameters:
Value- signed long- Returns:
- unsigned 32 bit
- Throws:
Error- value does not fit into 32 bit
-
Parse_Serial
public static Number Parse_Serial(String Text)
parse a text representing a number
- Parameters:
Text- text to parse- Returns:
- number contained.
-
Assign
public 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
@NotNull public final @org.jetbrains.annotations.NotNull short[] Format() throws ErrorFormat in standard format.- Specified by:
Formatin interfaceIL_Register- Returns:
- Formatted string
- Throws:
Error
-
Format_Print
@NotNull public final @org.jetbrains.annotations.NotNull short[] Format_Print() throws ErrorFormat in printer format- Specified by:
Format_Printin interfaceIL_Register- Returns:
- Formatted string
- Throws:
Error
-
Inc_Parenthesis
public void Inc_Parenthesis()
Increment parenthesis level (+-×÷ ... )- Specified by:
Inc_Parenthesisin interfaceIL_Register
-
Is_Finite
boolean Is_Finite()
check value is normal real
- Returns:
- true when value is normal real
-
Operation
public L_Register.Operation_Type Operation()
Get operation (+-×÷ ... )- Returns:
- current operation
-
Operation
public void Operation(L_Register.Operation_Type 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
-
toString
@TestOnly public String toString()
Convert object to string representation- Overrides:
toStringin classObject- See Also:
Object.toString()
-
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
-
-