NumberComparator
class NumberComparator extends Comparator
NumberComparator compiles a simple comparison to an anonymous subroutine, which you can call with a value to be tested again.
Now this would be very pointless, if NumberCompare didn't understand magnitudes.
The target value may use magnitudes of kilobytes (k, ki), megabytes (m, mi), or gigabytes (g, gi). Those suffixed with an i use the appropriate 2**n version in accordance with the IEC standard: http://physics.nist.gov/cuu/Units/binary.html
Based on the Perl Number::Compare module.
Methods
__construct(string $test)
Constructor.
Details
in Comparator at line line 29
string
getTarget()
Gets the target value.
in Comparator at line line 39
setTarget(string $target)
Sets the target value.
in Comparator at line line 49
string
getOperator()
Gets the comparison operator.
in Comparator at line line 61
setOperator(string $operator)
Sets the comparison operator.
in Comparator at line line 81
bool
test(mixed $test)
Tests against the target.
at line line 44
__construct(string $test)
Constructor.