Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Categorizer
Last updated at 3:47 pm UTC on 12 January 2022
 Object subclass: #Categorizer
 	instanceVariableNames: 'categoryArray categoryStops elementArray'
 	classVariableNames: 'Default NullCategory'
 	poolDictionaries: ''
 	category: 'Kernel-Classes'

A Categorizer goal is to classify the elements of a collection into categories.
It is typically used to classify methods of class into categories (also named protocols in this case).

Instance Variables
categoryArray:
categoryStops:
elementArray:

categoryArray
- holds the list of categories.
A category could be any Object but is generally a String or Symbol.
Categories should be unique (categoryArray asSet size = categoryArray size)

categoryStops
- holds the index of last element belonging to each category.
There should be a category stop for each category (categoryStops size = categoryArray size).
The categoryStops should be sorted (categoryStops sorted = categoryStops).
A category stop equal to its predecessor (= 0 for the first category stop) denotes an empty category.

elementArray
- holds the elements to be classified. The elements are sorted by category.

Class variables
Default is the default category used to classify yet unclassified methods of a class
NullCategory is the category to be displayed in a Browser for a class having no method.

See also

SystemNavigation