eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Behavior':

Home

everywhere
www.exept.de
for:
[back]

Class: Behavior


Inheritance:

   Object
   |
   +--Behavior
      |
      +--ClassDescription

Package:
stx:libbasic
Category:
Kernel-Classes
Version:
rev: 1.304 date: 2010/04/12 16:30:42
user: cg
file: Behavior.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Claus Gittinger

Description:


Every class in the system inherits from Behavior (via Class, ClassDescription);
so here is where most of the class messages end up being implemented.
(to answer a FAQ: 'Point basicNew' will be done here :-)

Beginners should keep in mind, that all classes are instances (of subclasses)
of Behavior, therefore you will find the above mentioned 'basicNew:' method
under the 'instance'-methods of Behavior - NOT under the class methods
('Behavior new' will create and return a new class, while sending 'new' to
any instance of Behavior (i.e. any class) will return an instance of that class).


Behavior provides minimum support for all classes - additional stuff is
found in ClassDescription and Class. Behaviors provides all mechanisms needed
to create instances, and send messages to those. However, Behavior does not provide
all the (symbolic) information needed to compile methods for a class or to get
useful information in inspectors.

for experts:

Since instances of Behavior provide all that is needed to interact with the VM's
message dispatch mechanism, these can be used as 'light weight' classes.
I.e. it is possible, to generate completely anonymous classes (and instances thereof)
on the fly - 'Behavior new new' is such a thingy.

The selectors and Methods are organized in a MethodDictionary (which is not a true
dictionary, but an Array with alternating selector/method entries).
This avoids the need for knowledge about Dictionaries in the runtime library (VM)
(lookup and search in these is seldom anyway, so the added benefit from using a
 hashed dictionary is almost void).

[Instance variables:]

    superclass        <Class>            the receivers superclass

    methodDictionary  <MethodDictionary> inst-selectors and methods

    instSize          <SmallInteger>     the number of instance variables

    flags             <SmallInteger>     special flag bits coded in a number
                                         not for application use

flag bits (see stc.h):

NOTICE: layout known by compiler and runtime system; be careful when changing


Related information:

    Class
    ClassDescription
    Metaclass
    Method
    MethodDictionary

Class protocol:

creating new classes
o  new
creates and return a new behavior (which is like a class,
but without the symbolic & name information).
Not for normal applications.
Sending the returned behavior the #new message gives you
an instance if it.

Notice: the returned class is given a superclass of Object;
this allows for its new instances to be inspected and the like.

flag bit constants
o  flagBehavior
return the flag code which marks Behavior-like instances.
Inline C-code and the VM check this single bit in the flag value when
checking for behaviors.

o  flagBlock
return the flag code which marks Block-like instances.
The VM checks for either this bit or the blockLike bit in the flag
value when checking for blocks to be evaluated from bytecodes.
However, compiled code only checks for the block bit.

o  flagBlockContext
return the flag code which marks BlockContext-like instances.
The VM checks this single bit in the flag value when
checking for blockContexts.

o  flagBlockLike
return the flag code which marks Block-like instances
with respect to byteCode interpretation.
The VM checks for either this bit or the block bit in the flag
value when checking for blocks to be evaluated from bytecodes.
However, compiled code only checks for the block bit.

o  flagBytes
return the flag code for byte-valued indexed instances.
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for byte valued
variable instances.

o  flagContext
return the flag code which marks Context-like instances.
The VM checks this single bit in the flag value when
checking for contexts.

o  flagDoubles
return the flag code for double-valued indexed instances (i.e. 8-byte reals).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for double valued
variable instances.

o  flagExternalBytes
return the flag code which marks ExternalBytes-like instances.
Inline C-code and the VM check this single bit in the flag value when
checking for an externalBytes-like objet.

o  flagFloat
return the flag code which marks Float-like instances.
Inline C-code and the VM check this single bit in the flag value when
checking for a float.

o  flagFloats
return the flag code for float-valued indexed instances (i.e. 4-byte reals).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for double valued
variable instances.

o  flagForSymbolic: aSymbol
return the flag code for indexed instances with aSymbolic type.
The argument may be one of
#float, #double,
#word, #signedWord,
#long, #signedLong
#longLong, #signedLongLong,
#byte
#weakObjects
For VW compatibility, also accept:
#objects, #bytes, #weak.

o  flagJavaClass
return the flag code which marks JavaClass-like instances.
The VM checks this single bit in the flag value when
checking for a javaClass.

o  flagJavaMethod
return the flag code which marks JavaMethod-like instances.
Inline C-code and the VM check this single bit in the flag value when
checking for a method.

o  flagLongLongs
return the flag code for longlong-valued indexed instances (i.e. 8-byte).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
unsigned long valued variable instances.

