author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 24 May 2013 17:55:42 +0100 | |
branch | builtin-class-support |
changeset 2629 | cedb88626902 |
parent 2429 | ebece4dcaab9 |
child 2698 | c243b2455f71 |
permissions | -rw-r--r-- |
749 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
5 |
|
749 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
15 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
19 |
as of 1.9.2010 |
749 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
JavaRef2 subclass:#JavaClassContentRef2 |
|
24 |
instanceVariableNames:'classRefIndex nameAndTypeIndex classCache nameAndTypeCache' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Reader-Support-new' |
|
28 |
! |
|
29 |
||
30 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
|
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
35 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
36 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
37 |
|
749 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
39 |
SWING Research Group, Czech Technical University in Prague |
|
40 |
||
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
48 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
49 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
50 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
51 |
as of 1.9.2010 |
749 | 52 |
|
53 |
" |
|
54 |
! ! |
|
55 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
56 |
|
749 | 57 |
!JavaClassContentRef2 class methodsFor:'instance creation'! |
58 |
||
59 |
in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
|
60 |
^ self basicNew |
|
61 |
initializeIn: aJavaConstantPool |
|
62 |
withNameAndTypeAt: nameAndTypeCPIndex |
|
63 |
andClassAt: classRefCPIndex. |
|
64 |
||
65 |
"Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
66 |
! ! |
|
67 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
68 |
|
749 | 69 |
!JavaClassContentRef2 methodsFor:'accessing'! |
70 |
||
71 |
classRef |
|
72 |
^ constantPool at: classRefIndex. |
|
73 |
||
74 |
"Modified: / 12-05-2011 / 18:38:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
75 |
! |
|
76 |
||
77 |
descriptor |
|
78 |
^ self nameAndType descriptor. |
|
79 |
||
80 |
"Created: / 08-04-2011 / 15:08:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
81 |
"Modified: / 12-05-2011 / 18:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
82 |
! |
|
83 |
||
84 |
name |
|
85 |
^ self nameAndType name. |
|
86 |
||
87 |
"Created: / 08-04-2011 / 13:54:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
88 |
"Modified: / 12-05-2011 / 18:39:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
89 |
! |
|
90 |
||
91 |
nameAndType |
|
92 |
^ constantPool at: nameAndTypeIndex. |
|
93 |
||
94 |
"Created: / 11-04-2011 / 19:57:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
95 |
"Modified: / 12-05-2011 / 18:39:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
96 |
! |
|
97 |
||
98 |
selector |
|
99 |
^ self nameAndType selector. |
|
100 |
||
101 |
"Created: / 11-04-2011 / 20:38:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
102 |
"Modified: / 12-05-2011 / 18:39:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
103 |
! |
|
104 |
||
105 |
signature |
|
106 |
^ self nameAndType signature. |
|
107 |
||
108 |
"Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
109 |
! ! |
|
110 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
111 |
|
749 | 112 |
!JavaClassContentRef2 methodsFor:'comparing'! |
113 |
||
114 |
= anotherJavaRef |
|
115 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
116 |
||
117 |
^ self shouldImplement |
|
118 |
! |
|
119 |
||
120 |
hash |
|
121 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
122 |
||
123 |
^ self shouldImplement |
|
124 |
! ! |
|
125 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
126 |
|
749 | 127 |
!JavaClassContentRef2 methodsFor:'initialization'! |
128 |
||
129 |
initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
|
130 |
constantPool := aJavaConstantPool. |
|
131 |
classRefIndex := classRefCPIndex. |
|
132 |
nameAndTypeIndex := nameAndTypeCPIndex. |
|
133 |
super initialize. |
|
134 |
||
135 |
"Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
136 |
! ! |
|
137 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
138 |
|
749 | 139 |
!JavaClassContentRef2 methodsFor:'printing'! |
140 |
||
141 |
displayString |
|
142 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
143 |
||
144 |
^ self classRef displayString , '.' , self name |
|
145 |
||
146 |
"Created: / 14-08-2011 / 21:18:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
147 |
! |
|
148 |
||
149 |
printString |
|
150 |
^ 'JavaClassContentRef: class=[' , self classRef printString , '] name=[' |
|
151 |
, self nameAndType printString , ']'. |
|
152 |
||
153 |
"Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
154 |
"Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
155 |
! ! |
|
156 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
157 |
|
749 | 158 |
!JavaClassContentRef2 methodsFor:'resolving'! |
159 |
||
160 |
invalidate |
|
161 |
self classRef invalidate. |
|
162 |
classCache := nil. |
|
163 |
nameAndTypeCache := nil. |
|
164 |
super invalidate. |
|
165 |
||
166 |
"Created: / 13-04-2011 / 12:21:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
167 |
"Modified: / 18-05-2011 / 12:41:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
168 |
! |
|
169 |
||
170 |
invalidateForClass: internalJavaClassName |
|
171 |
"Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded). |
|
172 |
Return true, if reference was invalidated." |
|
173 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
174 |
(self classRef invalidateForClass: internalJavaClassName) ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
175 |
self invalidate. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
176 |
^ true |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
177 |
]. |
749 | 178 |
^ false. |
179 |
||
180 |
"Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
181 |
"Modified (format): / 21-02-2012 / 10:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 182 |
! ! |
183 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
184 |
|
749 | 185 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
186 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
187 |
version_CVS |
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
188 |
^ '$Header: /cvs/stx/stx/libjava/JavaClassContentRef2.st,v 1.5 2013-02-25 11:15:31 vrany Exp $' |
2255
8e7491f627a9
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
189 |
! |
8e7491f627a9
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
190 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
191 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
192 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
193 |
^ '$Changeset: <not expanded> $' |
2227 | 194 |
! |
195 |
||
749 | 196 |
version_SVN |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
197 |
^ '§Id§' |
2152 | 198 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
199 |