Digit class
Represents a digit in four bits of a single byte. This wastes four bits but that's a decent trade-off for simplicity and better anyway than the 4+ bytes allocated for a regular int.
Constructors
- Digit(int num)
-
Constructs a digit that matches the value of
num
. - Digit.char(String digitChar)
-
Constructs a digit from the character representing the digit.
factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toInt(
) → int - Returns the integer equivalent of this digit.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator +(
Digit addend) → int - Adds two digits together, returning the result as an int.
-
operator -(
Digit subtrahend) → int -
Subtracts
subtrahend
from this digit, returning the result as anint
. The result may be negative. -
operator <(
Digit other) → bool -
Tests whether this digit is less than
other
. -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Digit other) → bool -
Tests whether this digit is greater than
other
.
Static Properties
- codeUnit0 → int
-
The UTF-16 code unit of '0'.
final
- eight → Digit
-
The digit 8.
final
- five → Digit
-
The digit 5.
final
- four → Digit
-
The digit 4.
final
-
list
→ List<
Digit> -
A list of all the digits, ordered 0 through 9.
final
- nine → Digit
-
The digit 9.
final
- one → Digit
-
The digit 1.
final
- seven → Digit
-
The digit 7.
final
- six → Digit
-
The digit 6.
final
- three → Digit
-
The digit 3.
final
- two → Digit
-
The digit 2.
final
- zero → Digit
-
The digit 0.
final