LimitedOperation class Null safety
Operations that do something when the key is pressed, even when the calculator is in program entry state. They're called "limited," because the set of handleXXX() calls is limited to those supported by ProgramEntry.
It might seem counter-intuitive, but all Limited operations are NormalOperations. Normal operations are the operations whose pressed functions execute on an ActiveState, either Resting or DigitEntry. Limited operations have pressed callbacks that execute on a LimitedState, and ActiveState is a subtype of LimitedState. Therefore, NormalOperation is, conceptually, a supertype of LimitedOperation - there's a contravariant relationship between the operations and the types, because the operations, in essence, take an operation as argument.
- Inheritance
-
- Object
- ProgramOperation
- Operation
- NoArgOperation
- LimitedOperation
- Implemented types
- Implementers
Constructors
- LimitedOperation({required void pressed(LimitedState), required String name, bool endsDigitEntry = true})
Properties
- arg → Arg
-
A description of this arguments operation, or ArgDone if there is none.
For example, the STO operation has an argument to indicate which register
to store to.
read-onlyinherited
- argShift → ProgramOperation?
-
If used as an argument, the shift key needed for that argument.
Rare: sto g
and rcl g do this. read-onlyinherited -
complexCalc
→ (void Function(Model<
ProgramOperation> m)?) -
The calculation performed when the calculator is in complex mode.
read-onlyoverride
- debugLogId ↔ int
-
latefinalinherited
- endsDigitEntry → bool
-
final
-
floatCalc
→ (void Function(Model<
ProgramOperation> m)?) -
The calculation performed when the calculator is in floating-point mode.
read-onlyoverride
- hashCode → int
-
The hash code for this object.
read-onlyinherited
-
intCalc
→ (void Function(Model<
ProgramOperation> m)?) -
The calculation performed when the calculator is in integer mode.
read-onlyoverride
- isShift → bool
-
Is this the f or g shift key?
read-onlyinherited
- maxOneByteOpcodes → int
-
read-onlyinherited
- name → String
-
Human-readable name for program listing
finalinherited
- numericValue → int?
-
Give the numeric value of a number key, or one of the 15C's
letters (which are 20..24).
cf. tests.dart, SelfTests.testNumbers().
read-onlyinherited
- opcode ↔ int
-
latefinalinherited
- programDisplay ↔ String
-
latefinalinherited
- programListing ↔ String
-
latefinalinherited
- programListingArgName → String?
-
Name for this key as an arg in the program listing, if other than the
default.
read-onlyinherited
- rcName ↔ String
-
The row/column "name", which for digits looks like " 1".
latefinalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
beforeCalculate(
Resting resting) → void -
inherited
-
calcDisabled(
Controller controller) → bool -
By default, operations, if present, work for all kinds of controllers,
but cf. BranchingOperation
inherited
-
getCalculation<
T extends ProgramOperation> (Model< ProgramOperation> m, DisplayModeSelector<(void Function(Model< selector) → (void Function(Model<ProgramOperation> )?), T>ProgramOperation> )?) -
override
-
handleOpBeforeCalculate(
Model< ProgramOperation> m, void opBeforeCalculate()) → void -
Execute the beforeCalculate function of the operation. Normally it
just executes, but some 15C operations can be deferred; this method
can be overridden to do that.
inherited
-
init(
int registerBase, {required OpInitFunction f, required ProgramOperation? shift, required bool argDot, required ProgramOperation? arg, required bool userMode}) → void -
inherited
-
liftStackIfEnabled(
Model< ProgramOperation> m) → bool -
override
-
makeInputState(
Arg arg, Controller c, LimitedState fromState) → ControllerState -
inherited
-
matches(
ProgramOperation key, bool userMode) → Arg? -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
possiblyAlterStackLift(
Controller c) → void -
Either enable or disable stack lift, if appropriate, after this
operation's calculation is done. This will not be called if this
operation doesn't have a calculation (intCalc or floatCalc on itself,
or on its argument).
inherited
-
pressed(
LimitedState arg) → void -
What to do when the key is pressed.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited