|
Class: SystemEnvironment
Object
|
+--SystemEnvironment
- Package:
- stx:libbasic3
- Category:
- Kernel-Classes
- Version:
- rev:
1.13
date: 2022/01/06 15:17:57
- user: cg
- file: SystemEnvironment.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
SystemEnvironment is an abstract base class for 'environments'
An 'environment' is an object that keeps track of classes and
methods and can be asked for those.
Its protocol is polymorph with protocol of Smalltalk and NameSpace
classes. I.e., wherever s code uses Smalltalk or NameSpace subclass to
get list of classes and/or methods ic can be interchanged with an
custom instance SystemEnvironment.
To open a browser on given environment do
Tools::NewSystemBrowser new
allButOpen;
environment: customEnvironment;
open.
[instance variables:]
[class variables:]
copyrightCOPYRIGHT (c) 1996-2011 by Claus Gittinger
New code and modifications done at SWING Research Group [1]:
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
SWING Research Group, Czech Technical University in Prague
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
[1] Code written at SWING Research Group contains a signature
of one of the above copright owners. For exact set of such code,
see the differences between this version and version stx:libjava
as of 1.9.2010
queries
-
isAbstract
-
(comment from inherited method)
Return if this class is an abstract class.
True is returned for Object here; false for subclasses.
Abstract subclasses must redefine this again.
accessing
-
at: key
-
(comment from inherited method)
return the indexed instance variable with index, anInteger;
this method can be redefined in subclasses.
-
at: aString ifAbsent: aBlock
-
(comment from inherited method)
return the indexed instance variable with index, anInteger.
If there is no such key, return the value from exceptionalValue.
This method is usually be redefined in subclasses.
-
at: key put: value
-
(comment from inherited method)
store the 2nd arg, anObject as indexed instvar with index, anInteger.
this method can be redefined in subclasses. Returns anObject (sigh)
-
keys
-
enumerating
-
allBehaviorsDo: aBlock
-
evaluate the argument, aBlock for all classes and metaclasses in the system
Usage example(s):
Smalltalk allBehaviorsDo:[:aClass | aClass name printCR]
|
-
allClassCategories
-
return a set of all class categories in the system
Usage example(s):
Smalltalk allClassCategories
|
-
allClassesAndMetaclassesDo: aBlock
-
evaluate the argument, aBlock for all classes and metaclasses in the system.
-
allClassesDo: aBlock
-
evaluate the argument, aBlock for all classes in the system.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
allClassesForWhich: filter
-
return a collection with all classes in the system,
for which filter evaluates to true.
Usage example(s):
Smalltalk
allClassesForWhich:[:cls | cls name startsWith:'Po']
|
-
allClassesForWhich: filter do: aBlock
-
evaluate the argument, aBlock for all classes in the system, for which filter evaluates to true.
Usage example(s):
Smalltalk
allClassesForWhich:[:cls | cls name startsWith:'Po']
do:[:aClass | Transcript showCR:aClass name]
|
-
allClassesInCategory: aCategory
-
return a collection of for all classes in aCategory;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInCategory:'Views-Basic'
|
-
allClassesInCategory: aCategory do: aBlock
-
evaluate the argument, aBlock for all classes in the aCategory;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | Transcript showCR:aClass]
|
-
allClassesInCategory: aCategory inOrderDo: aBlock
-
evaluate the argument, aBlock for all classes in aCategory;
superclasses come first - then subclasses
Usage example(s):
Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR]
|
-
allClassesInOrderDo: aBlock
-
evaluate the argument, aBlock for all classes in the system;
Evaluation order is by inheritance: superclasses come first.
Usage example(s):
|coll|
coll := OrderedCollection new.
Smalltalk allClassesInOrderDo:[:aClass | coll add:aClass name].
coll inspect.
|
-
allClassesInPackage: aPackageID
-
evaluate the argument, aBlock for all classes a package;
The order of the classes is not defined.
The returned collection may include private classes
Usage example(s):
Smalltalk allClassesInPackage:'bosch:dapasx'
|
-
allClassesInPackage: aPackageID do: aBlock
-
evaluate the argument, aBlock for all classes a package;
The order of the classes is not defined.
Usage example(s):
Smalltalk allClassesInPackage:'bosch:dapasx' do:[:aClass | Transcript showCR:aClass]
|
-
allKeysDo: aBlock
-
evaluate the argument, aBlock for all keys in the Smalltalk dictionary
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
allMethodCategories
-
return a set of all method-categories (protocols) in the system
Usage example(s):
Smalltalk allMethodCategories
|
-
allMethodsDo: aBlock
-
enumerate all methods in all classes
-
allMethodsForWhich: aBlock
-
return a collection of methods for which aBlock returns true
-
allMethodsWithSelectorDo: aTwoArgBlock
-
enumerate all methods in all classes and evaluate aBlock
with method and selector as arguments.
-
associationsDo: aBlock
-
evaluate the argument, aBlock for all key/value pairs
in the Smalltalk dictionary
Usage example(s):
Smalltalk associationsDo:[:assoc | assoc printCR]
|
-
keysAndValuesDo: block
-
Smalltalk associationsDo:[:assoc | assoc printCR]
-
keysAndValuesSelect: selectBlockWith2Args thenCollect: collectBlockWith2Args
-
Smalltalk
keysAndValuesSelect:[:nm :val | (nm startsWith:'Ab') and:[val notNil]]
thenCollect:[:nm :val | nm]
-
keysDo: aBlock
-
evaluate the argument, aBlock for all keys in the Smalltalk dictionary
queries
-
allClasses
-
return an unordered collection of all classes in the system.
Only globally anchored classes are returned
(i.e. anonymous ones have to be acquired by Behavior allSubInstances)
Usage example(s):
CachedClasses := nil.
Smalltalk allClasses
to get the list sorted by name:
Smalltalk allClasses asSortedCollection:[:a :b | a name < b name]
|
-
allClassesAndMetaclasses
-
return an unordered collection of all classes with their metaclasses in the system.
-
allNameSpaces
-
return a list of all namespaces
-
allNameSpacesIn: anEnvironment
-
return a list of all namespaces
-
allNamespaces
-
return a list of all namespaces
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
allNamespacesIn: anEnvironment
-
return a list of all namespaces
** This is an obsolete interface - do not use it (it may vanish in future versions) **
|