author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 03 Oct 2013 10:33:47 +0200 | |
changeset 2762 | 5597a2c77cba |
parent 2678 | c865275e48a7 |
child 2731 | 13f5be2bf83b |
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 |
||
56 |
!JavaClassContentRef2 class methodsFor:'instance creation'! |
|
57 |
||
58 |
in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
|
59 |
^ self basicNew |
|
60 |
initializeIn: aJavaConstantPool |
|
61 |
withNameAndTypeAt: nameAndTypeCPIndex |
|
62 |
andClassAt: classRefCPIndex. |
|
63 |
||
64 |
"Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
65 |
! ! |
|
66 |
||
67 |
!JavaClassContentRef2 methodsFor:'accessing'! |
|
68 |
||
69 |
classRef |
|
70 |
^ constantPool at: classRefIndex. |
|
71 |
||
72 |
"Modified: / 12-05-2011 / 18:38:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
73 |
! |
|
74 |
||
75 |
descriptor |
|
76 |
^ self nameAndType descriptor. |
|
77 |
||
78 |
"Created: / 08-04-2011 / 15:08:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
79 |
"Modified: / 12-05-2011 / 18:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
80 |
! |
|
81 |
||
82 |
name |
|
83 |
^ self nameAndType name. |
|
84 |
||
85 |
"Created: / 08-04-2011 / 13:54:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
86 |
"Modified: / 12-05-2011 / 18:39:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
87 |
! |
|
88 |
||
89 |
nameAndType |
|
90 |
^ constantPool at: nameAndTypeIndex. |
|
91 |
||
92 |
"Created: / 11-04-2011 / 19:57:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
93 |
"Modified: / 12-05-2011 / 18:39:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
94 |
! |
|
95 |
||
96 |
selector |
|
97 |
^ self nameAndType selector. |
|
98 |
||
99 |
"Created: / 11-04-2011 / 20:38:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
100 |
"Modified: / 12-05-2011 / 18:39:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
101 |
! |
|
102 |
||
103 |
signature |
|
104 |
^ self nameAndType signature. |
|
105 |
||
106 |
"Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
107 |
! ! |
|
108 |
||
109 |
!JavaClassContentRef2 methodsFor:'comparing'! |
|
110 |
||
111 |
= anotherJavaRef |
|
112 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
113 |
^ self class == anotherJavaRef class |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
114 |
and:[self classRef = anotherJavaRef classRef |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
115 |
and:[self nameAndType = anotherJavaRef nameAndType]] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
116 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
117 |
"Modified: / 30-08-2013 / 17:15:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 118 |
! |
119 |
||
120 |
hash |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
121 |
^ self classRef hash bitXor: self nameAndType hash |
749 | 122 |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
123 |
"Modified: / 30-08-2013 / 17:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 124 |
! ! |
125 |
||
126 |
!JavaClassContentRef2 methodsFor:'initialization'! |
|
127 |
||
128 |
initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
|
129 |
constantPool := aJavaConstantPool. |
|
130 |
classRefIndex := classRefCPIndex. |
|
131 |
nameAndTypeIndex := nameAndTypeCPIndex. |
|
132 |
super initialize. |
|
133 |
||
134 |
"Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
135 |
! ! |
|
136 |
||
137 |
!JavaClassContentRef2 methodsFor:'printing'! |
|
138 |
||
139 |
displayString |
|
140 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
141 |
||
142 |
^ self classRef displayString , '.' , self name |
|
143 |
||
144 |
"Created: / 14-08-2011 / 21:18:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
145 |
! |
|
146 |
||
147 |
printString |
|
148 |
^ 'JavaClassContentRef: class=[' , self classRef printString , '] name=[' |
|
149 |
, self nameAndType printString , ']'. |
|
150 |
||
151 |
"Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
152 |
"Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
153 |
! ! |
|
154 |
||
155 |
!JavaClassContentRef2 methodsFor:'resolving'! |
|
156 |
||
157 |
invalidate |
|
158 |
self classRef invalidate. |
|
159 |
classCache := nil. |
|
160 |
nameAndTypeCache := nil. |
|
161 |
super invalidate. |
|
162 |
||
163 |
"Created: / 13-04-2011 / 12:21:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
164 |
"Modified: / 18-05-2011 / 12:41:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
165 |
! |
|
166 |
||
167 |
invalidateForClass: internalJavaClassName |
|
168 |
"Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded). |
|
169 |
Return true, if reference was invalidated." |
|
170 |
||
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
|
171 |
(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
|
172 |
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
|
173 |
^ 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
|
174 |
]. |
749 | 175 |
^ false. |
176 |
||
177 |
"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
|
178 |
"Modified (format): / 21-02-2012 / 10:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 179 |
! ! |
180 |
||
181 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
|
182 |
||
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
|
183 |
version_CVS |
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
184 |
^ '$Header: /cvs/stx/stx/libjava/JavaClassContentRef2.st,v 1.6 2013-09-06 00:41:19 vrany Exp $' |
2255
8e7491f627a9
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
185 |
! |
8e7491f627a9
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
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_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
|
188 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2255
diff
changeset
|
189 |
^ '$Changeset: <not expanded> $' |
2227 | 190 |
! |
191 |
||
749 | 192 |
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
|
193 |
^ '§Id§' |
2152 | 194 |
! ! |
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
|
195 |