Model<OT extends ProgramOperation> class Null safety

Our model, the main entry point to this module. See the library-level documentation for a description, and an explanation of the model's structure.

Implemented types

Constructors

Model()

Properties

captureDebugLog bool
Starts or stops capturing debug log information. A debug log captures the calculator state, and subsequent keystrokes. It's meant to be a tool to facilitate bug reports.
read / write
cFlag bool
read / write, override
debugLog DebugLog?
read-only
display DisplayModel
final, late
displayLeadingZeros bool
read-only
displayMode DisplayMode
read / write
doubleWordStatus DoubleWordStatus
Gives a helper object for implementation of the double-integer multiply, remainder and divide operations.
read-only
gFlag bool
read / write, override
hashCode int
The hash code for this object. [...]
read-only, inherited
integerSignMode IntegerSignMode
read / write, override-getter
isFloatMode bool
read-only, override
isRunningProgram bool
read / write
lastX Value
read / write
maxInt BigInt
read-only, override
memory Memory<OT>
final, late
minInt BigInt
read-only, override
onIsPressed Observable<bool>
final
popSetResultX Value
Pop the stack and set X, setting lastX
write-only
popSetResultXF double
Pop the stack and set X from a Dart double, setting lastX
write-only
popSetResultXI BigInt
Pop the stack and set X from a signed BigInt, setting lastX
write-only
prgmFlag bool
read / write
program ProgramMemory<OT>
read-only
resultX Value
Set a result in X, which saves the old X value in lastX
write-only
resultXF double
write-only
resultXI BigInt
write-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
settings Settings
final, late
shift ShiftKey
read / write
signMask BigInt
read-only, override
signMode SignMode
read-only
wordMask BigInt
read-only, override
wordSize int
Set the word size, and fix up the values on the stack for the new size. A size of 0 is interpreted as 64, as per the 16C.
read / write, override-getter
x Value
read / write
xF double
Get x as a Dart double
read / write
xI BigInt
Get x as a signed BigInt
read / write
y Value
read / write
yF double
read / write
yI BigInt
read / write
z Value
read-only

Methods

compare(Value x, Value y) int
Compare two values according to the current sign mode
decodeJson(Map<String, dynamic> json, {required bool needsSave}) → void
Convert from a data structure that comes from JSON. If there's an error in the middle, it might be partially read, but not in a way that causes bad behavior in the calculator.
getFlag(int i) bool
getStackByIndex(int i) Value
initializeFromJsonOrUri(String linkOrJson) bool
isZero(Value v) bool
Determine if this value is 0 or, if applicable, -0. Not for use with an index register value, since it can have a different representation for -0 -- cf. Memory.isZeroI()
negateX() → void
Negate the value in x, according to the current sign mode.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
popStack() → void
pushStack() → void
"lift" stack, after which one can write to x
readFromPersistentStorage() Future<void>
reset() → void
Reset the calculator to its default state.
resetFromPersistentStorage() Future<void>
rotateStackDown() → void
the R key
rotateStackUp() → void
The R key
setFlag(int i, bool v) → void
setYZT(Value v) → void
swapXY() → void
toJson({bool comments = false}) Map<String, dynamic>
Convert to a data structure that can be serialized as JSON.
toString() String
A string representation of this object. [...]
inherited
tryParseValue(String s) Value?
Try to parse s consistent with the current display mode, giving a Value on success.
writeToPersistentStorage() Future<void>

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited