The asdk.condition.NegativeNumber
class is used to test for a negative number condition. It provides an implementation of the UnaryCondition interface that when
executed will determine whether the operand passed to the execute method is negative. This allows for encapsulation of the
logic for determining whether or not a number is negative. The example below demonstrates the use of this class:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
var isNegativeCondition : UnaryCondition = new NegativeNumber(); |
In this example only the last call to the execute method returns true when the number -1 is tested as a negative number.