new Equals( [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 Equals = system.rules.Equals ; var e ; ///// Compares objects. e = new Equals( 1 , 1 ) ; trace( e.eval() ) ; // true e = new Equals( 1 , 2 ) ; trace( e.eval() ) ; // false ///// Compares Rule objects. var cond1 = new BooleanRule( true ) ; var cond2 = new BooleanRule( false ) ; var cond3 = new BooleanRule( true ) ; e = new Equals( cond1 , cond1 ) ; trace( e.eval() ) ; // true e = new Equals( cond1 , cond2 ) ; trace( e.eval() ) ; // false e = new Equals( cond1 , cond3 ) ; trace( e.eval() ) ; // true ///// 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 Equals( o1 , o1 ) ; trace( e.eval() ) ; // true e = new Equals( o1 , o2 ) ; trace( e.eval() ) ; // false e = new Equals( o1 , o3 ) ; trace( e.eval() ) ; // true
Extends
Members
-
value1 :Object|system.rules.Rule|system.Equatable
-
The first value to evaluate.
Type:
- Object | system.rules.Rule | system.Equatable
- Default Value:
-
- null
-
value1 :Object|system.rules.Rule|system.Equatable
-
The first value to evaluate.
Type:
- Object | system.rules.Rule | system.Equatable
- Default Value:
-
- null
-
value2 :Object|system.rules.Rule|system.Equatable
-
The second value to evaluate.
Type:
- Object | system.rules.Rule | system.Equatable
- Default Value:
-
- null
-
value2 :Object|system.rules.Rule|system.Equatable
-
The second value to evaluate.
Type:
- Object | system.rules.Rule | system.Equatable
- Default Value:
-
- null
Methods
-
<static> Equals#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.