Object Behavior ClassDescription Class
Class Class is one of the classes that implement the code management features of a Smalltalk system. An instance of Class is used to describe
superclass - Class
The immediate superclass of the class. This variable is nil for classes
that do not have a superclass.
methodDict - MethodDictionary
The keys of this dictionary are selector names (that is, Symbols), the
associated values are compiled methods.
The virtual machine uses this dictionary to retrieve compiled methods.
format - SmallInteger
This integer encodes the number of named instance variables and the
kind of class (normal, variable, variable byte, weak)
instanceVariables - Array
The elements of this array are strings; the names of the instance variables that the class
defines. Inherited instance variables are stored in the superclasses.
organization - ClassOrganizer
This object stores the categrization of the instance protocol and
the class comment.
subclasses - UndefinedObject
or Array
nil for a class that has no subclasses. For a class with subclasses, this
instance variable contains an array with all direct subclasses.
The following assertion states that the elements of
subclasses are classes:
subclasses isNil or: [subclasses allSatisfy: [:item |item isKindOf: Class] ].
[:class | class subclasses isNil or: [class subclasses allSatisfy: [:item | item superclass == class ] ] ].
name - Symbol
The name of the class. This name is used to retrieve the class in the
SystemDictionary.
classPool - Dictionary or nil
nil or a dictionary of all class variables that follow the
classVariableNames: keyword of the class definition.
sharedPools - OrderedCollection or nil
nil or a collection of all pool dictionaries that follow the
poolDictionaries: keyword of the class definition.
environment - SystemDictionary
category - or nil
This instance variable is currently not used.
For a better understanding of this class, you can inspect various classes and compare their data items with the definitions that a class browser shows.
First, try
OrderedCollection inspect
You see that, in spite of its demanding name, an instance of Class is essentially a symbol table: It keeps information that is gathered by the compiler and used by the compiler as well as by inspectors and the debugger. To keep things simple, an instance of Class stores only instance-related information. Instances of Metaclass are used to store class-related information.