Interface ICalculator
-
- All Superinterfaces:
net.sourceforge.uiq3.IPropertyNotifier,Runnable
- All Known Implementing Classes:
Calculator,Calculator,Calculator,Desktop_Calculator,Desktop_Calculator
public interface ICalculator extends Runnable, net.sourceforge.uiq3.IPropertyNotifier
Public calculator interface- Author:
- "Martin Krischik" «krischik@users.sourceforge.net»
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classICalculator.A_TypeAlpha register to merge key operations.static classICalculator.Display_TypeThe numeric Display currently displays the content of an Alpha register.
-
Field Summary
Fields Modifier and Type Field Description static intA_FormattedAlpha register to display messages.Convenience and performance constants — so we don't have to go though the enum for constant accessstatic intA_KeyAlpha register to merge key operations.Convenience and performance constants — so we don't have to go thou the enum for constant accessstatic intA_MessageAlpha register to display messages.Convenience and performance constants — so we don't have to go though the enum for constant accessstatic intA_NumericAlpha register to enter and display numeric results.Convenience and performance constants — so we don't have to go though the enum for constant accessstatic intA_TextAlpha register to enter and display textual results.Convenience and performance constants — so we don't have to go though the enum for constant access
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddisplayClear()Clear all alpha register.voiddisplayException(@NotNull Throwable Exception)display additional information's on the error. this is device and setup dependent.voiddisplayFormatted(short @NotNull [] Text)Display value as formatted textvoiddisplayKey(short @NotNull [] Text)* Display Key merge info.voiddisplayL()Reset current value DisplayvoiddisplayMessage(short @NotNull [] Text)Display texts as dual line message@NotNull ICalculator.Display_TypegetDisplayMode()Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formatted Displays the content of the L0 aka X register inside an alphabooleanisRunning()booleanisWaiting()is waiting in interactive mode for user input.intLast_Step()locate the last step to display the free steps or for debugging.voidLoad()Load Calculator StatevoidLoad(@NotNull String Filename)Load the current status of the systemdefault voidLoad(File Filename)Load the current status of the systemvoidreset()Reset the calculatordefault voidresetAll()performs a full reset by deleting ram and the cache file as well a reloading the cache file.voidrun()Start virtual CPUvoidSave()Save Calculator State to default filevoidSave(@NotNull String Filename)Save Calculator statedefault voidSave(File Filename)Save Calculator statevoidSave_Energy(boolean enable)Enable or disable energy savings mode. for example by reducing thread priority.voidsetDisplayMode(@NotNull ICalculator.Display_Type Display_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_Formatted Displays the content of the L0 aka X register inside an alphavoidstop()Stop virtual CPU and the thread it runs in
-
-
-
Field Detail
-
A_Formatted
static final int A_Formatted
Alpha register to display messages.Convenience and performance constants — so we don't have to go though the enum for constant access
- See Also:
- Constant Field Values
-
A_Key
static final int A_Key
Alpha register to merge key operations.Convenience and performance constants — so we don't have to go thou the enum for constant access
- See Also:
- Constant Field Values
-
A_Message
static final int A_Message
Alpha register to display messages.Convenience and performance constants — so we don't have to go though the enum for constant access
- See Also:
- Constant Field Values
-
A_Numeric
static final int A_Numeric
Alpha register to enter and display numeric results.Convenience and performance constants — so we don't have to go though the enum for constant access
- See Also:
- Constant Field Values
-
A_Text
static final int A_Text
Alpha register to enter and display textual results.Convenience and performance constants — so we don't have to go though the enum for constant access
- See Also:
- Constant Field Values
-
-
Method Detail
-
Last_Step
int Last_Step()
locate the last step to display the free steps or for debugging.
- Returns:
- last step
-
Load
void Load()
Load Calculator State
-
Load
void Load(@NotNull @NotNull String Filename)Load the current status of the system- Parameters:
Filename- Filename to load data from
-
Load
default void Load(@NotNull File Filename)Load the current status of the system- Parameters:
Filename- Filename to load data from
-
Save
void Save()
Save Calculator State to default file
-
Save
void Save(@NotNull @NotNull String Filename)Save Calculator state- Parameters:
Filename- filename to save to
-
Save
default void Save(@NotNull File Filename)Save Calculator state- Parameters:
Filename- filename to save to
-
Save_Energy
void Save_Energy(boolean enable)
Enable or disable energy savings mode. for example by reducing thread priority.
- Parameters:
enable- start saving energy
-
displayClear
void displayClear()
Clear all alpha register. And just calling "Clear" is not enough.
-
displayException
void displayException(@NotNull @NotNull Throwable Exception)display additional information's on the error. this is device and setup dependent.
- Parameters:
Exception- Exception to display
-
displayFormatted
void displayFormatted(short @NotNull [] Text)
Display value as formatted text- Parameters:
Text- to be displayed
-
displayKey
void displayKey(short @NotNull [] Text)
* Display Key merge info.- Parameters:
Text- info to be displayed
-
displayL
void displayL()
Reset current value Display
-
displayMessage
void displayMessage(short @NotNull [] Text)
Display texts as dual line message- Parameters:
Text- to be displayed
-
getDisplayMode
@NotNull @NotNull ICalculator.Display_Type getDisplayMode()
Current display mode- Display_Alpha
- Displays the content of the Alpha register.
- Display_L
- Displays the content of the L0 aka X register.
- Display_Formatted
- Displays the content of the L0 aka X register inside an alpha
- Returns:
- current display mode
-
setDisplayMode
void setDisplayMode(@NotNull @NotNull ICalculator.Display_Type Display_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_Formatted
- Displays the content of the L0 aka X register inside an alpha
- Parameters:
Display_Mode- new display mode
-
isRunning
boolean isRunning()
- Returns:
- true when calculator is running.
-
isWaiting
@TestOnly boolean isWaiting()
is waiting in interactive mode for user input.- Returns:
- true when in interactive mode.
-
reset
void reset()
Reset the calculator
-
resetAll
default void resetAll()
performs a full reset by deleting ram and the cache file as well a reloading the cache file.
-
stop
void stop()
Stop virtual CPU and the thread it runs in
-
-