63
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCDefinitionIndex
|
|
4 |
instanceVariableNames:'definitions'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
618
|
7 |
category:'SCM-Monticello-Patching'
|
63
|
8 |
!
|
|
9 |
|
790
|
10 |
!MCDefinitionIndex class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
I'm a simple container of MCDefinitions which can be added or removed.
|
|
15 |
"
|
|
16 |
! !
|
63
|
17 |
|
253
|
18 |
!MCDefinitionIndex class methodsFor:'initialization'!
|
|
19 |
|
|
20 |
new
|
|
21 |
^self basicNew initialize
|
|
22 |
! !
|
|
23 |
|
63
|
24 |
!MCDefinitionIndex class methodsFor:'as yet unclassified'!
|
|
25 |
|
|
26 |
definitions: aCollection
|
|
27 |
^ self new addAll: aCollection
|
|
28 |
! !
|
|
29 |
|
|
30 |
!MCDefinitionIndex methodsFor:'as yet unclassified'!
|
|
31 |
|
|
32 |
add: aDefinition
|
|
33 |
definitions at: aDefinition description put: aDefinition
|
|
34 |
!
|
|
35 |
|
|
36 |
addAll: aCollection
|
|
37 |
aCollection do: [:ea | self add: ea]
|
|
38 |
!
|
|
39 |
|
|
40 |
definitionLike: aDefinition ifPresent: foundBlock ifAbsent: errorBlock
|
|
41 |
| definition |
|
253
|
42 |
definition := definitions at: aDefinition description ifAbsent: [].
|
63
|
43 |
^ definition
|
|
44 |
ifNil: errorBlock
|
|
45 |
ifNotNil: [foundBlock value: definition]
|
|
46 |
!
|
|
47 |
|
|
48 |
definitions
|
|
49 |
^ definitions values
|
|
50 |
!
|
|
51 |
|
|
52 |
initialize
|
253
|
53 |
super initialize.
|
|
54 |
definitions := Dictionary new
|
63
|
55 |
!
|
|
56 |
|
|
57 |
remove: aDefinition
|
|
58 |
definitions removeKey: aDefinition description ifAbsent: []
|
|
59 |
! !
|
|
60 |
|
|
61 |
!MCDefinitionIndex class methodsFor:'documentation'!
|
|
62 |
|
|
63 |
version
|
790
|
64 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDefinitionIndex.st,v 1.5 2013-05-15 11:57:02 cg Exp $'
|
253
|
65 |
!
|
|
66 |
|
|
67 |
version_CVS
|
790
|
68 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDefinitionIndex.st,v 1.5 2013-05-15 11:57:02 cg Exp $'
|
253
|
69 |
!
|
|
70 |
|
|
71 |
version_SVN
|
790
|
72 |
^ '$Id: MCDefinitionIndex.st,v 1.5 2013-05-15 11:57:02 cg Exp $'
|
63
|
73 |
! !
|
790
|
74 |
|