Up: Classes   [Index]


ObjectInspector

ObjectInspector Class

The ObjectInspector class provides basic methods for examining the contents of objects.

The central method of this class is formatObject, which returns the contents of an object and its instance variables as a String object. However, applications can also use the formatInstanceVariable and formatClassVariable methods.

These methods use the mapInstanceVariables and mapClassVariables methods, defined in Object class. See Object.

Other classes provide convenience methods that call formatObject; for example, dump in Object class.

Instance Variables

promptString

A String object that contains the text of the inspector’s command prompt. See String.

verbose

A Boolean value that causes the inspector to print a verbose listing of objects when set to True. See Boolean.

Instance Methods

formatClassVariable (Symbol objectRef)

Return a String containing the contents of an object and its instance variables. The argument is a reference to the object to be formatted. Both formatClassVariable and formatInstanceVariable are used by formatObject, below.

formatInstanceVariable (Symbol objectRef)

Return a String containing the contents of an object and its instance variables. The argument is a reference to the object to be formatted.

formatObject (Symbol objectRef)

Return a String containing the contents of an object and its instance variables. The argument is a reference to the object to be formatted.

inspect (Symbol objectRef)
inspect (Symbol objectRef, String promptStr)

Suspends execution of the program and enters the Object inspector. This allows you to examine the object pointed to by objRef, continue execution, or exit the program. Typing ‘?’ or ‘help’ at the prompt prints a list of the inspector’s commands. With a String object as the second argument, the inspector displays the string as its command prompt.

The manual page, inspect(3ctalk), contains a description the inspector’s commands and a brief tutorial.


Up: Classes   [Index]