UnaryNot

The asdk.condition.UnaryNot class is used to negate another UnaryCondition. For example, this class can be used in conjuction with the PositiveNumber unary condition to determine if a number is negative.

The example below demonstrates how to use UnaryNot to extend the functionality of PositiveNumber:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var positiveNumber : asdk.condition.UnaryCondition = new asdk.condition.PositiveNumber();
var isNegativeCondition : asdk.condition.UnaryCondition = new asdk.condition.UnaryNot( positiveNumber );

var isNegativeOneNegative = isNegativeCondition.execute( -1 );
trace("isNegativeOneNegative: " + isNegativeOneNegative );
//displays isNegativeOneNegative: false in output window

var isZeroNegative = isNegativeCondition.execute( 0 );
trace("isZeroNegative: " + isZeroNegative );
//displays isZeroNegative: false in output window

var isOneNegative = isNegativeCondition.execute( 1 );
trace("isOneNegative: " + isOneNegative );
//displays isOneNegative: true in output window

This example is similar to the NegativeNumber example, but this time a UnaryNot condition is used to negate a PositiveNumber unary condition.