Class A_Register
- java.lang.Object
-
- net.sourceforge.uiq3.fx603p.Owned_Operation
-
- net.sourceforge.uiq3.fx603p.Programmable_Operation
-
- net.sourceforge.uiq3.fx603p.Op_M
-
- net.sourceforge.uiq3.fx603p.A_Register
-
- All Implemented Interfaces:
IA_Register,IClear,IOperation,IOwned_Operation,IProgrammable_Operation,IProgrammable_Operation,ITraceable
public final class A_Register extends Op_M implements IA_Register, ITraceable
Alpha register (16 characters).
Possible content:
111111 0123456789012345 ABCDEFGHIJKLMNIO -0.123456789⁻¹² -1234567890.⁻¹² -12°34"56.78' __DF_ABCDEF_____- Author:
- "Martin Krischik" «krischik@users.sourceforge.net»
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sourceforge.uiq3.calculator.IA_Register
IA_Register.Mode_Type
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intAlpha_EndLast Keyboard_Alpha characterprivate static intAlpha_StartFirst Keyboard_Alpha characterprivate intarX_CountCount the amount of arx # characters.private net.sourceforge.uiq3.calculator.ICalculator.DisplayTypearX_ModeCurrent 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 alphaprivate static short @NotNull []Bin_0_TextDefault text for the numeric displayprivate static short @NotNull []Dec_0_TextDefault text for the numeric displayprivate intDisplay_CountCount the amount of characters inserted to the display.static intDisplay_SizeThe Casio display holds 16 main characters.private short @NotNull []Display_ValueAlpha Register display Valuestatic StringDISPLAY_VALUEprivate static intExponent_EndLast Mode_Exponent character(package private) static intExponent_StartFirst Mode_Exponent characterprivate static intFile_Display_Sizelength of filename(package private) static intFile_EndEnd for filenameprivate static intFile_StartStart for filename(package private) static short @NotNull []Float_0_TextDefault text for the numeric displayprivate static short @NotNull []Hex_0_TextDefault text for the numeric displayprivate static LoggerLoggerClass logger instance.private IA_Register.Mode_TypeModealpha register entry mode Mode_Normal normal numeric entry mode Mode_Fraction fraction entry mode Mode_Exponent exponent entry mode Mode_Begin_Alpha begins alpha mode Keyboard_Alpha alpha entry modeprivate static @NotNull StringMode_ErrorError Message displayed on using the wrong alpha mode!(package private) static short @NotNull []Null_TextDefault text for the numeric display(package private) static intNumeric_EndLast Keyboard_Alpha character(package private) static intNumeric_StartFirst Keyboard_Alpha character (0)private static short @NotNull []Oct_0_TextDefault text for the numeric displayprivate intPrinter_CountCount the amount of characters inserted to the printer.static intPrinter_SizeLast Printable characterprivate short @Nullable []Printer_Valuevalue of the register for use with printer or tape interface.private PropertyChangeSupportpropertyChangeSupportHandle property changes.private intStart_CharLimit Alpha text to Start_Charstatic intStep_Display_SizeThe Casio display holds 4 step characters.private static StringTAGClass logger tag.-
Fields inherited from class net.sourceforge.uiq3.fx603p.Op_M
Is_M_Register, Register
-
Fields inherited from class net.sourceforge.uiq3.fx603p.Owned_Operation
Owner
-
Fields inherited from interface net.sourceforge.uiq3.fx603p.IProgrammable_Operation
No_Display
-
-
Constructor Summary
Constructors Constructor Description A_Register(@NotNull Calculator Owner)Create Keyboard_Alpha Register
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAdd_Negative()toggle plus / minus for either mantissa or exponent.voidAdd_Negative_Float()toggle plus / minus for either mantissa or exponent.voidAdd_Numeric(short Digit)Add a numeric value - this is a non scrolling operation.voidAdd_Numeric_BaseN(short Digit, int Base, short Character, int Start)Add a numeric value - this is a non scrolling operation.voidAdd_Numeric_Float(short Digit)Add a numeric value - this is a non scrolling operation.voidAdd_Numeric_Fraction(short Digit)Add a numeric value - this is a non scrolling operation.(package private) voidAssign(A_Register Right)voidClear(boolean AC)Clear content of RegistervoidClear_Display_Value(int From, int To)Clear content of RegistervoidClear_Numeric(boolean AC)Add a numeric value - this is a non scrolling operation.private voidClear_Numeric(boolean AC, short @NotNull [] Clear_Text)Clear content of RegistervoidClear_Print_Value()Clear content of RegistervoidCreate_Print_Value()Create the optional print value which can be up to 40 characters.@NotNull StringDebug_String()short @NotNull []Display(short Opcode)Display operation in program mode.intDisplay_Count()Count the amount of characters.voidDisplay_Count(int Char_Count)Count the amount of characters.voidDisplay_Message(short @NotNull [] Text)Display an informative message until next key is pressed.voidExecute(short Opcode)Execute virtual CPU commandvoidFile_Type(short @NotNull [] Program, short @NotNull [] File_Type, short @NotNull [] File_Name)Value of the register - only the display part.short @NotNull []Filename_Value()Get value of the register for use with as filename.(package private) intGet_arX_Count()Count the amount of arx # characters.private short @NotNull []Get_Display(net.sourceforge.uiq3.calculator.ICalculator.DisplayType Display_Mode)Get Content of Display.(package private) static NumberGet_Numeric_Value_BaseN(short @NotNull [] Decomposed_Text, int Base, short Character)Get value of the register for use with as BCD.(package private) static NumberGet_Numeric_Value_Float(short[] Decomposed_Text)Get value of the register for use with as BCD.(package private) static NumberGet_Numeric_Value_Fraction(short[] Decomposed_Text)Get value of the register for use with as BCD.voidInsert(short Character)Insert a single characterintInsert(short @NotNull [] Text)Insert content of an String.voidInsert_X()Insert content of L0 aka X register into the string.voidLimit_Alpha(int Num_Char)Limit Alpha text to Start_Char@NotNull IA_Register.Mode_TypeMode()Get alpha register entry modevoidMode(@NotNull IA_Register.Mode_Type Mode)Set alpha register entry mode Mode_Normal normal numeric entry mode Mode_Fraction fraction entry mode Mode_Exponent exponent entry mode Mode_Begin_Alpha begins alpha mode Keyboard_Alpha alpha entry modeNumberNumeric_Value()Get value of the register for use with as BCD value.short @NotNull []Print_Value()Get value of the register for use with printer or tape interface.voidPrint_Value(short @NotNull [] Value, int Size)Set value of the register for use with printer or tape interface.intPrinter_Count()Count the amount of characters inserted to the printer.voidPrinter_Count(int Char_Count)Count the amount of characters inserted to the printer.voidStart_Alpha()Start a new alpha run.(package private) intStart_Char()start character if charachter count is limitedvoidStart_Decimal_Fraction()start to enter the part behind the fraction mark pointvoidStart_Denominator()start to enter the a true fraction(package private) voidStart_DMS()Display an informative message until next key is pressed.voidStart_Exponent()Start to enter the exponent.private static intStart_Of_String(short @NotNull [] Text)find start of data in string.@NotNull StringToken(short Opcode)string representation suitable for use with serial I/O.@NotNull StringtoString()String representationvoidTrace()Trace current valueshort @NotNull []Value()Get value of the register for use with display.voidValue(int @NotNull [] Value)Set value of the register.voidValue(short @NotNull [] Value)Value of the register.-
Methods inherited from class net.sourceforge.uiq3.fx603p.Owned_Operation
µReset, µReset
-
-
-
-
Field Detail
-
DISPLAY_VALUE
public static final String DISPLAY_VALUE
- See Also:
- Constant Field Values
-
Alpha_Start
private static final int Alpha_Start
First Keyboard_Alpha character- See Also:
- Constant Field Values
-
Bin_0_Text
private static final short @NotNull [] Bin_0_Text
Default text for the numeric display
-
Dec_0_Text
private static final short @NotNull [] Dec_0_Text
Default text for the numeric display
-
Exponent_End
private static final int Exponent_End
Last Mode_Exponent character
-
File_Display_Size
private static final int File_Display_Size
length of filename- See Also:
- Constant Field Values
-
File_Start
private static final int File_Start
Start for filename- See Also:
- Constant Field Values
-
Hex_0_Text
private static final short @NotNull [] Hex_0_Text
Default text for the numeric display
-
Logger
private static final Logger Logger
Class logger instance.
-
Mode_Error
@NotNull private static final @NotNull String Mode_Error
Error Message displayed on using the wrong alpha mode!
-
Oct_0_Text
private static final short @NotNull [] Oct_0_Text
Default text for the numeric display
-
TAG
private static final String TAG
Class logger tag.
-
Alpha_End
static final int Alpha_End
Last Keyboard_Alpha character
-
Exponent_Start
static final int Exponent_Start
First Mode_Exponent character
-
File_End
static final int File_End
End for filename- See Also:
- Constant Field Values
-
Float_0_Text
static final short @NotNull [] Float_0_Text
Default text for the numeric display
-
Null_Text
static final short @NotNull [] Null_Text
Default text for the numeric display
-
Numeric_End
static final int Numeric_End
Last Keyboard_Alpha character
-
Numeric_Start
static final int Numeric_Start
First Keyboard_Alpha character (0)
-
Display_Size
public static final int Display_Size
The Casio display holds 16 main characters.- See Also:
- Constant Field Values
-
Printer_Size
public static final int Printer_Size
Last Printable character- See Also:
- Constant Field Values
-
Step_Display_Size
public static final int Step_Display_Size
The Casio display holds 4 step characters.- See Also:
- Constant Field Values
-
Display_Value
private final short @NotNull [] Display_Value
Alpha Register display Value
-
Display_Count
private int Display_Count
Count the amount of characters inserted to the display. Grows indefinitely.
-
Mode
@NotNull private IA_Register.Mode_Type Mode
alpha register entry mode- Mode_Normal
- normal numeric entry mode
- Mode_Fraction
- fraction entry mode
- Mode_Exponent
- exponent entry mode
- Mode_Begin_Alpha
- begins alpha mode
- Keyboard_Alpha
- alpha entry mode
-
Printer_Count
private int Printer_Count
Count the amount of characters inserted to the printer. Stops at max printout length.
-
Printer_Value
private short @Nullable [] Printer_Value
value of the register for use with printer or tape interface.
-
Start_Char
private int Start_Char
Limit Alpha text to Start_Char
-
arX_Count
private int arX_Count
Count the amount of arx # characters.
-
arX_Mode
@NotNull private net.sourceforge.uiq3.calculator.ICalculator.DisplayType arX_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_Formated
- Displays the content of the L0 aka X register inside an alpha
-
propertyChangeSupport
private final PropertyChangeSupport propertyChangeSupport
Handle property changes.
-
-
Constructor Detail
-
A_Register
public A_Register(@NotNull @NotNull Calculator Owner)Create Keyboard_Alpha Register- Parameters:
Owner- Calculator
-
-
Method Detail
-
Get_Numeric_Value_BaseN
@NotNull static Number Get_Numeric_Value_BaseN(short @NotNull [] Decomposed_Text, int Base, short Character)
Get value of the register for use with as BCD.- Parameters:
Base- Numeric Base (2, 8, 16)Character- Character representing 0- Returns:
- current value
-
Get_Numeric_Value_Float
@NotNull static Number Get_Numeric_Value_Float(short[] Decomposed_Text) throws Error
Get value of the register for use with as BCD.- Returns:
- current value
- Throws:
Error
-
Get_Numeric_Value_Fraction
@NotNull static Number Get_Numeric_Value_Fraction(short[] Decomposed_Text) throws Error
Get value of the register for use with as BCD.- Returns:
- current value
- Throws:
Error
-
Start_Of_String
private static int Start_Of_String(short @NotNull [] Text)
find start of data in string.- Parameters:
Text- Text to find begin in.- Returns:
- position of first non space character
-
Add_Negative
public final void Add_Negative()
toggle plus / minus for either mantissa or exponent.- Specified by:
Add_Negativein interfaceIA_Register
-
Add_Negative_Float
public final void Add_Negative_Float()
toggle plus / minus for either mantissa or exponent.
-
Add_Numeric
public final void Add_Numeric(short Digit) throws Op_ErrorAdd a numeric value - this is a non scrolling operation.- Specified by:
Add_Numericin interfaceIA_Register- Parameters:
Digit- the digit to add- Throws:
Op_Error- something went wrong
-
Add_Numeric_BaseN
public final void Add_Numeric_BaseN(short Digit, int Base, short Character, int Start) throws Op_ErrorAdd a numeric value - this is a non scrolling operation.- Parameters:
Digit- the digit to addBase- The calculation BaseCharacter- The base character to use. Either Alpha_Num_0 or Font.Hex_0Start- Start of numeric String- Throws:
Op_Error- something went wrong
-
Add_Numeric_Float
public final void Add_Numeric_Float(short Digit) throws Op_ErrorAdd a numeric value - this is a non scrolling operation.- Parameters:
Digit- the digit to add- Throws:
Op_Error- something went wrong
-
Add_Numeric_Fraction
public final void Add_Numeric_Fraction(short Digit) throws Op_ErrorAdd a numeric value - this is a non scrolling operation.- Parameters:
Digit- the digit to add- Throws:
Op_Error- something went wrong
-
Assign
void Assign(A_Register Right)
-
Clear
public final void Clear(boolean AC)
Clear content of Register- Specified by:
Clearin interfaceIClear- Overrides:
Clearin classOp_M- Parameters:
AC- true when AC (all clear) is requested.- See Also:
IClear.Clear(boolean)
-
Clear_Display_Value
public final void Clear_Display_Value(int From, int To)Clear content of Register- Specified by:
Clear_Display_Valuein interfaceIA_Register- Parameters:
From- First character to cleanTo- Last character to clean
-
Clear_Numeric
public final void Clear_Numeric(boolean AC)
Add a numeric value - this is a non scrolling operation.- Parameters:
AC- true when AC (all clear) is requested.- See Also:
IClear.Clear(boolean)
-
Clear_Numeric
private void Clear_Numeric(boolean AC, short @NotNull [] Clear_Text)Clear content of Register- Parameters:
AC- true when AC (all clear) is requested.Clear_Text- TExt used to clear the Register- See Also:
IClear.Clear(boolean)
-
Clear_Print_Value
public final void Clear_Print_Value()
Clear content of Register- Specified by:
Clear_Print_Valuein interfaceIA_Register- See Also:
IClear.Clear(boolean)
-
Create_Print_Value
public final void Create_Print_Value()
Create the optional print value which can be up to 40 characters.- Specified by:
Create_Print_Valuein interfaceIA_Register
-
Debug_String
@TestOnly @NotNull public @NotNull String Debug_String()
- Specified by:
Debug_Stringin interfaceITraceable- Returns:
- string representation of the instance suitable for debugging.
-
Display
public final short @NotNull [] Display(short Opcode) throws Op_ErrorDisplay operation in program mode.- Specified by:
Displayin interfaceIProgrammable_Operation- Parameters:
Opcode- Virtual CPU Operation to be executed- Returns:
- String to be displayed
- Throws:
Op_Error- See Also:
IProgrammable_Operation.Display(short)
-
Display_Count
public final int Display_Count()
Count the amount of characters.- Specified by:
Display_Countin interfaceIA_Register- Returns:
- amount of characters
-
Display_Count
public final void Display_Count(int Char_Count)
Count the amount of characters.- Specified by:
Display_Countin interfaceIA_Register- Parameters:
Char_Count- amount of characters
-
Display_Message
public final void Display_Message(short @NotNull [] Text)
Display an informative message until next key is pressed.- Specified by:
Display_Messagein interfaceIA_Register- Parameters:
Text- Test to be displayed
-
Execute
public final void Execute(short Opcode) throws ErrorExecute virtual CPU command- Specified by:
Executein interfaceIOperation- Overrides:
Executein classOp_M- Parameters:
Opcode- Virtual CPU Operation to be executed- Throws:
Error- general calculator errorError- See Also:
Op_M.Execute(short)
-
File_Type
public final void File_Type(short @NotNull [] Program, short @NotNull [] File_Type, short @NotNull [] File_Name)Value of the register - only the display part.- Parameters:
File_Type- new value
-
Filename_Value
public final short @NotNull [] Filename_Value()
Get value of the register for use with as filename.- Specified by:
Filename_Valuein interfaceIA_Register- Returns:
- current value
-
Get_Display
private final short @NotNull [] Get_Display(@NotNull net.sourceforge.uiq3.calculator.ICalculator.DisplayType Display_Mode) throws Error, IllegalArgumentExceptionGet Content of Display.
- Parameters:
Display_Mode- Last or Current Display mode- Returns:
- Content of Display
- Throws:
ErrorIllegalArgumentException
-
Get_arX_Count
final int Get_arX_Count()
Count the amount of arx # characters.- Returns:
- Return amount arX aka # characters
-
Insert
public void Insert(short Character) throws ErrorInsert a single character- Parameters:
Character- an Character- Throws:
Error
-
Insert
public final int Insert(short @NotNull [] Text) throws ErrorInsert content of an String.
- Specified by:
Insertin interfaceIA_Register- Parameters:
Text- Text to insert without leading spaces and exponent- Returns:
- Characters inserted
- Throws:
Error
-
Insert_X
public void Insert_X() throws ErrorInsert content of L0 aka X register into the string.- Specified by:
Insert_Xin interfaceIA_Register- Throws:
Error
-
Limit_Alpha
public final void Limit_Alpha(int Num_Char)
Limit Alpha text to Start_Char- Specified by:
Limit_Alphain interfaceIA_Register- Parameters:
Num_Char- amount of char to enter
-
Mode
@NotNull public final @NotNull IA_Register.Mode_Type Mode()
Get alpha register entry mode- Specified by:
Modein interfaceIA_Register- Returns:
- Mode_Normal
- normal numeric entry mode
- Mode_Fraction
- fraction entry mode
- Mode_Exponent
- exponent entry mode
- Mode_Begin_Alpha
- begins alpha mode
- Keyboard_Alpha
- alpha entry mode
-
Mode
public final void Mode(@NotNull @NotNull IA_Register.Mode_Type Mode)Set alpha register entry mode- Mode_Normal
- normal numeric entry mode
- Mode_Fraction
- fraction entry mode
- Mode_Exponent
- exponent entry mode
- Mode_Begin_Alpha
- begins alpha mode
- Keyboard_Alpha
- alpha entry mode
- Specified by:
Modein interfaceIA_Register- Parameters:
Mode- new register mode
-
Numeric_Value
@NotNull public final Number Numeric_Value() throws Error
Get value of the register for use with as BCD value.- Specified by:
Numeric_Valuein interfaceIA_Register- Returns:
- current value
- Throws:
Error- something went wrong
-
Print_Value
public final short @NotNull [] Print_Value()
Get value of the register for use with printer or tape interface.
- Specified by:
Print_Valuein interfaceIA_Register- Returns:
- current value
-
Print_Value
public final void Print_Value(short @NotNull [] Value, int Size)Set value of the register for use with printer or tape interface. Also contains a backup of the alpha string for the append function
- Specified by:
Print_Valuein interfaceIA_Register- Parameters:
Value- ValueSize- Characters used
-
Printer_Count
public final int Printer_Count()
Count the amount of characters inserted to the printer. Stops at max printout length.
- Specified by:
Printer_Countin interfaceIA_Register- Returns:
- amount of characters in print
-
Printer_Count
public final void Printer_Count(int Char_Count)
Count the amount of characters inserted to the printer. Stops at max printout length.
- Specified by:
Printer_Countin interfaceIA_Register- Parameters:
Char_Count- amount of characters to print
-
Start_Alpha
public final void Start_Alpha()
Start a new alpha run. This flag is needed for proper handling of the ; (append) token.
- Specified by:
Start_Alphain interfaceIA_Register
-
Start_Char
final int Start_Char()
start character if charachter count is limited
- Returns:
- amount of characters
-
Start_DMS
final void Start_DMS()
Display an informative message until next key is pressed.
-
Start_Decimal_Fraction
public final void Start_Decimal_Fraction()
start to enter the part behind the fraction mark point
- Specified by:
Start_Decimal_Fractionin interfaceIA_Register
-
Start_Denominator
public final void Start_Denominator() throws Errorstart to enter the a true fraction- Throws:
Error
-
Start_Exponent
public final void Start_Exponent()
Start to enter the exponent.- Specified by:
Start_Exponentin interfaceIA_Register
-
Token
@NotNull public @NotNull String Token(short Opcode) throws Op_Error
string representation suitable for use with serial I/O.
- Specified by:
Tokenin interfaceIProgrammable_Operation- Overrides:
Tokenin classProgrammable_Operation- Parameters:
Opcode- Virtual CPU Operation to be executed- Returns:
- pure ASCII String
- Throws:
Op_Error
-
Trace
public void Trace()
Trace current value- Specified by:
Tracein interfaceITraceable
-
Value
public final short @NotNull [] Value()
Get value of the register for use with display.- Specified by:
Valuein interfaceIA_Register- Returns:
- clone of current value
-
Value
public final void Value(int @NotNull [] Value)
Set value of the register.- Parameters:
Value- new value
-
Value
public final void Value(short @NotNull [] Value)
Value of the register.- Specified by:
Valuein interfaceIA_Register- Parameters:
Value- new value
-
toString
@NotNull @TestOnly public @NotNull String toString()
String representation- Overrides:
toStringin classOwned_Operation- Returns:
- String representation
- See Also:
Object.toString()
-
-