63
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCDefinitionIndex
|
|
4 |
instanceVariableNames:'definitions'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Patching'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
253
|
11 |
!MCDefinitionIndex class methodsFor:'initialization'!
|
|
12 |
|
|
13 |
new
|
|
14 |
^self basicNew initialize
|
|
15 |
! !
|
|
16 |
|
63
|
17 |
!MCDefinitionIndex class methodsFor:'as yet unclassified'!
|
|
18 |
|
|
19 |
definitions: aCollection
|
|
20 |
^ self new addAll: aCollection
|
|
21 |
! !
|
|
22 |
|
|
23 |
!MCDefinitionIndex methodsFor:'as yet unclassified'!
|
|
24 |
|
|
25 |
add: aDefinition
|
|
26 |
definitions at: aDefinition description put: aDefinition
|
|
27 |
!
|
|
28 |
|
|
29 |
addAll: aCollection
|
|
30 |
aCollection do: [:ea | self add: ea]
|
|
31 |
!
|
|
32 |
|
|
33 |
definitionLike: aDefinition ifPresent: foundBlock ifAbsent: errorBlock
|
|
34 |
| definition |
|
253
|
35 |
definition := definitions at: aDefinition description ifAbsent: [].
|
63
|
36 |
^ definition
|
|
37 |
ifNil: errorBlock
|
|
38 |
ifNotNil: [foundBlock value: definition]
|
|
39 |
!
|
|
40 |
|
|
41 |
definitions
|
|
42 |
^ definitions values
|
|
43 |
!
|
|
44 |
|
|
45 |
initialize
|
253
|
46 |
super initialize.
|
|
47 |
definitions := Dictionary new
|
63
|
48 |
!
|
|
49 |
|
|
50 |
remove: aDefinition
|
|
51 |
definitions removeKey: aDefinition description ifAbsent: []
|
|
52 |
! !
|
|
53 |
|
|
54 |
!MCDefinitionIndex class methodsFor:'documentation'!
|
|
55 |
|
|
56 |
version
|
366
|
57 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDefinitionIndex.st,v 1.3 2011-08-20 12:30:54 cg Exp $'
|
253
|
58 |
!
|
|
59 |
|
|
60 |
version_CVS
|
366
|
61 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDefinitionIndex.st,v 1.3 2011-08-20 12:30:54 cg Exp $'
|
253
|
62 |
!
|
|
63 |
|
|
64 |
version_SVN
|
|
65 |
^ '§Id: MCDefinitionIndex.st 7 2010-09-12 07:18:55Z vranyj1 §'
|
63
|
66 |
! !
|