author | vranyj1 |
Wed, 23 Nov 2011 15:26:06 +0000 | |
branch | jk_new_structure |
changeset 1152 | 040cba55a7d2 |
parent 1035 | 712d2090e68b |
child 1155 | d6f6d5fc0343 |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
4 |
New code and modification done at SWING Research Group [1]: |
|
5 |
||
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
9 |
Parts of the code written by Claus Gittinger are under following |
|
10 |
license: |
|
11 |
||
12 |
This software is furnished under a license and may be used |
|
13 |
only in accordance with the terms of that license and with the |
|
14 |
inclusion of the above copyright notice. This software may not |
|
15 |
be provided or otherwise made available to, or used by, any |
|
16 |
other person. No title to or ownership of the software is |
|
17 |
hereby transferred. |
|
18 |
||
19 |
[1] Code written at SWING Research Group contain a signature |
|
1152 | 20 |
of one of the above copright owners. For exact set of such code |
21 |
see the differences between this version and version stx:lib |
|
22 |
as of 1.9.2010 |
|
877 | 23 |
" |
752 | 24 |
"{ Package: 'stx:libjava' }" |
25 |
||
26 |
Array variableSubclass:#JavaArray |
|
27 |
instanceVariableNames:'' |
|
28 |
classVariableNames:'' |
|
29 |
poolDictionaries:'' |
|
30 |
category:'Languages-Java-Classes' |
|
31 |
! |
|
32 |
||
33 |
JavaArray class instanceVariableNames:'componentClass' |
|
34 |
||
35 |
" |
|
36 |
No other class instance variables are inherited by this class. |
|
37 |
" |
|
38 |
! |
|
39 |
||
877 | 40 |
!JavaArray class methodsFor:'documentation'! |
41 |
||
42 |
copyright |
|
43 |
" |
|
44 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 45 |
|
46 |
New code and modification done at SWING Research Group [1]: |
|
47 |
||
877 | 48 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
49 |
SWING Research Group, Czech Technical University in Prague |
|
50 |
||
51 |
Parts of the code written by Claus Gittinger are under following |
|
52 |
license: |
|
53 |
||
54 |
This software is furnished under a license and may be used |
|
55 |
only in accordance with the terms of that license and with the |
|
56 |
inclusion of the above copyright notice. This software may not |
|
57 |
be provided or otherwise made available to, or used by, any |
|
58 |
other person. No title to or ownership of the software is |
|
59 |
hereby transferred. |
|
60 |
||
61 |
[1] Code written at SWING Research Group contain a signature |
|
1152 | 62 |
of one of the above copright owners. For exact set of such code |
63 |
see the differences between this version and version stx:lib |
|
64 |
as of 1.9.2010 |
|
877 | 65 |
|
66 |
" |
|
67 |
! ! |
|
752 | 68 |
|
69 |
!JavaArray class methodsFor:'initialization'! |
|
70 |
||
1035 | 71 |
classInit |
72 |
||
73 |
componentClass isJavaClass ifTrue:[ |
|
74 |
^componentClass classInit |
|
75 |
]. |
|
76 |
componentClass isJavaArrayClass ifTrue:[ |
|
77 |
componentClass javaComponentClass isJavaPrimitiveType ifFalse:[ |
|
78 |
^componentClass classInit |
|
79 |
] |
|
80 |
] |
|
81 |
||
82 |
"Created: / 21-10-2011 / 11:03:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
83 |
! |
|
84 |
||
752 | 85 |
setComponentClass:aClass |
86 |
componentClass := aClass. |
|
87 |
||
88 |
"Created: / 17-12-2010 / 13:25:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
89 |
! ! |
|
90 |
||
91 |
!JavaArray class methodsFor:'accessing'! |
|
92 |
||
957 | 93 |
classLoader |
94 |
||
95 |
^self javaComponentClass classLoader |
|
96 |
||
97 |
"Created: / 31-08-2011 / 22:22:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
98 |
! |
|
99 |
||
752 | 100 |
javaClass |
101 |
^ self |
|
102 |
||
103 |
"Created: / 19-12-2010 / 17:09:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
104 |
! |
|
105 |
||
106 |
javaComponentClass |
|
107 |
^ componentClass |
|
108 |
||
109 |
"Created: / 20-12-2010 / 22:02:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
110 |
! |
|
111 |
||
112 |
javaName |
|
960 | 113 |
|
114 |
componentClass isJavaArrayClass ifTrue:[ |
|
115 |
^'[' , componentClass javaName. |
|
116 |
]. |
|
117 |
||
752 | 118 |
^'[L' , componentClass javaName, ';' |
119 |
||
120 |
"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
|
121 |
! |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
122 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
123 |
javaPackage |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
124 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
125 |
^componentClass javaPackage |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
126 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
127 |
"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
|
128 |
! |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
129 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
130 |
lookupMethodByNameAndType: aJavaNameAndType |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
131 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
132 |
"Trick, since java arrays should respond to all messages |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
133 |
understood by java.lang.object" |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
134 |
^ (Java at:'java.lang.Object') lookupMethodByNameAndType: aJavaNameAndType |
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
135 |
|
62e917825364
- JavaDescriptor, JavaResolver, JavaArray: fixes for primitive and array types
vranyj1
parents:
752
diff
changeset
|
136 |
"Created: / 22-05-2011 / 18:03:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 137 |
! ! |
138 |
||
139 |
!JavaArray class methodsFor:'class creation'! |
|
140 |
||
851 | 141 |
javaArrayClass |
142 |
||
143 |
^self javaArrayClassFor: self. |
|
144 |
||
145 |
"Created: / 11-06-2011 / 23:35:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
146 |
! |
|
147 |
||
1033 | 148 |
javaArrayClassFor: aJavaClass |
149 |
| meta cls | |
|
752 | 150 |
|
151 |
meta := Metaclass new. |
|
152 |
meta setSuperclass: JavaArray class. |
|
153 |
meta instSize: JavaArray class instSize. |
|
154 |
cls := meta new. |
|
155 |
cls setSuperclass: JavaArray. |
|
156 |
cls flags: JavaArray flags. |
|
157 |
cls instSize: JavaArray instSize. |
|
158 |
cls setComponentClass: aJavaClass. |
|
159 |
cls setName: (aJavaClass name , '[]') asSymbol. |
|
1033 | 160 |
"Kludge, spec says" "All methods of class Object may be invoked on an array." |
161 |
cls setMethodDictionary: (JavaVM classForName: 'java.lang.Object') |
|
162 |
methodDictionary. |
|
163 |
^ cls |
|
752 | 164 |
|
165 |
" |
|
1033 | 166 |
JavaArray javaArrayClassFor: Object" |
752 | 167 |
"Created: / 17-12-2010 / 13:45:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
168 |
"Modified: / 01-03-2011 / 14:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
169 |
! ! |
|
170 |
||
171 |
!JavaArray class methodsFor:'queries'! |
|
172 |
||
173 |
hasInterface:aJavaInterface |
|
174 |
"return true, if I respond to all methods as |
|
175 |
aJavaInterface" |
|
176 |
||
177 |
^false |
|
178 |
||
179 |
"Modified: / 19-12-2010 / 16:45:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
180 |
! |
|
181 |
||
182 |
isAbstract |
|
183 |
"return true, if the receiver is abstract |
|
184 |
(i.e. may not have instances)" |
|
185 |
||
186 |
^ false |
|
187 |
||
188 |
"Modified: / 19-12-2010 / 16:45:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
189 |
! |
|
190 |
||
191 |
isFinal |
|
192 |
"return true, if the receiver is final |
|
193 |
(i.e. may not be subclassed)" |
|
194 |
||
195 |
^ false |
|
196 |
||
197 |
"Modified: / 19-12-2010 / 16:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
198 |
! |
|
199 |
||
200 |
isInitialized |
|
201 |
"return true, if the receiver is initialized" |
|
202 |
||
203 |
^ true |
|
204 |
||
205 |
"Modified: / 07-05-1998 / 12:23:54 / cg" |
|
206 |
"Modified: / 19-12-2010 / 16:45:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
207 |
! |
|
208 |
||
209 |
isInterface |
|
210 |
"return true, if the receiver is an interface" |
|
211 |
||
212 |
^ false |
|
213 |
||
214 |
"Modified: / 07-05-1998 / 12:23:39 / cg" |
|
215 |
"Modified: / 19-12-2010 / 16:45:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
216 |
! |
|
217 |
||
218 |
isJavaArrayClass |
|
219 |
||
220 |
^true |
|
221 |
||
222 |
"Created: / 19-12-2010 / 17:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
223 |
! |
|
224 |
||
225 |
isJavaReferenceType |
|
226 |
||
227 |
^true |
|
228 |
||
229 |
"Created: / 20-12-2010 / 21:58:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
230 |
! |
|
231 |
||
232 |
isJavaType |
|
233 |
||
234 |
^true |
|
235 |
||
236 |
"Created: / 20-12-2010 / 21:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
237 |
! |
|
238 |
||
239 |
isObsolete |
|
240 |
"return true, if the receiver is obsolete |
|
241 |
Java classes are never." |
|
242 |
||
243 |
^ false |
|
244 |
||
245 |
"Modified: / 07-08-1997 / 19:04:28 / cg" |
|
246 |
"Modified: / 19-12-2010 / 16:45:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
247 |
! |
|
248 |
||
249 |
isPublic |
|
250 |
"return true, if the receiver is public" |
|
251 |
||
252 |
^ true |
|
253 |
||
254 |
"Modified: / 19-12-2010 / 16:45:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
255 |
! |
|
256 |
||
257 |
isUnresolved |
|
258 |
||
259 |
^false |
|
260 |
||
261 |
"Created: / 21-12-2010 / 12:51:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
262 |
! ! |
|
263 |
||
264 |
!JavaArray class methodsFor:'documentation'! |
|
265 |
||
266 |
version_SVN |
|
267 |
^ '$Id$' |
|
268 |
! ! |