749
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
2199
|
4 |
SWING Research Group, Czech Technical University in Prague (*)
|
749
|
5 |
|
|
6 |
This software is furnished under a license and may be used
|
|
7 |
only in accordance with the terms of that license and with the
|
|
8 |
inclusion of the above copyright notice. This software may not
|
|
9 |
be provided or otherwise made available to, or used by, any
|
|
10 |
other person. No title to or ownership of the software is
|
|
11 |
hereby transferred.
|
|
12 |
|
2199
|
13 |
(*) extensions, changes and fixes for java1.1 compatibility.
|
|
14 |
For a list of changes, see a list of diffs against the last stable version before 2011-08.
|
749
|
15 |
"
|
|
16 |
"{ Package: 'stx:libjava' }"
|
|
17 |
|
|
18 |
Array variableSubclass:#JavaArray
|
|
19 |
instanceVariableNames:''
|
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'Languages-Java-Classes'
|
|
23 |
!
|
|
24 |
|
|
25 |
JavaArray class instanceVariableNames:'componentClass'
|
|
26 |
|
|
27 |
"
|
|
28 |
No other class instance variables are inherited by this class.
|
|
29 |
"
|
|
30 |
!
|
|
31 |
|
|
32 |
!JavaArray class methodsFor:'documentation'!
|
|
33 |
|
|
34 |
copyright
|
|
35 |
"
|
|
36 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
37 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
2199
|
38 |
SWING Research Group, Czech Technical University in Prague (*)
|
749
|
39 |
|
|
40 |
This software is furnished under a license and may be used
|
|
41 |
only in accordance with the terms of that license and with the
|
|
42 |
inclusion of the above copyright notice. This software may not
|
|
43 |
be provided or otherwise made available to, or used by, any
|
|
44 |
other person. No title to or ownership of the software is
|
|
45 |
hereby transferred.
|
|
46 |
|
2199
|
47 |
(*) extensions, changes and fixes for java1.1 compatibility.
|
|
48 |
For a list of changes, see a list of diffs against the last stable version before 2011-08.
|
749
|
49 |
|
|
50 |
"
|
|
51 |
! !
|
|
52 |
|
|
53 |
!JavaArray class methodsFor:'initialization'!
|
|
54 |
|
|
55 |
setComponentClass:aClass
|
|
56 |
componentClass := aClass.
|
|
57 |
|
|
58 |
"Created: / 17-12-2010 / 13:25:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
59 |
! !
|
|
60 |
|
|
61 |
!JavaArray class methodsFor:'accessing'!
|
|
62 |
|
|
63 |
javaClass
|
|
64 |
^ self
|
|
65 |
|
|
66 |
"Created: / 19-12-2010 / 17:09:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
67 |
!
|
|
68 |
|
|
69 |
javaComponentClass
|
|
70 |
^ componentClass
|
|
71 |
|
|
72 |
"Created: / 20-12-2010 / 22:02:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
73 |
!
|
|
74 |
|
|
75 |
javaName
|
|
76 |
^'[L' , componentClass javaName, ';'
|
|
77 |
|
|
78 |
"Created: / 25-02-2011 / 19:29:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
79 |
!
|
|
80 |
|
|
81 |
javaPackage
|
|
82 |
|
|
83 |
^componentClass javaPackage
|
|
84 |
|
|
85 |
"Created: / 22-05-2011 / 18:07:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
86 |
!
|
|
87 |
|
|
88 |
lookupMethodByNameAndType: aJavaNameAndType
|
|
89 |
|
|
90 |
"Trick, since java arrays should respond to all messages
|
|
91 |
understood by java.lang.object"
|
|
92 |
^ (Java at:'java.lang.Object') lookupMethodByNameAndType: aJavaNameAndType
|
|
93 |
|
|
94 |
"Created: / 22-05-2011 / 18:03:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
95 |
! !
|
|
96 |
|
|
97 |
!JavaArray class methodsFor:'class creation'!
|
|
98 |
|
|
99 |
javaArrayClass
|
|
100 |
|
|
101 |
^self javaArrayClassFor: self.
|
|
102 |
|
|
103 |
"Created: / 11-06-2011 / 23:35:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
104 |
!
|
|
105 |
|
|
106 |
javaArrayClassFor: aJavaClass
|
|
107 |
|
|
108 |
| meta cls |
|
|
109 |
|
|
110 |
meta := Metaclass new.
|
|
111 |
meta setSuperclass: JavaArray class.
|
|
112 |
meta instSize: JavaArray class instSize.
|
|
113 |
cls := meta new.
|
|
114 |
cls setSuperclass: JavaArray.
|
|
115 |
cls flags: JavaArray flags.
|
|
116 |
cls instSize: JavaArray instSize.
|
|
117 |
cls setComponentClass: aJavaClass.
|
|
118 |
cls setName: (aJavaClass name , '[]') asSymbol.
|
|
119 |
"Kludge, spec says"
|
|
120 |
"All methods of class Object may be invoked on an array."
|
|
121 |
cls setMethodDictionary: (Java classForName: 'java.lang.Object') methodDictionary.
|
|
122 |
|
|
123 |
^cls
|
|
124 |
|
|
125 |
"
|
|
126 |
JavaArray javaArrayClassFor: Object
|
|
127 |
"
|
|
128 |
|
|
129 |
"Created: / 17-12-2010 / 13:45:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
130 |
"Modified: / 01-03-2011 / 14:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
131 |
! !
|
|
132 |
|
|
133 |
!JavaArray class methodsFor:'queries'!
|
|
134 |
|
|
135 |
hasInterface:aJavaInterface
|
|
136 |
"return true, if I respond to all methods as
|
|
137 |
aJavaInterface"
|
|
138 |
|
|
139 |
^false
|
|
140 |
|
|
141 |
"Modified: / 19-12-2010 / 16:45:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
142 |
!
|
|
143 |
|
|
144 |
isAbstract
|
|
145 |
"return true, if the receiver is abstract
|
|
146 |
(i.e. may not have instances)"
|
|
147 |
|
|
148 |
^ false
|
|
149 |
|
|
150 |
"Modified: / 19-12-2010 / 16:45:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
151 |
!
|
|
152 |
|
|
153 |
isFinal
|
|
154 |
"return true, if the receiver is final
|
|
155 |
(i.e. may not be subclassed)"
|
|
156 |
|
|
157 |
^ false
|
|
158 |
|
|
159 |
"Modified: / 19-12-2010 / 16:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
160 |
!
|
|
161 |
|
|
162 |
isInitialized
|
|
163 |
"return true, if the receiver is initialized"
|
|
164 |
|
|
165 |
^ true
|
|
166 |
|
|
167 |
"Modified: / 07-05-1998 / 12:23:54 / cg"
|
|
168 |
"Modified: / 19-12-2010 / 16:45:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
169 |
!
|
|
170 |
|
|
171 |
isInterface
|
|
172 |
"return true, if the receiver is an interface"
|
|
173 |
|
|
174 |
^ false
|
|
175 |
|
|
176 |
"Modified: / 07-05-1998 / 12:23:39 / cg"
|
|
177 |
"Modified: / 19-12-2010 / 16:45:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
178 |
!
|
|
179 |
|
|
180 |
isJavaArrayClass
|
|
181 |
|
|
182 |
^true
|
|
183 |
|
|
184 |
"Created: / 19-12-2010 / 17:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
185 |
!
|
|
186 |
|
|
187 |
isJavaReferenceType
|
|
188 |
|
|
189 |
^true
|
|
190 |
|
|
191 |
"Created: / 20-12-2010 / 21:58:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
192 |
!
|
|
193 |
|
|
194 |
isJavaType
|
|
195 |
|
|
196 |
^true
|
|
197 |
|
|
198 |
"Created: / 20-12-2010 / 21:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
199 |
!
|
|
200 |
|
|
201 |
isObsolete
|
|
202 |
"return true, if the receiver is obsolete
|
|
203 |
Java classes are never."
|
|
204 |
|
|
205 |
^ false
|
|
206 |
|
|
207 |
"Modified: / 07-08-1997 / 19:04:28 / cg"
|
|
208 |
"Modified: / 19-12-2010 / 16:45:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
209 |
!
|
|
210 |
|
|
211 |
isPublic
|
|
212 |
"return true, if the receiver is public"
|
|
213 |
|
|
214 |
^ true
|
|
215 |
|
|
216 |
"Modified: / 19-12-2010 / 16:45:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
217 |
!
|
|
218 |
|
|
219 |
isUnresolved
|
|
220 |
|
|
221 |
^false
|
|
222 |
|
|
223 |
"Created: / 21-12-2010 / 12:51:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
224 |
! !
|
|
225 |
|
|
226 |
!JavaArray class methodsFor:'documentation'!
|
|
227 |
|
2199
|
228 |
version_CVS
|
|
229 |
^ '$Header: /cvs/stx/stx/libjava/JavaArray.st,v 1.2 2011-11-24 11:13:51 cg Exp $'
|
|
230 |
!
|
|
231 |
|
749
|
232 |
version_SVN
|
2199
|
233 |
^ '§Id: JavaArray.st,v 1.1 2011/08/18 19:06:53 vrany Exp §'
|
2152
|
234 |
! !
|