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

CPCompoundPredicate is a subclass of CPPredicate used to represent logical “gate” operations (AND/OR/NOT) and comparison operations. More...

#import <CPCompoundPredicate.h>

+ Inheritance diagram for CPCompoundPredicate:

Instance Methods

(CPCompoundPredicateType- compoundPredicateType
 
(void) - encodeWithCoder:
 
(BOOL) - evaluateWithObject:
 
(BOOL) - evaluateWithObject:substitutionVariables:
 
(id) - initWithCoder:
 
(id) - initWithType:subpredicates:
 
(BOOL) - isEqual:
 
(CPString- predicateFormat
 
(CPPredicate- predicateWithSubstitutionVariables:
 
(CPArray- subpredicates
 
- 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+ andPredicateWithSubpredicates:
 
(CPPredicate+ notPredicateWithSubpredicate:
 
(CPPredicate+ orPredicateWithSubpredicates:
 
- 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

CPCompoundPredicate is a subclass of CPPredicate used to represent logical “gate” operations (AND/OR/NOT) and comparison operations.

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

Comparison operations are based on two expressions, as represented by instances of the CPExpression class. Expressions are created for constant values, key paths, and so on.

A compound predicate with 0 elements evaluates to TRUE, and a compound predicate with a single sub-predicate evaluates to the truth of its sole subpredicate.

Definition at line 2 of file CPCompoundPredicate.h.

Method Documentation

+ (CPPredicate) andPredicateWithSubpredicates: (CPArray subpredicates
implementation

Returns a new predicate formed by AND-ing the predicates in a given array.

Parameters
subpredicatesAn array of CPPredicate objects.
Returns
A new predicate formed by AND-ing the predicates specified by subpredicates.

Definition at line 96 of file CPCompoundPredicate.j.

- (CPCompoundPredicateType) compoundPredicateType
implementation

Returns the predicate type for the receiver.

Returns
The predicate type for the receiver.

Definition at line 116 of file CPCompoundPredicate.j.

- (void) encodeWithCoder: (CPCoder coder
implementation

Provided by category CPCompoundPredicate(CPCoding).

Definition at line 256 of file CPCompoundPredicate.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 190 of file CPCompoundPredicate.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 195 of file CPCompoundPredicate.j.

- (id) initWithCoder: (CPCoder coder
implementation

Provided by category CPCompoundPredicate(CPCoding).

Definition at line 244 of file CPCompoundPredicate.j.

- (id) initWithType: (CPCompoundPredicateType type
subpredicates: (CPArray predicates 
implementation

Returns the receiver initialized to a given type using predicates from a given array.

Parameters
typeThe type of the new predicate.
Returns
The receiver initialized with its type set to type and subpredicates array to subpredicates.

Definition at line 68 of file CPCompoundPredicate.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 229 of file CPCompoundPredicate.j.

+ (CPPredicate) notPredicateWithSubpredicate: (CPPredicate predicate
implementation

Returns a new predicate formed by NOT-ing the predicates in a given array.

Parameters
subpredicatesAn array of CPPredicate objects.
Returns
A new predicate formed by NOT-ing the predicates specified by subpredicates.

Definition at line 86 of file CPCompoundPredicate.j.

+ (CPPredicate) orPredicateWithSubpredicates: (CPArray predicates
implementation

Returns a new predicate formed by OR-ing the predicates in a given array.

Parameters
subpredicatesAn array of CPPredicate objects.
Returns
A new predicate formed by OR-ing the predicates specified by subpredicates.

Definition at line 106 of file CPCompoundPredicate.j.

- (CPString) predicateFormat
implementation

Returns the receiver’s format string.

Returns
The receiver’s format string.

Reimplemented from CPPredicate.

Definition at line 147 of file CPCompoundPredicate.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 130 of file CPCompoundPredicate.j.

- (CPArray) subpredicates
implementation

Returns the array of the receiver’s subpredicates.

Returns
The array of the receiver’s subpredicates.

Definition at line 125 of file CPCompoundPredicate.j.


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