API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPComparisonPredicate Class Reference

CPComparisonPredicate is a subclass of CPPredicate used to compare expressions. More...

#import <CPComparisonPredicate.h>

+ Inheritance diagram for CPComparisonPredicate:

Instance Methods

(CPComparisonPredicateModifier- comparisonPredicateModifier
 
(SEL) - customSelector
 
(void) - encodeWithCoder:
 
(BOOL) - evaluateWithObject:
 
(BOOL) - evaluateWithObject:substitutionVariables:
 
(id) - initWithCoder:
 
(id) - initWithLeftExpression:rightExpression:customSelector:
 
(id) - initWithLeftExpression:rightExpression:modifier:type:options:
 
(BOOL) - isEqual:
 
(CPExpression- leftExpression
 
(unsigned) - options
 
(CPString- predicateFormat
 
(CPPredicateOperatorType- predicateOperatorType
 
(CPPredicate- predicateWithSubstitutionVariables:
 
(CPExpression- rightExpression
 
- Instance Methods inherited from CPPredicate
(CPString- description
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray- exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(id) - init
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPPredicate+ predicateWithLeftExpression:rightExpression:customSelector:
 
(CPPredicate+ predicateWithLeftExpression:rightExpression:modifier:type:options:
 
- Class Methods inherited from CPPredicate
(CPPredicate+ predicateWithFormat:
 
(CPPredicate+ predicateWithFormat:argumentArray:
 
(CPPredicate+ predicateWithFormat:arguments:
 
(CPPredicate+ predicateWithValue:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

Detailed Description

CPComparisonPredicate is a subclass of CPPredicate used to compare expressions.

A predicate to directly compare the left and right hand sides.

A predicate to compare all entries in the destination of a to-many relationship.

The left hand side must be a collection. The corresponding predicate compares each value in the left hand side with the right hand side, and returns NO when it finds the first mismatch—or YES if all match.

A predicate to match with any entry in the destination of a to-many relationship.

The left hand side must be a collection. The corresponding predicate compares each value in the left hand side against the right hand side and returns YES when it finds the first match—or NO if no match is found.

A case-insensitive predicate.

A diacritic-insensitive predicate.

A less-than predicate.

A less-than-or-equal-to predicate.

A greater-than predicate.

A greater-than-or-equal-to predicate.

An equal-to predicate.

A not-equal-to predicate.

A full regular expression matching predicate.

A simple subset of the matches predicate, similar in behavior to SQL LIKE.

A begins-with predicate.

An ends-with predicate.

A predicate to determine if the left hand side is in the right hand side.

For strings, returns YES if the left hand side is a substring of the right hand side. For collections, returns YES if the left hand side is in the right hand side.

Predicate that uses a custom selector that takes a single argument and returns a BOOL value.

The selector is invoked on the left hand side with the right hand side.

A predicate to determine if the left hand side contains the right hand side.

Returns YES if [lhs contains rhs]; the left hand side must be a CPExpression object that evaluates to a collection

A predicate to determine if the right hand side lies between bounds specified by the left hand side.

Returns YES if [lhs between rhs]; the right hand side must be an array in which the first element sets the lower bound and the second element the upper, inclusive. Comparison is performed using compare: or the class-appropriate equivalent.

Comparison predicates are predicates used to compare the results of two expressions. Comparison predicates take an operator, a left expression, and a right expression, and return as a BOOL the result of invoking the operator with the results of evaluating the expressions. Expressions are represented by instances of the CPExpression class.

Definition at line 2 of file CPComparisonPredicate.h.

Method Documentation

- (CPComparisonPredicateModifier) comparisonPredicateModifier
implementation

Returns the comparison predicate modifier for the receiver.

Returns
The comparison predicate modifier for the receiver.

Definition at line 265 of file CPComparisonPredicate.j.

- (SEL) customSelector
implementation

Returns the selector for the receiver.

Returns
The selector for the receiver, or NULL if there is none.

Definition at line 274 of file CPComparisonPredicate.j.

- (void) encodeWithCoder: (CPCoder coder
implementation

Provided by category CPComparisonPredicate(CPCoding).

Definition at line 541 of file CPComparisonPredicate.j.

- (BOOL) evaluateWithObject: (id)  object
implementation

Returns a Boolean value that indicates whether a given object matches the conditions specified by the receiver.

Parameters
objectThe object against which to evaluate the receiver.
Returns
YES if object matches the conditions specified by the receiver, otherwise NO.

Reimplemented from CPPredicate.

Definition at line 488 of file CPComparisonPredicate.j.

- (BOOL) evaluateWithObject: (id)  object
substitutionVariables: (CPDictionary variables 
implementation

Returns a Boolean value that indicates whether a given object matches the conditions specified by the receiver after substituting in the values in a given variables dictionary.

Parameters
objectThe object against which to evaluate the receiver.
variablesThe substitution variables dictionary. The dictionary must contain key-value pairs for all variables in the receiver.
Returns
YES if object matches the conditions specified by the receiver after substituting in the values in variables for any replacement tokens, otherwise NO.

Reimplemented from CPPredicate.

Definition at line 493 of file CPComparisonPredicate.j.

- (id) initWithCoder: (CPCoder coder
implementation

Provided by category CPComparisonPredicate(CPCoding).

Definition at line 525 of file CPComparisonPredicate.j.

- (id) initWithLeftExpression: (CPExpression left
rightExpression: (CPExpression right
customSelector: (SEL)  selector 
implementation

Initializes a predicate formed by combining given left and right expressions using a given selector.

Parameters
leftThe left hand side expression.
rightThe right hand side expression.
selectorThe selector to use for comparison. The method defined by the selector must take a single argument and return a BOOL value.
Returns
The receiver, initialized by combining the left and right expressions using selector.

Definition at line 211 of file CPComparisonPredicate.j.

- (id) initWithLeftExpression: (CPExpression left
rightExpression: (CPExpression right
modifier: (CPComparisonPredicateModifier modifier
type: (CPPredicateOperatorType type
options: (unsigned)  options 
implementation

Initializes a predicate to a given type formed by combining given left and right expressions using a given modifier and options.

Parameters
leftThe left hand expression.
rightThe right hand expression.
modifierThe modifier to apply.
typeThe predicate operator type.
optionsThe options to apply (see CPComparisonPredicate Options).
Returns
The receiver, initialized to a predicate of type type formed by combining the left and right expressions using the modifier and options.

Definition at line 237 of file CPComparisonPredicate.j.

- (BOOL) isEqual: (id)  anObject
implementation

Determines if anObject is functionally equivalent to the receiver.

Returns
YES if anObject is functionally equivalent to the receiver.

Reimplemented from CPObject.

Definition at line 394 of file CPComparisonPredicate.j.

- (CPExpression) leftExpression
implementation

Returns the left expression for the receiver.

Returns
The left expression for the receiver, or nil if there is none.

Definition at line 283 of file CPComparisonPredicate.j.

- (unsigned) options
implementation

Returns the options that are set for the receiver.

Returns
The options that are set for the receiver.

Definition at line 292 of file CPComparisonPredicate.j.

- (CPString) predicateFormat
implementation

Returns the receiver’s format string.

Returns
The receiver’s format string.

Reimplemented from CPPredicate.

Definition at line 315 of file CPComparisonPredicate.j.

- (CPPredicateOperatorType) predicateOperatorType
implementation

Returns the predicate type for the receiver.

Returns
Returns the predicate type for the receiver.

Definition at line 301 of file CPComparisonPredicate.j.

+ (CPPredicate) predicateWithLeftExpression: (CPExpression left
rightExpression: (CPExpression right
customSelector: (SEL)  selector 
implementation

Returns a new predicate formed by combining the left and right expressions using a given selector.

Parameters
leftThe left hand side expression.
rightThe right hand side expression.
selectorThe selector to use for comparison. The method defined by the selector must take a single argument and return a BOOL value.
Returns
A new predicate formed by combining the left and right expressions using selector.

Definition at line 185 of file CPComparisonPredicate.j.

+ (CPPredicate) predicateWithLeftExpression: (CPExpression left
rightExpression: (CPExpression right
modifier: (CPComparisonPredicateModifier modifier
type: (int)  type
options: (unsigned)  options 
implementation

Creates and returns a predicate of a given type formed by combining given left and right expressions using a given modifier and options.

Parameters
leftThe left hand expression.
rightThe right hand expression.
modifierThe modifier to apply.
typeThe predicate operator type.
optionsThe options to apply (see CPComparisonPredicate Options).
Returns
A new predicate of type type formed by combining the given left and right expressions using the modifier and options.

Definition at line 199 of file CPComparisonPredicate.j.

- (CPPredicate) predicateWithSubstitutionVariables: (CPDictionary variables
implementation

Returns a copy of the receiver with the receiver’s variables substituted by values specified in a given substitution variables dictionary.

Parameters
variablesThe substitution variables dictionary. The dictionary must contain key-value pairs for all variables in the receiver.
Returns
A copy of the receiver with the receiver’s variables substituted by values specified in variables.

Reimplemented from CPPredicate.

Definition at line 383 of file CPComparisonPredicate.j.

- (CPExpression) rightExpression
implementation

Returns the right expression for the receiver.

Returns
The right expression for the receiver, or nil if there is none.

Definition at line 310 of file CPComparisonPredicate.j.


The documentation for this class was generated from the following files: