API  0.9.7
 All Classes Files Functions Variables Macros Groups 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
 

Class Methods

(CPPredicate) + andPredicateWithSubpredicates:
 
(CPPredicate) + notPredicateWithSubpredicate:
 
(CPPredicate) + orPredicateWithSubpredicates:
 

Detailed Description

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

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.

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

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 77 of file CPCompoundPredicate.j.

- (CPCompoundPredicateType) compoundPredicateType
implementation

Returns the predicate type for the receiver.

Returns
The predicate type for the receiver.

Definition at line 97 of file CPCompoundPredicate.j.

- (void) encodeWithCoder: (CPCoder coder
implementation

Provided by category CPCompoundPredicate(CPCoding).

Definition at line 237 of file CPCompoundPredicate.j.

- (BOOL) evaluateWithObject: (id)  object
implementation

Definition at line 171 of file CPCompoundPredicate.j.

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

Definition at line 176 of file CPCompoundPredicate.j.

- (id) initWithCoder: (CPCoder coder
implementation

Provided by category CPCompoundPredicate(CPCoding).

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

- (BOOL) isEqual: (id)  anObject
implementation

Definition at line 210 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 67 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 87 of file CPCompoundPredicate.j.

- (CPString) predicateFormat
implementation

Definition at line 128 of file CPCompoundPredicate.j.

- (CPPredicate) predicateWithSubstitutionVariables: (CPDictionary variables
implementation

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


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