author | vranyj1 |
Fri, 21 Oct 2011 09:37:44 +0000 | |
branch | jk_new_structure |
changeset 1035 | 712d2090e68b |
parent 1033 | a31de6a4cfa4 |
child 1152 | 040cba55a7d2 |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
4 |
SWING Research Group, Czech Technical University in Prague |
|
5 |
||
6 |
Parts of the code written by Claus Gittinger are under following |
|
7 |
license: |
|
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 |
||
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
17 |
||
18 |
Permission is hereby granted, free of charge, to any person |
|
19 |
obtaining a copy of this software and associated documentation |
|
20 |
files (the 'Software'), to deal in the Software without |
|
21 |
restriction, including without limitation the rights to use, |
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
23 |
copies of the Software, and to permit persons to whom the |
|
24 |
Software is furnished to do so, subject to the following |
|
25 |
conditions: |
|
26 |
||
27 |
The above copyright notice and this permission notice shall be |
|
28 |
included in all copies or substantial portions of the Software. |
|
29 |
||
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
37 |
OTHER DEALINGS IN THE SOFTWARE. |
|
38 |
||
39 |
[1] Code written at SWING Research Group contain a signature |
|
40 |
of one of the above copright owners. |
|
41 |
" |
|
752 | 42 |
"{ Package: 'stx:libjava' }" |
43 |
||
44 |
Array variableSubclass:#JavaArray |
|
45 |
instanceVariableNames:'' |
|
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
category:'Languages-Java-Classes' |
|
49 |
! |
|
50 |
||
51 |
JavaArray class instanceVariableNames:'componentClass' |
|
52 |
||
53 |
" |
|
54 |
No other class instance variables are inherited by this class. |
|
55 |
" |
|
56 |
! |
|
57 |
||
877 | 58 |
!JavaArray class methodsFor:'documentation'! |
59 |
||
60 |
copyright |
|
61 |
" |
|
62 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
63 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
64 |
SWING Research Group, Czech Technical University in Prague |
|
65 |
||
66 |
Parts of the code written by Claus Gittinger are under following |
|
67 |
license: |
|
68 |
||
69 |
This software is furnished under a license and may be used |
|
70 |
only in accordance with the terms of that license and with the |
|
71 |
inclusion of the above copyright notice. This software may not |
|
72 |
be provided or otherwise made available to, or used by, any |
|
73 |
other person. No title to or ownership of the software is |
|
74 |
hereby transferred. |
|
75 |
||
76 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
77 |
||
78 |
Permission is hereby granted, free of charge, to any person |
|
79 |
obtaining a copy of this software and associated documentation |
|
80 |
files (the 'Software'), to deal in the Software without |
|
81 |
restriction, including without limitation the rights to use, |
|
82 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
83 |
copies of the Software, and to permit persons to whom the |
|
84 |
Software is furnished to do so, subject to the following |
|
85 |
conditions: |
|
86 |
||
87 |
The above copyright notice and this permission notice shall be |
|
88 |
included in all copies or substantial portions of the Software. |
|
89 |
||
90 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
91 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
92 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
93 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
94 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
95 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
96 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
97 |
OTHER DEALINGS IN THE SOFTWARE. |
|
98 |
||
99 |
[1] Code written at SWING Research Group contain a signature |
|
100 |
of one of the above copright owners. |
|
101 |
||
102 |
" |
|
103 |
! ! |
|
752 | 104 |
|
105 |
!JavaArray class methodsFor:'initialization'! |
|
106 |
||
1035 | 107 |
classInit |
108 |
||
109 |
componentClass isJavaClass ifTrue:[ |
|
110 |
^componentClass classInit |
|
111 |
]. |
|
112 |
componentClass isJavaArrayClass ifTrue:[ |
|
113 |
componentClass javaComponentClass isJavaPrimitiveType ifFalse:[ |
|
114 |
^componentClass classInit |
|
115 |
] |
|
116 |
] |
|
117 |
||
118 |
"Created: / 21-10-2011 / 11:03:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
119 |
! |
|
120 |
||
752 | 121 |
setComponentClass:aClass |
122 |
componentClass := aClass. |
|
123 |
||
124 |
"Created: / 17-12-2010 / 13:25:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
125 |
! ! |
|
126 |
||
127 |
!JavaArray class methodsFor:'accessing'! |
|
128 |
||
957 | 129 |
classLoader |
130 |
||
131 |
^self javaComponentClass classLoader |
|
132 |
||
133 |
"Created: / 31-08-2011 / 22:22:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
134 |
! |
|
135 |
||
752 | 136 |
javaClass |
137 |
^ self |
|
138 |
||
139 |
"Created: / 19-12-2010 / 17:09:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
140 |
! |
|
141 |
||
142 |
javaComponentClass |
|
143 |
^ componentClass |
|
144 |
||
145 |
"Created: / 20-12-2010 / 22:02:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
146 |
! |
|
147 |
||
148 |
javaName |
|
960 | 149 |
|
150 |
componentClass isJavaArrayClass ifTrue:[ |
|
151 |
^'[' , componentClass javaName. |
|
152 |
]. |
|
153 |
||
752 | 154 |
^'[L' , componentClass javaName, ';' |
155 |
||
156 |
"Created: / 25-02-2011 / 19:29:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
812
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
157 |
! |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
158 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
159 |
javaPackage |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
160 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
161 |
^componentClass javaPackage |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
162 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
163 |
"Created: / 22-05-2011 / 18:07:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
164 |
! |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
165 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
166 |
lookupMethodByNameAndType: aJavaNameAndType |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
167 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
168 |
"Trick, since java arrays should respond to all messages |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
169 |
understood by java.lang.object" |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
170 |
^ (Java at:'java.lang.Object') lookupMethodByNameAndType: aJavaNameAndType |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
171 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
172 |
"Created: / 22-05-2011 / 18:03:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 173 |
! ! |
174 |
||
175 |
!JavaArray class methodsFor:'class creation'! |
|
176 |
||
851 | 177 |
javaArrayClass |
178 |
||
179 |
^self javaArrayClassFor: self. |
|
180 |
||
181 |
"Created: / 11-06-2011 / 23:35:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
182 |
! |
|
183 |
||
1033 | 184 |
javaArrayClassFor: aJavaClass |
185 |
| meta cls | |
|
752 | 186 |
|
187 |
meta := Metaclass new. |
|
188 |
meta setSuperclass: JavaArray class. |
|
189 |
meta instSize: JavaArray class instSize. |
|
190 |
cls := meta new. |
|
191 |
cls setSuperclass: JavaArray. |
|
192 |
cls flags: JavaArray flags. |
|
193 |
cls instSize: JavaArray instSize. |
|
194 |
cls setComponentClass: aJavaClass. |
|
195 |
cls setName: (aJavaClass name , '[]') asSymbol. |
|
1033 | 196 |
"Kludge, spec says" "All methods of class Object may be invoked on an array." |
197 |
cls setMethodDictionary: (JavaVM classForName: 'java.lang.Object') |
|
198 |
methodDictionary. |
|
199 |
^ cls |
|
752 | 200 |
|
201 |
" |
|
1033 | 202 |
JavaArray javaArrayClassFor: Object" |
752 | 203 |
"Created: / 17-12-2010 / 13:45:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
204 |
"Modified: / 01-03-2011 / 14:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
205 |
! ! |
|
206 |
||
207 |
!JavaArray class methodsFor:'queries'! |
|
208 |
||
209 |
hasInterface:aJavaInterface |
|
210 |
"return true, if I respond to all methods as |
|
211 |
aJavaInterface" |
|
212 |
||
213 |
^false |
|
214 |
||
215 |
"Modified: / 19-12-2010 / 16:45:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
216 |
! |
|
217 |
||
218 |
isAbstract |
|
219 |
"return true, if the receiver is abstract |
|
220 |
(i.e. may not have instances)" |
|
221 |
||
222 |
^ false |
|
223 |
||
224 |
"Modified: / 19-12-2010 / 16:45:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
225 |
! |
|
226 |
||
227 |
isFinal |
|
228 |
"return true, if the receiver is final |
|
229 |
(i.e. may not be subclassed)" |
|
230 |
||
231 |
^ false |
|
232 |
||
233 |
"Modified: / 19-12-2010 / 16:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
234 |
! |
|
235 |
||
236 |
isInitialized |
|
237 |
"return true, if the receiver is initialized" |
|
238 |
||
239 |
^ true |
|
240 |
||
241 |
"Modified: / 07-05-1998 / 12:23:54 / cg" |
|
242 |
"Modified: / 19-12-2010 / 16:45:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
243 |
! |
|
244 |
||
245 |
isInterface |
|
246 |
"return true, if the receiver is an interface" |
|
247 |
||
248 |
^ false |
|
249 |
||
250 |
"Modified: / 07-05-1998 / 12:23:39 / cg" |
|
251 |
"Modified: / 19-12-2010 / 16:45:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
252 |
! |
|
253 |
||
254 |
isJavaArrayClass |
|
255 |
||
256 |
^true |
|
257 |
||
258 |
"Created: / 19-12-2010 / 17:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
259 |
! |
|
260 |
||
261 |
isJavaReferenceType |
|
262 |
||
263 |
^true |
|
264 |
||
265 |
"Created: / 20-12-2010 / 21:58:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
266 |
! |
|
267 |
||
268 |
isJavaType |
|
269 |
||
270 |
^true |
|
271 |
||
272 |
"Created: / 20-12-2010 / 21:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
273 |
! |
|
274 |
||
275 |
isObsolete |
|
276 |
"return true, if the receiver is obsolete |
|
277 |
Java classes are never." |
|
278 |
||
279 |
^ false |
|
280 |
||
281 |
"Modified: / 07-08-1997 / 19:04:28 / cg" |
|
282 |
"Modified: / 19-12-2010 / 16:45:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
283 |
! |
|
284 |
||
285 |
isPublic |
|
286 |
"return true, if the receiver is public" |
|
287 |
||
288 |
^ true |
|
289 |
||
290 |
"Modified: / 19-12-2010 / 16:45:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
291 |
! |
|
292 |
||
293 |
isUnresolved |
|
294 |
||
295 |
^false |
|
296 |
||
297 |
"Created: / 21-12-2010 / 12:51:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
298 |
! ! |
|
299 |
||
300 |
!JavaArray class methodsFor:'documentation'! |
|
301 |
||
302 |
version_SVN |
|
303 |
^ '$Id$' |
|
304 |
! ! |