StringDigitList
class StringDigitList extends AbstractDigitList (View source)
Handles a list of digits provided as a string.
Properties
protected array | $digits | from AbstractDigitList | |
protected int[] | $valueMap | from AbstractDigitList | |
protected bool | $caseSensitive | from AbstractDigitList | |
protected bool | $stringConflict | from AbstractDigitList |
Methods
Sets the value map and determines if it's case sensitive.
Tells if there is conflict that prevents numbers from being represented as a string.
Returns the digit that represents the given value.
Creates a new instance of StringDigitList.
Details
in AbstractDigitList at line 29
protected
setValueMap(array $map)
Sets the value map and determines if it's case sensitive.
in AbstractDigitList at line 36
bool
hasStringConflict()
Tells if there is conflict that prevents numbers from being represented as a string.
in AbstractDigitList at line 41
bool
isCaseSensitive()
Tells if the digits are case sensitive or not.
in AbstractDigitList at line 46
array
getDigits()
Returns all the digits in the list.
in AbstractDigitList at line 51
mixed
getDigit(int $value)
Returns the digit that represents the given value.
in AbstractDigitList at line 62
int
getValue(mixed $digit)
Returns the value for the given digit.
in AbstractDigitList at line 77
int
count()
Returns the number of different digits.
at line 24
__construct(string $digits)
Creates a new instance of StringDigitList.
The list of digits must be provided as a string. Each character
represents a single digit and the position in the string represents the
value for that digit. For example, base 16 could be defined as
0123456789ABCDEF
.