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 class
L_Register.Operation_Type
infix operations and there level
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
Base_N_Binary
Base for binary(package private) static int
Base_N_Decimal
Base for Decimal(package private) static int
Base_N_Hexadecimal
Base for Hexadecimal(package private) static int
Base_N_Octal
Base for Octal(package private) static int
Display_Precision
on FX-603P the display precision is always 10 event with the display not being able to show moreprivate static int
Internal_Precision
The Casio had an internal precision of 12 digits - BCDFloat are approximately 18 digits.private static Logger
Logger
class logger instancestatic int
Max_Exponent
Maximum supported Exponent + 1private L_Register.Operation_Type
Operation
Operation requested after this number was entered.private Calculator
Owner
private int
Parenthesis
Parenthesis opened before this number was entered - max is 3.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[]
Ten_Power
powers of 10 needed to move the decimal point for Format_Engineering.private static long
Two_Power_15
±1¹⁵private static long
Two_Power_31
2³¹private Number
Value
Value 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 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 (+-×÷ ... )@org.jetbrains.annotations.NotNull short[]
Format()
Format in standard format.static short @NotNull []
Format_Binary(Number Value)
Format Value in standard formatprivate static int
Format_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 String
Format_Serial(Number Value)
Format Value for use with Serial portprivate static String
Format_Serial_Float(BCDFloat Value)
Format Fraction Value for use with Serial portprivate static String
Format_Serial_Fraction(BCDFraction Value)
Format Fraction Value for use with Serial portprivate static long
Get_16bit(Number Value)
Converts a signed long into an 16 unsigned integerprivate static long
Get_32bit(Number Value)
Converts a signed long into an 32 unsigned integervoid
Inc_Parenthesis()
Increment parenthesis level (+-×÷ ... )(package private) boolean
Is_Finite()
check value is normal realL_Register.Operation_Type
Operation()
Get operation (+-×÷ ... )void
Operation(L_Register.Operation_Type Operation)
Set operation (+-×÷ ... )int
Parenthesis()
Get parenthesis level (+-×÷ ... )void
Parenthesis(int Parenthesis)
Set parenthesis level (+-×÷ ... )static Number
Parse_Serial(String Text)
parse a text representing a numbervoid
Set_NaN()
Set value of the register to NaNString
toString()
Convert object to string representationNumber
Value()
Temp_Value of the register.void
Value(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 Error
Format 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 Error
Format 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 Error
Format 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 Error
Converts 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 Error
Converts 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:
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
@NotNull public final @org.jetbrains.annotations.NotNull short[] Format() throws Error
Format in standard format.- Specified by:
Format
in interfaceIL_Register
- Returns:
- Formatted string
- Throws:
Error
-
Format_Print
@NotNull public final @org.jetbrains.annotations.NotNull short[] Format_Print() throws Error
Format in printer format- Specified by:
Format_Print
in interfaceIL_Register
- Returns:
- Formatted string
- Throws:
Error
-
Inc_Parenthesis
public void Inc_Parenthesis()
Increment parenthesis level (+-×÷ ... )- Specified by:
Inc_Parenthesis
in 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:
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
-
toString
@TestOnly public String toString()
Convert object to string representation- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
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
-
-