Class.st
changeset 1739 64afb1cba77d
parent 1735 202f723a4edf
child 1741 0d16c862d652
equal deleted inserted replaced
1738:ea8b22caa829 1739:64afb1cba77d
    18 		ChangeFileAccessLock'
    18 		ChangeFileAccessLock'
    19 	poolDictionaries:''
    19 	poolDictionaries:''
    20 	category:'Kernel-Classes'
    20 	category:'Kernel-Classes'
    21 !
    21 !
    22 
    22 
    23 !Class  class methodsFor:'documentation'!
    23 !Class class methodsFor:'documentation'!
    24 
    24 
    25 copyright
    25 copyright
    26 "
    26 "
    27  COPYRIGHT (c) 1989 by Claus Gittinger
    27  COPYRIGHT (c) 1989 by Claus Gittinger
    28 	       All Rights Reserved
    28 	       All Rights Reserved
   119     [see also:]
   119     [see also:]
   120 	Behavior ClassDescription Metaclass
   120 	Behavior ClassDescription Metaclass
   121 "
   121 "
   122 ! !
   122 ! !
   123 
   123 
   124 !Class  class methodsFor:'initialization'!
   124 !Class class methodsFor:'initialization'!
   125 
   125 
   126 initialize
   126 initialize
   127     "the classvariable 'UpdatingChanges' controls if changes are put
   127     "the classvariable 'UpdatingChanges' controls if changes are put
   128      into the changes-file; normally this variable is set to true, but
   128      into the changes-file; normally this variable is set to true, but
   129      (for example) during fileIn or when changes are applied, it is set to false
   129      (for example) during fileIn or when changes are applied, it is set to false
   152     ]
   152     ]
   153 
   153 
   154     "Modified: 21.3.1996 / 16:31:30 / cg"
   154     "Modified: 21.3.1996 / 16:31:30 / cg"
   155 ! !
   155 ! !
   156 
   156 
   157 !Class  class methodsFor:'Signal constants'!
   157 !Class class methodsFor:'Signal constants'!
   158 
   158 
   159 fileOutErrorSignal
   159 fileOutErrorSignal
   160     "return the signal raised when an error occurs while fileing out.
   160     "return the signal raised when an error occurs while fileing out.
   161      This is signalled to allow browsers some user feed back in case
   161      This is signalled to allow browsers some user feed back in case
   162      a fileout fails (for example due to disk-full errors)"
   162      a fileout fails (for example due to disk-full errors)"
   180 
   180 
   181     ^ UpdateChangeFileQuerySignal
   181     ^ UpdateChangeFileQuerySignal
   182 
   182 
   183 ! !
   183 ! !
   184 
   184 
   185 !Class  class methodsFor:'accessing - flags'!
   185 !Class class methodsFor:'accessing - flags'!
   186 
   186 
   187 catchMethodRedefinitions
   187 catchMethodRedefinitions
   188     "return the redefinition catching flag."
   188     "return the redefinition catching flag."
   189 
   189 
   190     ^ CatchMethodRedefinitions
   190     ^ CatchMethodRedefinitions
   246      decide to return something else."
   246      decide to return something else."
   247 
   247 
   248     ^ UpdatingChanges
   248     ^ UpdatingChanges
   249 ! !
   249 ! !
   250 
   250 
   251 !Class  class methodsFor:'enumeration '!
   251 !Class class methodsFor:'enumeration '!
   252 
   252 
   253 allClassesInCategory:aCategory do:aBlock
   253 allClassesInCategory:aCategory do:aBlock
   254     "evaluate aBlock for all classes in aCategory;
   254     "evaluate aBlock for all classes in aCategory;
   255      no specific order is defined."
   255      no specific order is defined."
   256 
   256 
   284     ].
   284     ].
   285     classes topologicalSort:[:a :b | b isSubclassOf:a].
   285     classes topologicalSort:[:a :b | b isSubclassOf:a].
   286     classes do:aBlock
   286     classes do:aBlock
   287 ! !
   287 ! !
   288 
   288 
   289 !Class  class methodsFor:'helpers'!
   289 !Class class methodsFor:'helpers'!
   290 
   290 
   291 revisionInfoFromString:aString
   291 revisionInfoFromString:aString
   292     "return a dictionary filled with revision info.
   292     "return a dictionary filled with revision info.
   293      This extracts the relevant info from aString.
   293      This extracts the relevant info from aString.
   294      For now, this is a bad design - should always ask the
   294      For now, this is a bad design - should always ask the
   350 
   350 
   351     "Created: 15.11.1995 / 14:58:35 / cg"
   351     "Created: 15.11.1995 / 14:58:35 / cg"
   352     "Modified: 13.12.1995 / 17:11:28 / cg"
   352     "Modified: 13.12.1995 / 17:11:28 / cg"
   353 ! !
   353 ! !
   354 
   354 
   355 !Class  class methodsFor:'queries'!
   355 !Class class methodsFor:'queries'!
   356 
   356 
   357 isBuiltInClass
   357 isBuiltInClass
   358     "return true if this class is known by the run-time-system.
   358     "return true if this class is known by the run-time-system.
   359      Here, true is returned for myself, false for subclasses."
   359      Here, true is returned for myself, false for subclasses."
   360 
   360 
   658     "return the primitiveVariables string or nil"
   658     "return the primitiveVariables string or nil"
   659 
   659 
   660     ^ self getPrimitiveSpecsAt:2 
   660     ^ self getPrimitiveSpecsAt:2 
   661 !
   661 !
   662 
   662 
       
   663 privateClasses
       
   664     "return a collection of my private classes (if any); nil otherwise"
       
   665 
       
   666     |classes|
       
   667 
       
   668     classes := IdentitySet new.
       
   669     Smalltalk keysAndValuesDo:[:aName :aValue|
       
   670         (aName startsWith:(self name , '::')) ifTrue:[
       
   671             classes add:aValue.
       
   672         ]
       
   673     ].
       
   674     classes size == 0 ifTrue:[
       
   675         ^ nil
       
   676     ].
       
   677     ^ classes
       
   678 
       
   679     "
       
   680      Object privateClasses
       
   681     "
       
   682 
       
   683     "Modified: 14.10.1996 / 17:25:59 / cg"
       
   684 !
       
   685 
   663 privateClassesAt:aClassNameSymbol
   686 privateClassesAt:aClassNameSymbol
   664     "return a private class if present; nil otherwise"
   687     "return a private class if present; nil otherwise"
   665 
   688 
   666     |class|
   689     |class|
   667 
   690 
   668     class := self classVarAt:('*' , aClassNameSymbol) asSymbol.
   691     class := self classVarAt:(':' , aClassNameSymbol) asSymbol.
   669     ^ class
   692     ^ class
   670 
   693 
   671     "Created: 11.10.1996 / 19:05:39 / cg"
   694     "Created: 11.10.1996 / 19:05:39 / cg"
   672     "Modified: 11.10.1996 / 19:18:58 / cg"
   695     "Modified: 14.10.1996 / 17:23:30 / cg"
   673 !
   696 !
   674 
   697 
   675 privateClassesAt:aClassNameSymbol put:aClass
   698 privateClassesAt:aClassNameSymbol put:aClass
   676     "return a private class if present"
   699     "return a private class if present"
   677 
   700 
   678     self classVarAt:('*' , aClassNameSymbol) asSymbol put:aClass
   701     self classVarAt:(':' , aClassNameSymbol) asSymbol put:aClass
   679 
   702 
   680     "Created: 11.10.1996 / 17:53:06 / cg"
   703     "Created: 11.10.1996 / 17:53:06 / cg"
   681     "Modified: 11.10.1996 / 19:19:34 / cg"
   704     "Modified: 14.10.1996 / 17:23:36 / cg"
   682 !
   705 !
   683 
   706 
   684 removeClassVarName:aString
   707 removeClassVarName:aString
   685     "remove a class variable if not already there.
   708     "remove a class variable if not already there.
   686      Also writes a change record and notifies dependents.
   709      Also writes a change record and notifies dependents.
  2526 
  2549 
  2527 printClassNameOn:aStream
  2550 printClassNameOn:aStream
  2528     "helper for fileOut - print my name if I am not a Metaclass;
  2551     "helper for fileOut - print my name if I am not a Metaclass;
  2529      otherwise my name without -class followed by space-class"
  2552      otherwise my name without -class followed by space-class"
  2530 
  2553 
       
  2554     |nm|
       
  2555 
  2531     self isMeta ifTrue:[
  2556     self isMeta ifTrue:[
  2532 	aStream nextPutAll:(name copyTo:(name size - 5)); nextPutAll:' class'
  2557         nm := self name.
       
  2558         (nm endsWith:' class') ifTrue:[
       
  2559             nm := nm copyWithoutLast:6.
       
  2560             aStream nextPutAll:nm; nextPutAll:' class'
       
  2561         ] ifFalse:[
       
  2562             aStream nextPutAll:nm 
       
  2563         ].
  2533     ] ifFalse:[
  2564     ] ifFalse:[
  2534 	name printOn:aStream
  2565         name printOn:aStream
  2535     ]
  2566     ]
       
  2567 
       
  2568     "Modified: 14.10.1996 / 17:36:01 / cg"
  2536 !
  2569 !
  2537 
  2570 
  2538 printClassVarNamesOn:aStream indent:indent
  2571 printClassVarNamesOn:aStream indent:indent
  2539     "print the class variable names indented and breaking at line end"
  2572     "print the class variable names indented and breaking at line end"
  2540 
  2573 
  3761 
  3794 
  3762     "Created: 7.12.1995 / 20:42:22 / cg"
  3795     "Created: 7.12.1995 / 20:42:22 / cg"
  3763     "Modified: 7.12.1995 / 23:34:43 / cg"
  3796     "Modified: 7.12.1995 / 23:34:43 / cg"
  3764 ! !
  3797 ! !
  3765 
  3798 
  3766 !Class  class methodsFor:'documentation'!
  3799 !Class class methodsFor:'documentation'!
  3767 
  3800 
  3768 version
  3801 version
  3769     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.179 1996-10-14 16:16:20 cg Exp $'
  3802     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.180 1996-10-14 16:37:50 cg Exp $'
  3770 ! !
  3803 ! !
  3771 Class initialize!
  3804 Class initialize!