Squeak Class Documentation category index | class index  
 
ProtoObject
  category: Kernel-Objects
  superclass:
  subclasses: Object ObjectOut ImageSegmentRootStub

ProtoObject establishes minimal behavior required of any object in Squeak, even objects that should balk at normal object behavior. Generally these are proxy objects designed to read themselves in from the disk, or to perform some wrapper behavior, before responding to a message. Current examples are ObjectOut and ImageSegmentRootStub, and one could argue that ObjectTracer should also inherit from this class.

ProtoObject has no instance variables, nor should any be added.

instance methods
  comparing
  ==
identityHash
~~

  debugging
  doOnlyOnce:
flag:
rearmOneShot

  objects from disk
  rehash

  system primitives
  become:
cannotInterpret:
doesNotUnderstand:
nextInstance
nextObject

  testing
  ifNil:
ifNil:ifNotNil:
ifNotNil:
ifNotNil:ifNil:
isInMemory
isNil
pointsTo:

class methods
  as yet unclassified
  initializedInstance

instance methods
  comparing top  
 

==

Primitive. Answer whether the receiver and the argument are the same
object (have the same object pointer). Do not redefine the message == in
any other class! Essential. No Lookup. Do not override in any subclass.
See Object documentation whatIsAPrimitive.


 

identityHash

Answer a SmallInteger whose value is related to the receiver's identity.
This method must not be overridden, except by SmallInteger.
Primitive. Fails if the receiver is a SmallInteger. Essential.
See Object documentation whatIsAPrimitive.

Do not override.


 

~~

Answer whether the receiver and the argument are not the same object
(do not have the same object pointer).


  debugging top  
 

doOnlyOnce:

If the 'one-shot' mechanism is armed, evaluate aBlock once and disarm the one-shot mechanism. To rearm the mechanism, evaluate 'self rearmOneShot' manually.


 

flag:

Send this message, with a relevant symbol as argument, to flag a message for subsequent retrieval. For example, you might put the following line in a number of messages:
self flag: #returnHereUrgently
Then, to retrieve all such messages, browse all senders of #returnHereUrgently.


 

rearmOneShot

Call this manually to arm the one-shot mechanism; use the mechanism in code by calling
self doOnlyOnce: <a block>


  objects from disk top  
 

rehash

Do nothing. Here so sending this to a Set does not have to do a time consuming respondsTo:


  system primitives top  
 

become:

Primitive. Swap the object pointers of the receiver and the argument.
All variables in the entire system that used to point to the
receiver now point to the argument, and vice-versa.
Fails if either object is a SmallInteger


 

cannotInterpret:

Handle the fact that there was an attempt to send the given message to the receiver but a null methodDictionary was encountered while looking up the message selector. Hopefully this is the result of encountering a stub for a swapped out class which induces this exception on purpose.


 

doesNotUnderstand:


 

nextInstance

Primitive. Answer the next instance after the receiver in the
enumeration of all instances of this class. Fails if all instances have been
enumerated. Essential. See Object documentation whatIsAPrimitive.


 

nextObject

Primitive. Answer the next object after the receiver in the
enumeration of all objects. Return 0 when all objects have been
enumerated.


  testing top  
 

ifNil:

Return self, or evaluate the block if I'm == nil (q.v.)


 

ifNil:ifNotNil:

Evaluate the block, unless I'm == nil (q.v.)


 

ifNotNil:

Evaluate the block, unless I'm == nil (q.v.)


 

ifNotNil:ifNil:

If I got here, I am not nil, so evaluate the block ifNotNilBlock


 

isInMemory

All normal objects are.


 

isNil

Coerces nil to true and everything else to false.


 

pointsTo:

This method returns true if self contains a pointer to anObject,
and returns false otherwise


class methods
  as yet unclassified top  
 

initializedInstance

Answer an instance of the receiver which in some sense is initialized. In the case of Morphs, this will yield an instance that can be attached to the Hand after having received the same kind of basic initialization that would be obtained from an instance chosen from the 'new morph' menu. Return nil if the receiver is reluctant for some reason to return such a thing