IntegerDigitList
class IntegerDigitList extends AbstractDigitList (View source)
Handles a list of digits defined according to number base.
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 IntegerDigitList.
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 42
__construct(int $radix)
Creates a new instance of IntegerDigitList.
The digit list is defined by giving the radix (i.e. base) for the number system that defines the number of digits in the digit list. The actual digits are determined based on the given number.
If the given radix is 62 or less, the digits from the list 0-9A-Za-z are used. The digits are case insensitive, if the radix is 36 or less.
If the radix is 64, then the digits from the base64 standard are used. Base64 is always case sensitive.
If the radix is 63 or 65 to 256, then digits are represented by a single byte with equal byte value.
If the radix is 257 or greater, then each digit is represented by a string of #NNN (where NNN is the value of the digit). Each string has equal length, which depends on the given radix.