Method Summary
-
string
format($string, $number)
For the choice string, and a number, find and return the string that
satisfied the set within the choices.
-
boolean
isValid($number, $set)
Determines if the given number belongs to a given set
-
isValidSetNotation($number, $set)
-
array
parse($string)
Parses a choice string and get a list of sets and a list of strings
corresponding to the sets.
-
__construct()
Constructor.
Method Details
-
(string) format ($string, $number)
Browse code
| $string |
the choices string.
|
| $number |
the number to test.
|
For the choice string, and a number, find and return the string that
satisfied the set within the choices.
returns the choosen string.
-
(boolean) isValid ($number, $set)
Browse code
| $number |
the number to test.
|
| $set |
the set, in set notation.
|
Determines if the given number belongs to a given set
returns true if number is in the set, false otherwise.
-
isValidSetNotation ($number, $set)
Browse code
-
(array) parse ($string)
Browse code
| $string |
the string containing the choices
|
Parses a choice string and get a list of sets and a list of strings
corresponding to the sets.
returns array($sets, $strings)
-
Constructor.
|