o  flagLongs
return the flag code for long-valued indexed instances (i.e. 4-byte).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
unsigned long valued variable instances.

o  flagMetaMethod
return the flag code which marks MetaMethod-like instances.
Inline C-code and the VM check this single bit in the flag value when
about to evaluate a method.

o  flagMethod
return the flag code which marks Method-like instances.
Inline C-code and the VM check this single bit in the flag value when
checking for a method.

o  flagNonObjectInst
return the flag code which marks instances which have a
non-object instance variable (in slot 1).
(these are ignored by the garbage collector)

o  flagNotIndexed
return the flag code for non-indexed instances.
You have to mask the flag value with indexMask when comparing
it with flagNotIndexed.

o  flagPointers
return the flag code for pointer indexed instances (i.e. Array of object).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
pointer variable instances.

o  flagRegular
return the flag code which marks regular instances.

o  flagSignedLongLongs
return the flag code for signed longlong-valued indexed instances (i.e. 8-byte).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
signed long valued variable instances.

o  flagSignedLongs
return the flag code for signed long-valued indexed instances (i.e. 4-byte).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
signed long valued variable instances.

o  flagSignedWords
return the flag code for signed word-valued indexed instances (i.e. 2-byte).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
signed word valued variable instances.

o  flagSymbol
return the flag code which marks Symbol-like instances.
Inline C-code and the VM check this single bit in the flag value when
checking for symbols.

o  flagWeak
return the flag code for weak-object-pointer indexed instances.
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
weak pointer variable instances.

o  flagWeakPointers
return the flag code for weak pointer indexed instances (i.e. WeakArray).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for weak pointers.

o  flagWords
return the flag code for word-valued indexed instances (i.e. 2-byte).
The VM masks the flag value with the indexMask (maskIndexType)
and compares it to this flag value, when checking for
unsigned word valued variable instances.

o  maskIndexType
return a mask to extract all index-type bits

helpers
o  classesSortedByLoadOrder: someClasses
return a copy of the given collection of classes, which is sorted
by inheritance and superclass-of-any-private class.
This is the optimal order for loading, and the required order for compilation

o  commonSuperclassOf: listOfClassesOrClassNames
given a list of classes, return the common superclass.
A helper for the browser, some dialogs and some refactorings

misc
o  autoload
for compatibility with autoloaded classes - dummy here

queries
o  definitionSelectorFirstParts
return a collection of partial class-definition selectors

o  definitionSelectors
return a collection class-definition selectors

o  isBuiltInClass
return true if this class is known by the run-time-system.
Here, true is returned for myself, false for subclasses.


Instance protocol:

Camp Smalltalk
o  sunitAllSelectors

o  sunitSelectors

Compatibility-Dolphin
o  allSubinstances
Compatibility method - do not use in new code.
Same as allSubInstances; added for Dolphin compatibility

o  fromString: aString
reconstruct an instance of myself from the ascii-store string.
These bytes are typically the result from storing into a string/stream.
Same as readFrom:, for Dolphin compatibility.

o  guid: aUUID
Compatibility method - do not use in new code.
An ignored dummy; for Dolphin compatibility.

o  lookupMethod: selector
Compatibility method - do not use in new code.
Return the method for given selector aSelector or nil.
Only methods in the receiver - not in the superclass chain are returned.
For dolphin compatibility.
TODO: fixme if I am wrong, and dolphin does a full lookup here. If that is the case,
change to use lookupMethodFor:aSelector below.

Compatibility-Squeak
o  classComment: comment stamp: commentStamp

o  defaultNameStemForInstances
Answer a basis for names of default instances of the receiver

o  kindOfSubclass
Answer a String that is the keyword that describes the receiver's kind
of subclass, either a regular subclass, a variableSubclass, a
variableByteSubclass, a variableWordSubclass, or a weakSubclass.

o  lookupSelector: aSelector
return the method for a selector - Squeak compatibility

o  selectorsWithArgs: numberOfArgs
Return all selectors defined in this class that take this number of arguments.

Compatibility-VW
o  >> aSelector
return the method stored under the given selector; nil if there is none

o  fixedFieldsMask
Mask on the format word to indicate the number of fixed fields in instances
of a behavior. If this is non-zero, the behavior must be pointer-type

o  format
Answer an Integer that encodes the kinds and numbers of
variables of instances of the receiver.

See instSize method for reference to the fixedFieldsMask bit mask of the format.
See isVariable method for reference to the indexableMask bit mask of the format.
See isBits method for reference to the pointersMask bit mask of the format.
All other bits of the format are unused and should be 0.

o  getMethodDictionary
ST 80 compatibility: return the receivers method dictionary.

