Next: , Previous: , Up: Classes   [Index]


Boolean

Boolean Class

Boolean class objects are used mainly as the return values of methods of various classes that test equality, like <, >, ==, !=, &&, and ||.

An expression can treat Boolean methods differently than methods that perform numerical calculations, which usually return objects of Magnitude class and its subclasses.

Methods can return one of the Boolean class variables, boolTrue or boolFalse. In addition, methods can also define their own Boolean objects to return. The API function __ctalkRegisterBoolReturn () does this automatically when it encounters a return statement in a method that has declared a Boolean return value.

Class Variables

boolFalse
boolTrue

Objects that represent the logical values true and false. The objects can be used as return values in methods that return boolean values and in API functions like __ctalkRegisterBoolReturn (). See ctalkRegisterBoolReturn.

Instance Methods

!= (Integer i)

Return a Boolean value of ‘True’ if the values of the receiver and the argument are different, ‘False’ otherwise.

&& (Boolean b)

Returns a Boolean value of ‘True’ if both the receiver and the method’s operand evaluate to true.

= (Integer i)

Sets the value of the receiver to True or False. The method uses the Ctalk library to perform the numeric conversion of the argument to a C int, then casts the result to True or False.

== (Integer i)

Return a Boolean value of ‘True’ if the values of the receiver and the argument are the same, ‘False’ otherwise.

|| (Boolean b)

Returns a Boolean value of ‘True’ if either the receiver or the method’s operand evaluate to true.


Next: , Previous: , Up: Classes   [Index]