89
|
1 |
Array subclass:#JavaConstantPool
|
|
2 |
instanceVariableNames:'owner'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Java-Reader-Support'
|
|
6 |
!
|
|
7 |
|
|
8 |
|
|
9 |
!JavaConstantPool methodsFor:'accessing'!
|
|
10 |
|
|
11 |
owner
|
|
12 |
"return owner"
|
|
13 |
|
|
14 |
^ owner
|
|
15 |
|
|
16 |
"Created: 28.6.1996 / 21:12:22 / cg"
|
|
17 |
!
|
|
18 |
|
|
19 |
owner:something
|
|
20 |
"set owner"
|
|
21 |
|
|
22 |
owner := something.
|
|
23 |
|
|
24 |
"Created: 28.6.1996 / 21:12:22 / cg"
|
|
25 |
! !
|
|
26 |
|
|
27 |
!JavaConstantPool methodsFor:'printing & storing'!
|
|
28 |
|
|
29 |
displayString
|
|
30 |
owner isNil ifTrue:[
|
|
31 |
^ '*** unowned ConstantPool'
|
|
32 |
].
|
|
33 |
^ 'ConstantPool of ' , owner fullName
|
|
34 |
|
|
35 |
"Created: 28.6.1996 / 21:13:41 / cg"
|
|
36 |
"Modified: 28.6.1996 / 21:20:26 / cg"
|
|
37 |
! !
|
|
38 |
|
171
|
39 |
!JavaConstantPool methodsFor:'queries'!
|
|
40 |
|
|
41 |
referesToMethodNamed:aJavaMethodName
|
|
42 |
self do:[:constItem |
|
|
43 |
(constItem isMemberOf:JavaMethod) ifTrue:[
|
|
44 |
constItem name = aJavaMethodName ifTrue:[^ true].
|
|
45 |
] ifFalse:[
|
|
46 |
(constItem isMemberOf:JavaMethodref) ifTrue:[
|
|
47 |
self halt.
|
|
48 |
constItem name = aJavaMethodName ifTrue:[^ true].
|
|
49 |
].
|
|
50 |
(constItem isMemberOf:JavaUnresolvedMethodrefConstant) ifTrue:[
|
|
51 |
self halt.
|
|
52 |
]
|
|
53 |
]
|
|
54 |
].
|
|
55 |
^ false
|
|
56 |
|
|
57 |
"Modified: 29.7.1997 / 17:38:35 / cg"
|
|
58 |
"Created: 29.7.1997 / 17:39:41 / cg"
|
|
59 |
!
|
|
60 |
|
|
61 |
refersToMethod:aJavaMethod
|
|
62 |
self do:[:constItem |
|
|
63 |
(constItem == aJavaMethod) ifTrue:[^ true].
|
|
64 |
(constItem isMemberOf:JavaMethodref) ifTrue:[
|
|
65 |
self halt.
|
|
66 |
].
|
|
67 |
(constItem isMemberOf:JavaUnresolvedMethodrefConstant) ifTrue:[
|
|
68 |
self halt.
|
|
69 |
]
|
|
70 |
].
|
|
71 |
^ false
|
|
72 |
|
|
73 |
"Modified: 29.7.1997 / 17:36:49 / cg"
|
|
74 |
"Created: 29.7.1997 / 17:39:19 / cg"
|
|
75 |
!
|
|
76 |
|
|
77 |
refersToMethodNamed:aJavaMethodName
|
|
78 |
self do:[:constItem |
|
|
79 |
(constItem isMemberOf:JavaMethod) ifTrue:[
|
|
80 |
constItem name = aJavaMethodName ifTrue:[^ true].
|
|
81 |
] ifFalse:[
|
|
82 |
(constItem isMemberOf:JavaMethodref) ifTrue:[
|
|
83 |
constItem name = aJavaMethodName ifTrue:[^ true].
|
|
84 |
].
|
|
85 |
(constItem isMemberOf:JavaUnresolvedMethodrefConstant) ifTrue:[
|
|
86 |
self halt.
|
|
87 |
]
|
|
88 |
]
|
|
89 |
].
|
|
90 |
^ false
|
|
91 |
|
|
92 |
"Modified: 29.7.1997 / 17:38:35 / cg"
|
|
93 |
"Created: 29.7.1997 / 17:39:24 / cg"
|
|
94 |
! !
|
|
95 |
|
203
|
96 |
!JavaConstantPool methodsFor:'special'!
|
|
97 |
|
|
98 |
updateClassRefsFrom:oldClass to:newClass
|
|
99 |
self keysAndValuesDo:[:index :constItem |
|
|
100 |
constItem == oldClass ifTrue:[
|
|
101 |
self at:index put:newClass
|
|
102 |
] ifFalse:[
|
|
103 |
constItem isNumber ifFalse:[
|
|
104 |
constItem isString ifTrue:[
|
|
105 |
"/ nothing done ...
|
|
106 |
] ifFalse:[
|
|
107 |
(constItem isMemberOf:(Java java_lang_String)) ifTrue:[
|
|
108 |
"/ nothing done ...
|
|
109 |
] ifFalse:[
|
|
110 |
constItem isJavaClass ifFalse:[
|
|
111 |
constItem updateClassRefsFrom:oldClass to:newClass
|
|
112 |
]
|
|
113 |
]
|
|
114 |
]
|
|
115 |
]
|
|
116 |
]
|
|
117 |
]
|
|
118 |
|
|
119 |
"Modified: 7.8.1997 / 15:00:10 / cg"
|
|
120 |
! !
|
|
121 |
|
135
|
122 |
!JavaConstantPool class methodsFor:'documentation'!
|
89
|
123 |
|
|
124 |
version
|
203
|
125 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaConstantPool.st,v 1.4 1997/08/07 13:19:09 cg Exp $'
|
89
|
126 |
! !
|