Class: NotEquals

system.rules. NotEquals


new NotEquals( [value1] [, value2])

Used to perform a logical conjunction on two conditions and more.

Parameters:
Name Type Argument Default Description
value1 Object | system.rules.Rule | system.Equatable <optional>
null

The first value to evaluate.

value2 Object | system.rules.Rule | system.Equatable <optional>
null

The second value to evaluate.

Implements:
Example
var BooleanRule = system.rules.BooleanRule ;
var NotEquals      =  system.rules.NotEquals ;

var e ;

///// Compares objects.

e = new NotEquals( 1 , 1 ) ;
trace( e.eval() ) ; // false

e = new NotEquals( 1 , 2 ) ;
trace( e.eval() ) ; // true

///// Compares Rule objects.

var cond1 = new BooleanRule( true  ) ;
var cond2 = new BooleanRule( false ) ;
var cond3 = new BooleanRule( true  ) ;

e = new NotEquals( cond1 , cond1 ) ;
trace( e.eval() ) ; // false

e = new NotEquals( cond1 , cond2 ) ;
trace( e.eval() ) ; // true

e = new NotEquals( cond1 , cond3 ) ;
trace( e.eval() ) ; // false

///// Compares Equatable objects.

var equals = function( o )
{
    return this.id === o.id ;
}

var o1 = { id:1 , equals:equals } ;
var o2 = { id:2 , equals:equals } ;
var o3 = { id:1 , equals:equals } ;

e = new NotEquals( o1 , o1 ) ;
trace( e.eval() ) ; // false

e = new NotEquals( o1 , o2 ) ;
trace( e.eval() ) ; // true

e = new NotEquals( o1 , o3 ) ;
trace( e.eval() ) ; // false

Extends

Methods


<static> NotEquals#eval()

Evaluates the specified object.


eval()

Evaluates the specified condition.

Inherited From:
Implements:

toString()

Returns the string representation of this instance.

Inherited From:
Implements:
Returns:

the string representation of this instance.