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.13 date: 2022/01/06 15:17:57
user: cg
file: SystemEnvironment.st directory: libbasic3
module: stx stc-classLibrary: libbasic3

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

copyright

COPYRIGHT (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

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
(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.

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 must be redefined in concrete classes (subclassResponsibility) **

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

     |coll|
     coll := OrderedCollection new.
     Smalltalk allClassesInOrderDo:[:aClass | coll add:aClass name].
     coll inspect.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:46:04 GMT