eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SystemEnvironment':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SystemEnvironment


Inheritance:

   Object
   |
   +--SystemEnvironment

Package:
stx:libbasic3
Category:
Kernel-Classes
Version:
rev: 1.7 date: 2017/07/05 08:55:10
user: cg
file: SystemEnvironment.st directory: libbasic3
module: stx stc-classLibrary: libbasic3
Author:
Jan Vrany <jan.vrany@fit.cvut.cz>

Description:


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:]


Related information:

    Smalltalk
    NameSpace

Class protocol:

queries
o  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.


Instance protocol:

accessing
o  at: key
(comment from inherited method)
return the indexed instance variable with index, anInteger;
this method can be redefined in subclasses.

o  at: aString ifAbsent: aBlock

o  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)

o  keys

enumerating
o  allBehaviorsDo: aBlock
evaluate the argument, aBlock for all classes and metaclasses in the system

usage example(s):

     Smalltalk allBehaviorsDo:[:aClass | aClass name printCR]

o  allClassCategories
return a set of all class categories in the system

usage example(s):

     Smalltalk allClassCategories

o  allClassesAndMetaclassesDo: aBlock
evaluate the argument, aBlock for all classes and metaclasses in the system.

o  allClassesDo: aBlock
evaluate the argument, aBlock for all classes in the system.

** This method raises an error - it must be redefined in concrete classes **

o  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']

o  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]

o  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'

o  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]

o  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]

o  allClassesInOrderDo: aBlock
evaluate the argument, aBlock for all classes in the system;
Evaluation order is by inheritance: superclasses come first.

usage example(s):

     Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name]

o  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'

o  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]

o  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) **

o  allMethodCategories
return a set of all method-categories (protocols) in the system

usage example(s):

     Smalltalk allMethodCategories

o  allMethodsDo: aBlock
enumerate all methods in all classes

o  allMethodsForWhich: aBlock
return a collection of methods for which aBlock returns true

o  allMethodsWithSelectorDo: aTwoArgBlock
enumerate all methods in all classes and evaluate aBlock
with method and selector as arguments.

o  associationsDo: aBlock
evaluate the argument, aBlock for all key/value pairs
in the Smalltalk dictionary

usage example(s):

Smalltalk associationsDo:[:assoc | assoc printCR]

o  keysAndValuesDo: block
Smalltalk associationsDo:[:assoc | assoc printCR]

o  keysAndValuesSelect: selectBlockWith2Args thenCollect: collectBlockWith2Args
Smalltalk
keysAndValuesSelect:[:nm :val | (nm startsWith:'Ab') and:[val notNil]]
thenCollect:[:nm :val | nm]

o  keysDo: aBlock
evaluate the argument, aBlock for all keys in the Smalltalk dictionary

queries
o  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]

o  allClassesAndMetaclasses
return an unordered collection of all classes with their metaclasses in the system.

o  allNameSpaces
return a list of all namespaces

o  allNameSpacesIn: anEnvironment
return a list of all namespaces

o  allNamespaces
return a list of all namespaces

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

o  allNamespacesIn: anEnvironment
return a list of all namespaces

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



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 00:34:18 GMT