Class

NSLogicalTest

The logical combination of one or more specifier tests.

Declaration

@interface NSLogicalTest : NSScriptWhoseTest

Overview

Instances of this class perform logical operations of AND, OR, and NOT on Boolean expressions represented by NSSpecifierTest objects. These operators are equivalent to “&&”, “||”, and “!” in the C language.

For AND and OR operations, an NSLogicalTest object is typically initialized with an array containing two or more NSSpecifierTest objects. isTrue—inherited from NSScriptWhoseTest—evaluates the array in a manner appropriate to the logical operation. For NOT operations, an NSLogicalTest object is initialized with only one NSSpecifierTest object; it simply reverses the Boolean outcome of the isTrue method.

You don’t normally subclass NSLogicalTest.

Topics

Initializing a logical test

- initAndTestWithTests:

Returns an NSLogicalTest object initialized to perform an AND operation with the NSSpecifierTest objects in a given array.

- initNotTestWithTest:

Returns an NSLogicalTest object initialized to perform a NOT operation on the given NSScriptWhoseTest object.

- initOrTestWithTests:

Returns an NSLogicalTest object initialized to perform an OR operation with the NSSpecifierTest objects in a given array.

Relationships

Inherits From

See Also

Object Matching Tests

NSScriptWhoseTest

An abstract class that provides the basis for testing specifiers one at a time or in groups.

NSSpecifierTest

A comparison between an object specifier and a test object.