You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Describes how the operator is modified: can be direct, ALL, or ANY
23
22
publicenumModifier:UInt{
24
-
25
23
case direct // Do a direct comparison
26
24
case all // ALL toMany.x = y
27
25
case any // ANY toMany.x = y
28
26
}
29
27
30
28
// Type basic set of operators defined. Most are obvious
31
29
publicenumOperator:UInt{
32
-
33
30
case lessThan // compare: returns NSOrderedAscending
34
31
case lessThanOrEqualTo // compare: returns NSOrderedAscending || NSOrderedSame
35
32
case greaterThan // compare: returns NSOrderedDescending
@@ -45,9 +42,9 @@ extension ComparisonPredicate {
45
42
case between
46
43
}
47
44
}
48
-
// Comparison predicates are predicates which do some form of comparison between the results of two expressions and return a BOOL. They take an operator, a left expression, and a right expression, and return the result of invoking the operator with the results of evaluating the expressions.
49
45
50
-
openclassComparisonPredicate:Predicate{
46
+
// Comparison predicates are predicates which do some form of comparison between the results of two expressions and return a BOOL. They take an operator, a left expression, and a right expression, and return the result of invoking the operator with the results of evaluating the expressions.
Copy file name to clipboardExpand all lines: Foundation/NSCompoundPredicate.swift
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -10,38 +10,38 @@
10
10
11
11
// Compound predicates are predicates which act on the results of evaluating other operators. We provide the basic boolean operators: AND, OR, and NOT.
Copy file name to clipboardExpand all lines: Foundation/NSExpression.swift
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -50,13 +50,14 @@ open class NSExpression : NSObject, NSSecureCoding, NSCopying {
50
50
NSUnimplemented()
51
51
}
52
52
53
-
public /*not inherited*/ init(format expressionFormat:String, argumentArray arguments:[AnyObject]){NSUnimplemented()}
53
+
public /*not inherited*/ init(format expressionFormat:String, argumentArray arguments:[Any]){NSUnimplemented()}
54
+
public /*not inherited*/ init(format expressionFormat:String, arguments argList:CVaListPointer){NSUnimplemented()}
54
55
55
-
public /*not inherited*/ init(forConstantValue obj:AnyObject?){NSUnimplemented()} // Expression that returns a constant value
56
+
public /*not inherited*/ init(forConstantValue obj:Any?){NSUnimplemented()} // Expression that returns a constant value
56
57
openclassfunc expressionForEvaluatedObject()->NSExpression{NSUnimplemented()} // Expression that returns the object being evaluated
57
58
public /*not inherited*/ init(forVariable string:String){NSUnimplemented()} // Expression that pulls a value from the variable bindings dictionary
58
59
public /*not inherited*/ init(forKeyPath keyPath:String){NSUnimplemented()} // Expression that invokes valueForKeyPath with keyPath
59
-
public /*not inherited*/ init(forFunction name:String, arguments parameters:[AnyObject]){NSUnimplemented()} // Expression that invokes one of the predefined functions. Will throw immediately if the selector is bad; will throw at runtime if the parameters are incorrect.
60
+
public /*not inherited*/ init(forFunction name:String, arguments parameters:[Any]){NSUnimplemented()} // Expression that invokes one of the predefined functions. Will throw immediately if the selector is bad; will throw at runtime if the parameters are incorrect.
@@ -98,40 +99,43 @@ open class NSExpression : NSObject, NSSecureCoding, NSCopying {
98
99
// two NSExpression instances representing CLLocations NSNumber
99
100
// length: an NSExpression instance representing a string NSNumber
100
101
101
-
public /*not inherited*/ init(forAggregate subexpressions:[AnyObject]){NSUnimplemented()} // Expression that returns a collection containing the results of other expressions
102
+
public /*not inherited*/ init(forAggregate subexpressions:[Any]){NSUnimplemented()} // Expression that returns a collection containing the results of other expressions
102
103
public /*not inherited*/ init(forUnionSet left:NSExpression, with right:NSExpression){NSUnimplemented()} // return an expression that will return the union of the collections expressed by left and right
103
104
public /*not inherited*/ init(forIntersectSet left:NSExpression, with right:NSExpression){NSUnimplemented()} // return an expression that will return the intersection of the collections expressed by left and right
104
105
public /*not inherited*/ init(forMinusSet left:NSExpression, with right:NSExpression){NSUnimplemented()} // return an expression that will return the disjunction of the collections expressed by left and right
105
-
public /*not inherited*/ init(forSubquery expression:NSExpression, usingIteratorVariable variable:String, predicate:AnyObject){NSUnimplemented()} // Expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifer returns true; variable is used as a local variable, and will shadow any instances of variable in the bindings dictionary, the variable is removed or the old value replaced once evaluation completes
106
-
public /*not inherited*/ init(forFunction target:NSExpression, selectorName name:String, arguments parameters:[AnyObject]?){NSUnimplemented()} // Expression that invokes the selector on target with parameters. Will throw at runtime if target does not implement selector or if parameters are wrong.
106
+
public /*not inherited*/ init(forSubquery expression:NSExpression, usingIteratorVariable variable:String, predicate:Any){NSUnimplemented()} // Expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifer returns true; variable is used as a local variable, and will shadow any instances of variable in the bindings dictionary, the variable is removed or the old value replaced once evaluation completes
107
+
public /*not inherited*/ init(forFunction target:NSExpression, selectorName name:String, arguments parameters:[Any]?){NSUnimplemented()} // Expression that invokes the selector on target with parameters. Will throw at runtime if target does not implement selector or if parameters are wrong.
public /*not inherited*/ init(forBlock block:(AnyObject?,[AnyObject],NSMutableDictionary?)->AnyObject, arguments:[NSExpression]?){NSUnimplemented()} // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
109
-
public /*not inherited*/ init(forConditional predicate:Predicate, trueExpression:NSExpression, falseExpression:NSExpression){NSUnimplemented()} // Expression that will return the result of trueExpression or falseExpression depending on the value of predicate
109
+
public /*not inherited*/ init(block:@escaping(Any?,[Any],NSMutableDictionary?)->Any, arguments:[NSExpression]?){NSUnimplemented()} // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
110
+
public /*not inherited*/ init(forConditional predicate:Any, trueExpression:NSExpression, falseExpression:NSExpression){NSUnimplemented()} // Expression that will return the result of trueExpression or falseExpression depending on the value of predicate
/*@NSCopying*/ openvaroperand:NSExpression{NSUnimplemented()} // the object on which the selector will be invoked (the result of evaluating a key path or one of the defined functions)
120
121
openvararguments:[NSExpression]?{NSUnimplemented()} // array of expressions which will be passed as parameters during invocation of the selector on the operand of a function expression
/*@NSCopying*/ openvarleft:NSExpression{NSUnimplemented()} // expression which represents the left side of a set expression
125
126
/*@NSCopying*/ openvarright:NSExpression{NSUnimplemented()} // expression which represents the right side of a set expression
126
127
127
128
/*@NSCopying*/ openvar`true`:NSExpression{NSUnimplemented()} // expression which will be evaluated if a conditional expression's predicate evaluates to true
128
129
/*@NSCopying*/ openvar`false`:NSExpression{NSUnimplemented()} // expression which will be evaluated if a conditional expression's predicate evaluates to false
// evaluate the expression using the object and bindings- note that context is mutable here and can be used by expressions to store temporary state for one predicate evaluation
0 commit comments