Class Hierachy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Class Hierachy

James J. Gavan-2
Is there a file I can dowload showing the Class Hierachy, primarily Base
and Collections/Dictionaries, plus method parameters.

'You show me yours, I'll show you mine'. I'm sure you aren't interested
- but I can always show you mine in COBOL if you are interested <G>.

Jimmy, Calgary AB


Reply | Threaded
Open this post in threaded view
|

Re: Class Hierachy

Ian Bartholomew-4
Jimmy,

> Is there a file I can dowload showing the Class Hierachy, primarily Base
> and Collections/Dictionaries, plus method parameters.

If you just mean a straight listing of class/method/arguments then you can
"do it yourself" in a  workspace.

Collection withAllSubclasses asSortedCollection do: [:eachClass |
    eachClass class selectors asSortedCollection do: [:eachSelector |
        Transcript
            print: eachClass superclass;
            nextPutAll: '>>';
            print: eachClass;
            nextPutAll: '>>class ';
            nextPutAll: (eachClass class compiledMethodAt: eachSelector)
                getSource readStream nextLine;
            cr].
    eachClass selectors asSortedCollection do: [:eachSelector |
        Transcript
            print: eachClass superclass;
            nextPutAll: '>>';
            print: eachClass;
            nextPutAll: '>>';
            nextPutAll: (eachClass compiledMethodAt: eachSelector)
                getSource readStream nextLine;
            cr]]

For all the classes in the image replace the first line with
Class allClasses asSortedCollection do: [:eachClass |

For single classes replace the first line with
(Array with: Object) do: [:eachClass |

NB This only prints the first line of each method with the obvious
restriction that if the method source for the selector and arguments spans
more than one line (which only occurs in a very few methods) you'll be
missing a bit.

You can also expand it slightly to display each method's comment and/or
visually indent classes to show hierarchy - although the latter would be
easier with a bit or recursion.

> 'You show me yours, I'll show you mine'. I'm sure you aren't interested
> - but I can always show you mine in COBOL if you are interested <G>.

I'll pass on that if you don't mind <g>

Ian