o  instanceBehavior
Answer the instance behavior of the receiver.
This is the receiver for non metaclasses.
Metaclass overrides this to answer a Metaclass's sole instance.
Same as #theNonMetaclass - for VW compatibility

o  shortName

Javascript support
o  js_new
redefinable JS-new

o  js_new: argument
redefinable JS-new:

accessing
o  addSelector: newSelector withMethod: newMethod
add the method given by 2nd argument under the selector given by
1st argument to the methodDictionary. Flushes all caches.

o  basicAddSelector: newSelector withMethod: newMethod
add the method given by 2nd argument under the selector given by
1st argument to the methodDictionary. Flushes all caches.

o  basicRemoveSelector: aSelector
remove the selector, aSelector and its associated method
from the methodDictionary

o  flags
return the receivers flag bits

o  instSize
return the number of instance variables of the receiver.
This includes all superclass instance variables.

o  lookupObject
return the lookupObject (Jan's MetaObjectProtocol support) or nil.
If non-nil, no lookup is performed by the VM, instead the lookupObject
has to provide a method object for message sends.

o  methodDictionary
return the receivers method dictionary.

o  methodDictionary: dict
set the receivers method dictionary and flush inline caches.

o  package
for protocol compatibility with class

o  removeSelector: aSelector
remove the selector, aSelector and its associated method
from the methodDictionary

o  selectors
return the receivers selector array as an orderedCollection.
Notice: this may not be compatible with ST-80.
(should we return a Set ?)

o  setLookupObject: aMethodLookupObject
set the lookupObject (Jan's MetaObjectProtocol support) or nil.
If non-nil, no lookup is performed by the VM, instead the lookupObject
has to provide a method object for message sends.

o  superclass
return the receivers superclass

autoload check
o  autoload
force autoloading - do nothing here;
redefined in Autoload; see comment there

o  isLoaded
return true, if the class has been loaded;
redefined in Autoload; see comment there

o  wasAutoloaded
return true, if this class came into the system via an
autoload; false otherwise.
Returning false here. This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

binary storage
o  binaryDefinitionFrom: stream manager: manager
sent during a binary read by the input manager.
Read the definition on an empty instance (of my class) from stream.
All pointer instances are left nil, while all bits are read in here.
return the new object.

o  fromBinaryStoreBytes: bytes
reconstruct an instance of myself from the binary-store bytes.
These bytes are typically the result from binaryStoring into a byteArray.
I.e. this is the reverse operation to #binaryStoreBytes

o  readBinaryFrom: aStream
read an objects binary representation from the argument,
aStream and return it.
The read object must be a kind of myself, otherwise an error is raised.
To get any object, use 'Object readBinaryFrom:...',
To get any number, use 'Number readBinaryFrom:...' and so on.
This is the reverse operation to 'storeBinaryOn:'.

o  readBinaryFrom: aStream onError: exceptionBlock
read an objects binary representation from the argument,
aStream and return it.
The read object must be a kind of myself, otherwise the value of
the exceptionBlock is returned.
To get any object, use 'Object readBinaryFrom:...',
To get any number, use 'Number readBinaryFrom:...' and so on.
This is the reverse operation to 'storeBinaryOn:'.

o  storeBinaryDefinitionOn: stream manager: manager
binary store of a classes definition.
Classes will store the name only and restore by looking for
that name in the Smalltalk dictionary.
This is an internal interface for the binary storage mechanism.

compiler interface
o  browserClass
return the browser to use for this class -
this can be redefined in special classes, to get different browsers

o  compilerClass
return the compiler to use for this class -
this can be redefined in special classes, to compile classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax.

o  evaluatorClass
return the compiler to use for expression evaluation for this class -
this can be redefined in special classes, to evaluate expressions with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax.

o  formatterClass
return the parser to use for formatting (prettyPrinting) this class -
this can be redefined in special classes, to format classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax.

o  language

o  parserClass
return the parser to use for parsing this class -
this can be redefined in special classes, to parse classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax.

o  programmingLanguage

o  subclassDefinerClass
Answer an evaluator class appropriate for evaluating definitions of new
subclasses of this class.

o  syntaxHighlighterClass
return the class to use for syntaxHighlighting (prettyPrinting) this class -
this can be redefined in special classes, to highlight classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax.

compiling
o  compile: code notifying: requestor
compile code, aString for this class; on any error, notify
requestor, anObject with the error reason.
Returns the new method or nil (on failure).

copying
o  canCloneFrom: anObject
return true, if this class can clone an obsolete object as retrieved
by a binary load. Subclasses which do not want to have obsolete objects
be converted, should redefine this method to return false.
(However, conversion is never done silently in a binary load; you
have to have a handler for the binaryload errors and for the conversion
request signal.)

o  cloneFrom: aPrototype
return an instance of myself with variables initialized from
a prototype. This is used when instances of obsolete classes are
binary loaded and a conversion is done on the obsolete object.
UserClasses may redefine this for better conversions.

o  deepCopyUsing: aDictionary postCopySelector: postCopySelector
return a deep copy of the receiver
- return the receiver here - time will show if this is ok

o  simpleDeepCopy
return a deep copy of the receiver
- return the receiver here - time will show if this is ok

dummy changes management
o  addChangeRecordForClassRemove: aClassName
add a change record that some class has been removed.
Defined as dummy here, since Behavior does not know about change management.
(only Classes do). This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

dummy fileOut
o  fileOutDefinitionOn: aStream
dummy fileOut defined here.
This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

enumerating
o  allDerivedInstancesDo: aBlock
evaluate aBlock for all of my instances and all instances of subclasses.
This method is going to be removed for protocol compatibility with
other STs; use allSubInstancesDo:

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  allInstancesDo: aBlock
evaluate aBlock for all of my instances

o  allOwningclassesDo: aBlock
evaluate aBlock for all of my owners (i.e. owner, owner-of-owner etc).

o  allSelectorsAndMethodsDo: aTwoArgBlock
evaluate the argument, aBlock for all selectors of mySelf and my metaclass,
passing the corresponding method as second argument

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  allSubInstancesDo: aBlock
evaluate aBlock for all of my instances and all instances of subclasses

o  allSubclassesDo: aBlock
evaluate aBlock for all of my subclasses.
There is no specific order, in which the entries are enumerated.
Warning:
This will only enumerate globally known classes - for anonymous
behaviors, you have to walk over all instances of Behavior.

o  allSubclassesInOrderDo: aBlock
evaluate aBlock for all of my subclasses.
There is no specific order, in which the entries are enumerated.
Warning:
This will only enumerate globally known classes - for anonymous
behaviors, you have to walk over all instances of Behavior.

o  allSuperclassesDo: aBlock
evaluate aBlock for all of my superclasses

o  instAndClassMethodsDo: aOneArgBlock
evaluate the argument, aBlock for all methods of mySelf and my metaclass
(i.e. for both instance- and class methods)

o  instAndClassSelectorsAndMethodsDo: aTwoArgBlock
evaluate the argument, aBlock for all selectors of mySelf and my metaclass,
passing the corresponding method as second argument

o  methodsDo: aOneArgBlock
evaluate the argument, aBlock for all my methods

o  selectorsAndMethodsDo: aTwoArgBlock
evaluate the argument, aBlock for all my selectors,
passing the corresponding method as second argument

o  selectorsDo: aOneArgBlock
evaluate the argument, aBlock for all my selectors

o  subclassesDo: aBlock
evaluate the argument, aBlock for all immediate subclasses.
This will only enumerate globally known classes - for anonymous
behaviors, you have to walk over all instances of Behavior.

o  whichClassSatisfies: aBlock
return the first class along the superclass-chain, which satisfies aBlock.
Return nil, if there is none.

o  withAllSubclassesDo: aBlock
evaluate aBlock for mySelf and all of my subclasses.
There is no specific order, in which the entries are enumerated.
Warning:
This will only enumerate globally known classes - for anonymous
behaviors, you have to walk over all instances of Behavior.

o  withAllSuperclassesDo: aBlock
evaluate aBlock for the class and all of its superclasses

initialization
o  deinitialize
deinitialize is sent to a class before it is physically unloaded.
This is only done with classes which have been loaded in from a binary
file. Classes may release any primitive memory or other stuff which is
not visible to smalltalk (for example, release internal memory).
The default action here is to do nothing.

o  initialize
initialize is sent to a class either during startup,
(for all statically compiled-in classes) or after a class
has been loaded into the system (either bytecodes or machinecode).
The default action here is to do nothing.

o  initializeWithAllPrivateClasses
if implemented, send #initialize to myself and any private
class which does so.
This is sent to a class after it
has been loaded into the system.
Statically compiled classes are initialized by the VM

o  postAutoload
postAutoload is sent to a class after it has been autoloaded.
This gives it a chance to arrange for automatic unloading to be done
after a while ...
This is NOT sent to statically compiled in or explicitely filedIn
classes.
The default action here is to do nothing.

o  reinitialize
reinitialize is sent to a class when an image has been restarted.
I.e. when the system is restarted.
This gives classes a chance to flush any device dependent or otherwise
obsolete data which may be a leftover from the previous live.
The default action here is to do nothing.

instance creation
o  basicNew
return an instance of myself without indexed variables.
If the receiver-class has indexed instvars, the new object will have
a basicSize of zero -
i.e. 'aClass basicNew' is equivalent to 'aClass basicNew:0'.

** Do not redefine this method in any class **

o  basicNew: anInteger
return an instance of myself with anInteger indexed variables.
If the receiver-class has no indexed instvars, this is only allowed
if the argument, anInteger is zero.
** Do not redefine this method in any class **

o  decodeFromLiteralArray: anArray
create & return a new instance from information encoded in anArray.

o  new
return an instance of myself without indexed variables

o  new: anInteger
return an instance of myself with anInteger indexed variables

o  niceBasicNew: anInteger
same as basicNew:anInteger, but tries to avoid long pauses
due to garbage collection. This method checks to see if
allocation is possible without a pause, and does a background
incremental garbage collect first if there is not enough memory
available at the moment for fast allocation.
This is useful in low-priority background processes which like to
avoid disturbing any higher priority foreground process while allocating
big amounts of memory. Of course, using this method only makes
sense for big or huge objects (say > 200k).

EXPERIMENTAL: this is a non-standard interface and should only
be used for special applications. There is no guarantee, that this
method will be available in future ST/X releases.

o  readFrom: aStream
read an objects printed representation from the argument, aStream
and return it.
The read object must be a kind of myself if its not, an error is raised.
This is the reverse operation to 'storeOn:'.

WARNING: storeOn: does not handle circular references and multiple
references to the same object.
Use #storeBinary:/readBinaryFrom: for this.

o  readFrom: aStream onError: exceptionBlock
read an objects printed representation from the argument, aStream
and return it (i.e. the stream should contain some representation of
the object which was created using #storeOn:).
The read object must be a kind of myself if its not, the value of
exceptionBlock is returned.
To get any object, use 'Object readFrom:...',
To get any number, use 'Number readFrom:...' and so on.
This is the reverse operation to 'storeOn:'.

WARNING: storeOn: does not handle circular references and multiple
references to the same object.
Use #storeBinary:/readBinaryFrom: for this.

o  readFromString: aString
create an object from its printed representation.
For most classes, the string is expected to be in a format created by
storeOn: or storeString; however, some (Time, Date) expect a user
readable string here.
See comments in Behavior>>readFromString:onError:,
Behavior>>readFrom: and Behavior>>readFrom:onError:

o  readFromString: aString onError: exceptionBlock
create an object from its printed representation.
Here, the string is expected to be in a format created by
storeOn: or storeString;
However, some classes (Time, Date) may redefine it to expect a user readable string here.
See comments in Behavior>>readFrom: and Behavior>>readFrom:onError:

o  uninitializedNew
create an instance of myself with uninitialized contents.
For all classes except ByteArray, this is the same as #basicNew.

o  uninitializedNew: anInteger
create an instance of myself with uninitialized contents.
For all classes except ByteArray, this is the same as #basicNew:.

misc
o  browse
open a browser showing the receiver

o  classOperationsMenu
a chance to return additional menu items for the browsers class-menu

o  flushSubclasses
I dont keep my subclasses - but if anyone inherits from me,
it better knows how to ignore this

o  iconInBrowserSymbol
can be redefined for a private icon in the browser (for me and my subclasses).
The returned symbol must be a selector of the ToolbarIconLibrary.

o  sourceCodeTemplate

printing & storing
o  displayString
although behaviors have no name, we return something
useful here - there are many places (inspectors) where
a classes name is asked for.
Implementing this message here allows instances of anonymous classes
to show a reasonable name.

o  printOn: aStream

private-accessing
o  flags: aNumber
set the flags.
this method is for special uses only - there will be no recompilation
and no change record written here;
Do NOT use it.

o  instSize: aNumber
set the instance size.
this method is for special uses only - there will be no recompilation
and no change record written here;
Do NOT use it.

o  primAddSelector: aSelector withMethod: newMethod
add the method given by 2nd argument under the selector given by
the 1st argument to the methodDictionary.
Does NOT flush any caches, does NOT write a change record.

Do not use this in normal situations, strange behavior will be
the consequence.
I.e. executing obsolete methods, since the old method will still
be executed out of the caches.

o  setMethodDictionary: dict
set the receivers method dictionary.
Convert dict to a MethodDictionary if necessary.
Do not flush inline caches, therefore old cached methods may be executed
after this call

o  setSuperclass: aClass
set the superclass of the receiver.
this method is for special uses only - there will be no recompilation
and no change record written here. Also, if the receiver class has
already been in use, future operation of the system is not guaranteed to
be correct, since no caches are flushed.
Therefore: do NOT use it; use Behavior>>superclass: (or flush the caches, at least)

o  setSuperclass: aClass instSize: i
set some inst vars.
this method is for special uses only - there will be no recompilation
and no change record is written here. Also, if the receiver class has
already been in use, future operation of the system is not guaranteed to
be correct, since no caches are flushed.
Therefore: do NOT use it; use Behavior>>superclass: (or flush the caches, at least)

o  setSuperclass: aClass methodDictionary: d instSize: i flags: f
set some inst vars.
this method is for special uses only - there will be no recompilation
and no change record is written here. Also, if the receiver class has
already been in use, future operation of the system is not guaranteed to
be correct, since no caches are flushed.
Therefore: do NOT use it; use Behavior>>superclass: (or flush the caches, at least)

private-helpers
o  addAllClassVarNamesTo: aCollection
helper - add the name-strings of the class variables and of the class-vars
of all superclasses to the argument, aCollection. Return aCollection

o  addAllInstVarNamesTo: aCollection
helper for allInstVarNames - add the name-strings of the instance variables
and of the inst-vars of all superclasses to the argument, aCollection.
Return aCollection.

o  addAllPrivateClassesTo: aCollection
add all of my private classes to aCollection

queries
o  category
return the category of the class.
Returning nil here, since Behavior does not define a category
(only ClassDescriptions do).

o  comment
return the comment of the class.
Returning nil here, since Behavior does not define a category
(only Classes do). This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

o  definitionSelector
return the selector with which I was (can be) defined in my superclass

o  definitionSelectorPrivate
return the selector with which I was (can be) defined in my superclass
as a private class

o  firstDefinitionSelectorPart
return the first part of the selector with which I was (can be) defined in my superclass

o  fullName
Answer the name of the receiver, fully qualified.

o  hasExtensions

o  isBehavior
return true, if the receiver is describing another objects behavior.
Defined to avoid the need to use isKindOf:

o  isBrowserStartable

o  isBuiltInClass
return true if this class is known by the run-time-system.
Here, false is returned as default.
Notice, this is instance protocol, which means that any class
other than those special ones) are non-builtIn by default.

o  isPrivate
return true, if the receiver is some private class

o  isStartableWithMain

o  isStartableWithStart

o  isSubclassOf: aClass
return true, if I am a subclass of the argument, aClass

o  isVisualStartable

o  name
although behaviors have no name, we return something
useful here - there are many places (inspectors) where
a classes name is asked for.
Implementing this message here allows anonymous classes
and instances of them to be inspected.

o  nameInBrowser
return a nameString as shown in browsers

o  nameWithArticle
return a string consisting of classname preceeded by an article.
(dont expect me to write national variants for this ... :-)
If you have special preferences, redefine it...

o  owningClass
return my owning class - nil if I am a public class

o  owningClassOrYourself
return my owning class if I am private, myself otherwise

o  revision

o  sourceCodeAt: aSelector
return the methods source for given selector aSelector or nil.
Only methods in the receiver - not in the superclass chain are tested.

o  sourceCodeAt: aSelector ifAbsent: exceptionalValue
return the methods source for given selector aSelector or exceptionalValue.
Only methods in the receiver - not in the superclass chain are tested.

o  sourceCodeManager
return the sourceCodeManager of the class.
Returning nil here, since Behavior does not define any sourceCode management.
(only Classes do). This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

o  supportsMethodCategories
return true, if my methods are categorized.
This is a hook for the browser to allow alien classes
to be handled (aktually, this is not yet used).

o  theMetaclass
return the metaClass of the class-meta pair.
Here, return my metaclass object, because I am the class.
Also implemented in my metaclass, which returns itself.

o  theNonMetaclass
return the nonMetaClass of the class-meta pair.
Here, return myself, because I am the nonMetaclass.
Also implemented in my metaclass, which also returns me.

o  topOwningClass
return my outermost owning class - nil if I am a public class

queries-inheritance
o  allSubclasses
return a collection of all subclasses (direct AND indirect) of
the receiver. There will be no specific order, in which entries
are returned. NameSpaces are excluded from the list.

o  allSubclassesInOrder
return a collection of all subclasses (direct AND indirect) of
the receiver. Higher level subclasses will come before lower ones.
NameSpaces are excluded from the list.

o  allSuperclasses
return a collection of the receivers accumulated superclasses

o  canBeSubclassed
return true, if its allowed to create subclasses of the receiver.
This method is redefined in SmallInteger and UndefinedObject, since
instances are detected by their pointer-fields, i.e. they do not have
a class entry (you don't have to understand this :-)

o  commonSuperclass: aClass
Return the common superclass of the receiver and aClass.
Assumes that there is a common superclass of any two classes.
(might return nil, if either the receiver or the argument inherit from nil)

o  hasMultipleSuperclasses
Return true, if this class inherits from other classes
(beside its primary superclass).
This method is a preparation for a future multiple inheritance extension
- currently it is not supported by the VM

o  inheritsFrom: aClass
return true, if the receiver inherits methods from aClass;
i.e. if aClass is on the receivers superclass chain.

o  subclasses
return a collection of the direct subclasses of the receiver

o  superclasses
return a collection of the receivers immediate superclasses.
This method is a preparation for a future multiple inheritance extension
- currently it is not supported by the VM

o  withAllSubclasses
return a collection containing the receiver and
all subclasses (direct AND indirect) of the receiver

o  withAllSuperclasses
return a collection containing the receiver and all
of the receivers accumulated superclasses

queries-instances
o  allDerivedInstances
return a collection of all instances of myself and
instances of all subclasses of myself.
This method is going to be removed for protocol compatibility with
other STs; use allSubInstances

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  allInstances
return a collection of all my instances

o  allInstancesWeakly: doWeakly
return a collection of all my instances.
If weakly is true, a weak collection is returned.

o  allSubInstances
return a collection of all instances of myself and
instances of all subclasses of myself.

o  anyInstance
return any of my instances; raise an error, if there is none

o  derivedInstanceCount
return the number of instances of myself and of subclasses

o  hasDerivedInstances
return true, if there are any instances of myself or of any subclass

o  hasImmediateInstances
return true if this class has immediate instances
i.e. if the instances are represented in the pointer itself and
no real object header/storage is used for the object.
Redefined in classes which have so (only SmallInteger and UndefinedObject)

o  hasInstances
return true, if there are any instances of myself

o  hasSharedInstances
return true if this class has shared instances, that is, instances
with the same value are identical.
False is returned here, only redefined in classes which have unified
instances (or should be treated so).

o  instanceCount
return the number of instances of myself.

queries-instlayout
o  elementByteSize
for bit-like containers, return the number of bytes stored per
element. For pointer indexed classes, 0 is returned

o  isBits
return true, if instances have indexed byte or short instance variables.
Ignore long, float and double arrays, since ST-80 code using isBits are probably
not prepared to handle them correctly.

o  isBitsExtended
return true, if instances have indexed byte, short, long or longlong instance variables.
Ignore float and double arrays.
This is really the thing we expect #isBits to return, however, #isBits
is defined to only return true for byte- and wordIndexed instances.
This avoids confusion of ST80 code, which is not prepared for long or longLong
instVars.

o  isBytes
return true, if instances have indexed byte instance variables

o  isDoubles
return true, if instances have indexed double instance variables

o  isFixed
return true, if instances do not have indexed instance variables

o  isFloats
return true, if instances have indexed float instance variables

o  isFloatsOrDoubles
return true, if instances have indexed float or double instance variables

o  isLongLongs
return true, if instances have indexed long-long instance variables (8 byte uints)

o  isLongs
return true, if instances have indexed long instance variables (4 byte uints)

o  isPointers
return true, if instances have pointer instance variables
i.e. are either non-indexed or have indexed pointer variables

o  isSignedLongLongs
return true, if instances have indexed signed long-long instance variables (8 byte ints)

o  isSignedLongs
return true, if instances have indexed signed long instance variables (4 byte ints)

o  isSignedWords
return true, if instances have indexed signed short instance variables

o  isVariable
return true, if instances have indexed instance variables

o  isWeakPointers
return true, if instances have weak pointer instance variables

o  isWords
return true, if instances have indexed short instance variables

o  sizeOfInst: n
return the number of bytes required for an instance of
myself with n indexed instance variables. The argument n
should be zero for classes without indexed instance variables.
See Behavior>>niceNew: for an application of this.

queries-protocol
o  allSelectors
return a collection of all selectors understood by the receiver;
this includes my selectors and all superclass selectors
(i.e. the receivers full protocol)

o  cachedLookupMethodFor: aSelector
return the method, which would be executed if aSelector was sent to
an instance of the receiver. I.e. the selector arrays of the receiver
and all of its superclasses are searched for aSelector.
Return the method, or nil if instances do not understand aSelector.
This interface provides exactly the same information as #lookupMethodFor:,
but uses the lookup-cache in the VM for faster search.
However, keep in mind, that doing a lookup through the cache also adds new
entries and can thus slow down the system by polluting the cache with
irrelevant entries. (do NOT loop over all objects calling this method).
Does NOT (currently) handle MI

o  canUnderstand: aSelector
return true, if the receiver or one of its superclasses implements aSelector.
(i.e. true if my instances understand aSelector)

o  compiledMethodAt: aSelector
return the method for given selector aSelector or nil.
Only methods in the receiver - not in the superclass chain are tested.

o  compiledMethodAt: aSelector ifAbsent: exceptionValue
return the method for given selector aSelector or the value
of exceptionValue if not present.
Only methods in the receiver - not in the superclass chain are tested.

o  containsMethod: aMethod
Return true, if the argument, aMethod is a method of myself

o  hasMethods
return true, if there are any (local) methods in this class

o  implements: aSelector
return true, if the receiver implements aSelector.
(i.e. implemented in THIS class - NOT in a superclass).
This is semantically equivalent to includesSelector: (which is ST/80/Squeak compatibility).

Caveat:
This simply checks for the selector being present in the classes
selector table - therefore, it does not care for ignoredMethods.
(but: you should not use this method for protocol-testing, anyway).

Hint:
Dont use this method to check if someone responds to a message -
use #canUnderstand: on the class or #respondsTo: on the instance
to do this.

o  includesBehavior: aClass
return true, if the receiver includes the behavior of aClass;
i.e. if is either identical to a class or inherits from it.

o  includesSelector: aSelector
return true, if the methodDictionary of THIS class includes a method for aSelector.
(i.e. if aSelector is implemented in THIS class - NOT in a superclass).
This is semantically equivalent to implements: (ST/80/Squeak compatibility).

Hint:
Dont use this method to check if someone responds to a message -
use #canUnderstand: on the class or #respondsTo: on the instance
to do this.

Caveat:
This simply checks for the selector being present in the classes
selector table - therefore, it does not care for ignoredMethods.
(but: you should not use this method for protocol-testing, anyway).

o  instAndClassMethods

o  lookupMethodFor: aSelector
return the method, which would be executed if aSelector was sent to
an instance of the receiver. I.e. the selector arrays of the receiver
and all of its superclasses are searched for aSelector.
Return the method, or nil if instances do not understand aSelector.
EXPERIMENTAL: take care of multiple superclasses.

o  responseTo: aSelector
return the method (from here or the inheritance chain),
which implements aSelector; return nil if none.

o  selectorAtMethod: aMethod
Return the selector for given method aMethod.

o  selectorAtMethod: aMethod ifAbsent: failBlock
return the selector for given method aMethod
or the value of failBlock, if not found.

o  whichClassImplements: aSelector
obsolete interface;
use whichClassIncludesSelector: for ST-80 compatibility.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  whichClassIncludesSelector: aSelector
return the class in the inheritance chain, which implements the method
for aSelector; return nil if none.
EXPERIMENTAL: handle multiple superclasses

queries-variables
o  allClassVarNames
return a collection of all the class variable name-strings
this includes all superclass-class variables

o  allInstVarNames
return a collection of all the instance variable name-strings
this includes all superclass-instance variables.
Instvars of superclasses come first (i.e. the position matches
the instVarAt:-index).

o  allInstanceVariableNames
alias for allInstVarNames

o  classVarNames
return a collection of the class variable name-strings.
Returning empty here, since Behavior does not define any classVariables.
(only Classes do). This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

o  classVariableString
return a string of the class variables names.
Returning empty here, since Behavior does not define any classVariables.
(only Classes do). This allows different Behavior-like objects
(alien classes) to be handled by the browser as well.

o  instVarNameForIndex: index
Behavior does not provide this info - generate synthetic names.

o  instVarNames
Behavior does not provide this info - generate synthetic names.

o  instanceVariableNames
alias for instVarNames.

o  instanceVariableString
return a string with dummy names here - typically, your
objects are instances of Class, not Behavior,
so this is only invoked for very artificial behaviors.

o  whichClassDefinesClassVar: aStringOrText

o  whichClassDefinesInstVar: aString

o  whichSelectorsAssign: instVarName
Answer a set of selectors whose methods write the argument, instVarName,
as a named instance variable.

o  whichSelectorsRead: instVarName
Answer a set of selectors whose methods read the argument, instVarName,
as a named instance variable.

o  whichSelectorsReferTo: someLiteralConstant
return a collection of selectors of methods which refer to the argument.
Search the literal arrays of my methods to do this.

o  whichSelectorsReferToClassVariable: nameOfClassVariable
return a collection of selectors of methods which refer to the argument.
Search the literal arrays of my methods to do this.

o  whichSelectorsReferToGlobal: nameOfGlobal
return a collection of selectors of methods which refer to the argument.
Search the literal arrays of my methods to do this.

o  whichSelectorsWrite: instVarName
Answer a set of selectors whose methods write the argument, instVarName,
as a named instance variable.

snapshots
o  postSnapshot
sent by ObjectMemory to all classes, after a snapshot has been written.
Nothing done here. This can be redefined in classes which like to know
about snapshooting.

o  preSnapshot
sent by ObjectMemory to all classes, before a snapshot is written.
Nothing done here. This can be redefined in classes which like to know
about snapshooting.

tracing
o  traceInto: aRequestor level: level from: referrer
double dispatch into tracer, passing my type implicitely in the selector

visiting
o  acceptVisitor: aVisitor with: aParameter



ST/X 6.1.1; WebServer 1.620 at exept:8081; Thu, 17 May 2012 15:58:39 GMT