267
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Dictionary subclass:#MCLazyPropertyDictionary
|
|
4 |
instanceVariableNames:'tokens'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
634
|
7 |
category:'SCM-Monticello-St/X support'
|
267
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCLazyPropertyDictionary class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
withTokens: anArray
|
|
14 |
|
|
15 |
^self new setTokens: anArray
|
|
16 |
|
|
17 |
"Created: / 28-10-2010 / 15:20:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
18 |
! !
|
|
19 |
|
|
20 |
!MCLazyPropertyDictionary methodsFor:'accessing'!
|
|
21 |
|
|
22 |
at: key ifAbsent: block
|
|
23 |
|
|
24 |
tokens ifNotNil:[self associate].
|
|
25 |
^super at: key ifAbsent:block
|
|
26 |
|
|
27 |
"Created: / 28-10-2010 / 15:24:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
28 |
! !
|
|
29 |
|
|
30 |
!MCLazyPropertyDictionary methodsFor:'initialization'!
|
|
31 |
|
|
32 |
setTokens: anArray
|
|
33 |
|
|
34 |
tokens := anArray
|
|
35 |
|
|
36 |
"Created: / 28-10-2010 / 15:20:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
37 |
! !
|
|
38 |
|
|
39 |
!MCLazyPropertyDictionary methodsFor:'private'!
|
|
40 |
|
|
41 |
associate
|
|
42 |
|
|
43 |
tokens pairWiseDo: [:key :value |
|
|
44 |
| tmp |
|
|
45 |
tmp := value.
|
|
46 |
value isString ifFalse: [tmp := value collect: [:ea | MCLazyPropertyDictionary withTokens: ea]].
|
|
47 |
value = 'nil' ifTrue: [tmp := ''].
|
|
48 |
self at: key put: tmp].
|
|
49 |
tokens := nil.
|
|
50 |
|
|
51 |
"Created: / 28-10-2010 / 15:23:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
52 |
! !
|
|
53 |
|
|
54 |
!MCLazyPropertyDictionary class methodsFor:'documentation'!
|
|
55 |
|
|
56 |
version
|
634
|
57 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyPropertyDictionary.st,v 1.3 2012-09-11 21:22:36 cg Exp $'
|
267
|
58 |
!
|
|
59 |
|
|
60 |
version_CVS
|
634
|
61 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyPropertyDictionary.st,v 1.3 2012-09-11 21:22:36 cg Exp $'
|
267
|
62 |
!
|
|
63 |
|
|
64 |
version_SVN
|
|
65 |
^ '§Id: MCLazyPropertyDictionary.st 23 2010-10-29 14:41:24Z vranyj1 §'
|
|
66 |
! !
|