author | hlopkmar |
Thu, 20 Oct 2011 17:10:04 +0000 | |
branch | jk_new_structure |
changeset 1032 | c3085c73e150 |
parent 1021 | 8ae6c261878a |
child 1033 | a31de6a4cfa4 |
permissions | -rw-r--r-- |
752 | 1 |
"{ Package: 'stx:libjava' }" |
2 |
||
3 |
! |
|
4 |
||
5 |
!BooleanArray methodsFor:'queries'! |
|
6 |
||
826
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
7 |
isInterface |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
8 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
9 |
^false |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
10 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
11 |
"Created: / 31-05-2011 / 16:07:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
12 |
! ! |
1032 | 13 |
!CharacterArray methodsFor:'java conversions'! |
14 |
||
15 |
asJavaComponentClassName |
|
16 |
| componentClassName | |
|
17 |
||
18 |
componentClassName := self utf8Encoded. |
|
19 |
(componentClassName matches: '*\[*') ifTrue: [ |
|
20 |
componentClassName := componentClassName |
|
21 |
copyFrom: (componentClassName lastIndexOf: $[) + 1 |
|
22 |
to: componentClassName size. |
|
23 |
]. |
|
24 |
^ componentClassName. |
|
25 |
! ! |
|
26 |
!CharacterArray methodsFor:'java conversions'! |
|
27 |
||
28 |
asNiceJavaClassName |
|
29 |
| niceName | |
|
30 |
||
31 |
niceName := self asJavaComponentClassName asSTXInternalJavaClassName. |
|
32 |
(self occurrencesOf: $[) timesRepeat: [ niceName := niceName , '[]' ]. |
|
33 |
niceName := niceName asString copyReplaceAll: $/ with: $.. |
|
34 |
^ niceName. |
|
35 |
! ! |
|
36 |
!CharacterArray methodsFor:'java conversions'! |
|
37 |
||
38 |
asSTXInternalJavaClassName |
|
39 |
| internalName | |
|
40 |
||
41 |
internalName := self asJavaComponentClassName. |
|
42 |
(internalName startsWith: $L) ifTrue: [ |
|
43 |
internalName := internalName copyFrom: 2 to: internalName size - 1 |
|
44 |
]. |
|
45 |
(internalName includes: $.) ifTrue: [ |
|
46 |
internalName := internalName asString copyReplaceAll: $. with: $/ |
|
47 |
]. |
|
48 |
^internalName. |
|
49 |
! ! |
|
50 |
!CharacterArray methodsFor:'java queries'! |
|
51 |
||
52 |
isJavaArrayDescriptor |
|
53 |
^ self startsWith:$[. |
|
54 |
! ! |
|
55 |
!CharacterArray methodsFor:'java queries'! |
|
56 |
||
57 |
isJavaPrimitiveTypeDescriptor |
|
58 |
^ (self size = 1 and: [ JavaDescriptor baseTypes includesKey: self first ]). |
|
59 |
! ! |
|
1006 | 60 |
!Class methodsFor:'method lookup'! |
61 |
||
62 |
box: sObj toType: type |
|
63 |
^ (JavaTypeBox typeBoxForJava: type) box: sObj. |
|
64 |
||
65 |
"Created: / 06-09-2011 / 22:12:59 / Jan Kurs <kursjan@fit.cvut.cz>" |
|
66 |
! ! |
|
67 |
!Class methodsFor:'method lookup'! |
|
68 |
||
1009
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
69 |
perform:aMessage onReceiver:receiver from:sender ifNotFound:aBlock |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
70 |
| method selector class args retval| |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
71 |
selector := aMessage selector. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
72 |
args := aMessage arguments. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
73 |
class := receiver class. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
74 |
|
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
75 |
method := SmalltalkLookup instance lookupMethodForSelector: selector |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
76 |
directedTo: class |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
77 |
for: receiver |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
78 |
withArguments: args |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
79 |
from: sender. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
80 |
|
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
81 |
method ifNotNil: |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
82 |
[ | unboxedArgs | |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
83 |
unboxedArgs := self unbox: args to: method argTypes. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
84 |
retval := receiver perform: method selector withArguments: unboxedArgs. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
85 |
^ self box: retval toType: method returnType. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
86 |
]. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
87 |
^ aBlock value. |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
88 |
|
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
89 |
"Created: / 28-09-2011 / 11:31:33 / Jan Kurs <kursjan@fit.cvut.cz>" |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
90 |
! ! |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
91 |
!Class methodsFor:'method lookup'! |
00cf245885ab
Some methods in SmalltalkLookup and Class were missing...
kursjan
parents:
1006
diff
changeset
|
92 |
|
1006 | 93 |
unbox: javaArgumentsCollection to: typesCollection |
94 |
" box smalltalk arguments collection to Java arguments " |
|
95 |
"/ ^ stArgumentsCollection with: typesCollection collect: [ :stObject :javaType | |
|
96 |
"/ (JavaTypeBox javaTypeAt: javaType) box: stObject. |
|
97 |
"/ ] |
|
98 |
^ javaArgumentsCollection. |
|
99 |
||
100 |
"Created: / 25-09-2011 / 20:22:59 / Jan Kurs <kursjan@fit.cvut.cz>" |
|
101 |
! ! |
|
752 | 102 |
!Object methodsFor:'testing'! |
103 |
||
104 |
isJavaArray |
|
105 |
||
106 |
^self class isJavaArrayClass |
|
107 |
||
108 |
"Created: / 19-12-2010 / 17:05:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
109 |
! ! |
|
758 | 110 |
!Object methodsFor:'testing'! |
111 |
||
771 | 112 |
isJavaNameAndType |
113 |
"return true, if given object represents name and type struct in java constant pool" |
|
114 |
||
115 |
^ false. |
|
116 |
||
117 |
"Created: / 10-05-2011 / 12:21:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
118 |
! ! |
|
119 |
!Object methodsFor:'testing'! |
|
120 |
||
894 | 121 |
isJavaPackage |
122 |
"return true, if this is a java package. |
|
123 |
false is returned here - the method is only redefined in JavaPackage." |
|
124 |
||
125 |
^ false |
|
126 |
||
127 |
"Created: / 09-08-2011 / 09:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
128 |
! ! |
|
129 |
!Object methodsFor:'testing'! |
|
130 |
||
758 | 131 |
isJavaRef |
132 |
"return true, if given object represents reference in java constant pool" |
|
133 |
^ false. |
|
134 |
||
135 |
"Created: / 08-04-2011 / 16:12:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
136 |
! ! |
|
916 | 137 |
!Object methodsFor:'autoboxing support'! |
138 |
||
139 |
javaBox: anObject |
|
140 |
||
141 |
^anObject |
|
142 |
||
143 |
"Created: / 15-08-2011 / 10:52:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
144 |
! ! |
|
145 |
!Object methodsFor:'autoboxing support'! |
|
146 |
||
147 |
javaUnbox: anObject |
|
148 |
||
149 |
^anObject |
|
150 |
||
151 |
"Created: / 15-08-2011 / 10:52:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
152 |
! ! |
|
1021
8ae6c261878a
changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents:
1020
diff
changeset
|
153 |
!Set methodsFor:'javaProtocol'! |
8ae6c261878a
changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents:
1020
diff
changeset
|
154 |
|
8ae6c261878a
changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents:
1020
diff
changeset
|
155 |
java__contains:anObject |
8ae6c261878a
changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents:
1020
diff
changeset
|
156 |
^ self contains: [:el | anObject = el ] |
8ae6c261878a
changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents:
1020
diff
changeset
|
157 |
! ! |
752 | 158 |
!String methodsFor:'converting'! |
159 |
||
160 |
asArrayOfSubstringsSeparatedBy:aSeparator |
|
161 |
"Modified version of asArrayOfSubstrings" |
|
162 |
||
163 |
|substrings start end| |
|
164 |
||
165 |
substrings := OrderedCollection new. |
|
166 |
start := 1. |
|
167 |
[start <= self size] whileTrue:[ |
|
168 |
(self at:start) = aSeparator ifFalse:[ |
|
169 |
end := start + 1. |
|
170 |
[ |
|
171 |
end <= self size and:[(self at:end) ~= aSeparator] |
|
172 |
] whileTrue:[end := end + 1]. |
|
173 |
substrings add:(self copyFrom:start to:end - 1). |
|
174 |
start := end - 1 |
|
175 |
]. |
|
176 |
start := start + 1 |
|
177 |
]. |
|
178 |
^ substrings asArray |
|
179 |
||
180 |
"Created: / 07-02-2011 / 11:18:03 / Marcel Hlopko <hlopik@gmail.com>" |
|
181 |
"Modified: / 08-02-2011 / 01:08:15 / Marcel Hlopko <hlopik@gmail.com>" |
|
182 |
! ! |
|
763 | 183 |
!UserPreferences methodsFor:'accessing-java-devel'! |
184 |
||
185 |
javaTestsDirectory |
|
774 | 186 |
^ self at: #javaTestsDirectory |
187 |
ifAbsent: |
|
188 |
[ | nm | |
|
764
3c1d3f2d29a5
- stx_libjava class>>testSuite now contains also jUnit tests
vranyj1
parents:
763
diff
changeset
|
189 |
|
774 | 190 |
nm := OperatingSystem getLoginName. |
191 |
"Default path for Jan" |
|
925 | 192 |
(nm = 'jv' and:[OperatingSystem isUNIXlike]) |
774 | 193 |
ifTrue: |
194 |
[ '/home/jv/Projects/libjava/sources/libjava/branches/jk_new_structure/tests' ] |
|
195 |
ifFalse: |
|
196 |
[ "Default path for Jan (the other one :-)" |
|
197 |
nm = 'jk' |
|
198 |
ifTrue: [ 'path for Jan' ] |
|
199 |
ifFalse: |
|
200 |
[ "Default path for Marcel" |
|
201 |
nm = 'm' |
|
202 |
ifTrue: [ '/home/m/Projects/libjava/branches/jk_new_structure/tests' ] |
|
203 |
ifFalse: |
|
204 |
[ | "Look into package dir" p | |
|
768 | 205 |
|
774 | 206 |
(p := (Smalltalk getPackageDirectoryForPackage: 'stx:libjava') asFilename |
207 |
/ 'tests') exists |
|
208 |
ifTrue: [ p pathName ] |
|
209 |
ifFalse: |
|
210 |
[ | "Try the environment variable (used by Hudson)" p | |
|
764
3c1d3f2d29a5
- stx_libjava class>>testSuite now contains also jUnit tests
vranyj1
parents:
763
diff
changeset
|
211 |
|
774 | 212 |
(p := OperatingSystem getEnvironment: 'LIBJAVA_TESTS') notNil |
213 |
ifTrue: [ p ] |
|
214 |
ifFalse: |
|
215 |
[ "No default, trigger an error" |
|
216 |
self error: 'No tests path specified' ] ] ] ] ] ] |
|
763 | 217 |
|
218 |
" |
|
774 | 219 |
UserPreferences current javaTestsDirectory" |
763 | 220 |
|
221 |
"Created: / 07-05-2011 / 17:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
764
3c1d3f2d29a5
- stx_libjava class>>testSuite now contains also jUnit tests
vranyj1
parents:
763
diff
changeset
|
222 |
"Modified: / 07-05-2011 / 20:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
774 | 223 |
"Modified: / 12-05-2011 / 15:54:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
763 | 224 |
! ! |
225 |
!UserPreferences methodsFor:'accessing-java-devel'! |
|
226 |
||
227 |
javaTestsDirectory: aStringOrFilename |
|
228 |
||
229 |
self at:#javaTestsDirectory put: aStringOrFilename asString. |
|
230 |
||
231 |
"Created: / 07-05-2011 / 17:45:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
232 |
! ! |
|
762 | 233 |
!ZipArchive methodsFor:'reading - java support'! |
234 |
||
235 |
nextBytes: bytesToRead of: zmember startingAt: pos into: b startingAt: off |
|
752 | 236 |
|
762 | 237 |
file position0Based: zmember fileStart + startOfArchive + pos. |
238 |
^ file nextBytes: bytesToRead into: b startingAt: off. |
|
752 | 239 |
|
762 | 240 |
"Created: / 01-05-2011 / 16:21:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 241 |
! ! |
242 |
!Boolean class methodsFor:'queries'! |
|
243 |
||
244 |
isJavaPrimitiveType |
|
245 |
||
246 |
^true |
|
247 |
||
248 |
"Created: / 25-02-2011 / 08:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
249 |
! ! |
|
851 | 250 |
!Boolean class methodsFor:'queries'! |
251 |
||
252 |
javaArrayClass |
|
253 |
^ BooleanArray |
|
254 |
||
255 |
"Created: / 25-02-2011 / 08:27:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
256 |
! ! |
|
916 | 257 |
!Boolean class methodsFor:'autoboxing support'! |
258 |
||
259 |
javaBox:anObject |
|
260 |
||
261 |
| wrapper | |
|
262 |
||
263 |
wrapper := (Java classForName: 'java.lang.Boolean') new. |
|
264 |
wrapper perform: #'<init>(Z)V' with: anObject. |
|
265 |
^wrapper |
|
266 |
||
267 |
"Created: / 14-08-2011 / 22:54:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
268 |
! ! |
|
752 | 269 |
!Boolean class methodsFor:'accessing'! |
270 |
||
271 |
javaName |
|
272 |
||
273 |
^'boolean'. |
|
274 |
||
275 |
"Modified: / 25-02-2011 / 18:58:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
276 |
! ! |
|
826
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
277 |
!BooleanArray class methodsFor:'testing'! |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
278 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
279 |
isInterface |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
280 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
281 |
^false |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
282 |
! ! |
752 | 283 |
!BooleanArray class methodsFor:'queries'! |
284 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
285 |
isJavaArrayClass |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
286 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
287 |
^true |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
288 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
289 |
"Created: / 20-12-2010 / 22:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
290 |
! ! |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
291 |
!BooleanArray class methodsFor:'queries'! |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
292 |
|
752 | 293 |
isJavaReferenceType |
294 |
||
295 |
"Java arrays are reference types" |
|
296 |
^true |
|
297 |
||
298 |
"Created: / 20-12-2010 / 22:30:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
299 |
! ! |
|
300 |
!BooleanArray class methodsFor:'accessing-java'! |
|
301 |
||
302 |
javaComponentClass |
|
303 |
||
304 |
^Boolean |
|
305 |
||
306 |
"Created: / 20-12-2010 / 22:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
307 |
! ! |
|
308 |
!BooleanArray class methodsFor:'accessing'! |
|
309 |
||
310 |
javaName |
|
311 |
||
960 | 312 |
^'[Z'. |
752 | 313 |
|
960 | 314 |
"Modified: / 31-08-2011 / 23:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 315 |
! ! |
826
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
316 |
!ByteArray class methodsFor:'testing'! |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
317 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
318 |
isInterface |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
319 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
320 |
^false |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
321 |
! ! |
752 | 322 |
!ByteArray class methodsFor:'queries'! |
323 |
||
866 | 324 |
isJavaArrayClass |
325 |
||
326 |
^true |
|
327 |
||
328 |
"Created: / 05-02-2011 / 22:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
329 |
! ! |
|
330 |
!ByteArray class methodsFor:'queries'! |
|
331 |
||
752 | 332 |
isJavaReferenceType |
333 |
||
334 |
"Java arrays are reference types" |
|
335 |
^true |
|
336 |
||
337 |
"Created: / 20-12-2010 / 22:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
338 |
! ! |
|
339 |
!ByteArray class methodsFor:'accessing-java'! |
|
340 |
||
866 | 341 |
javaArrayClass |
342 |
||
343 |
^JavaArray javaArrayClassFor: self |
|
344 |
||
345 |
"Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
346 |
! ! |
|
347 |
!ByteArray class methodsFor:'accessing-java'! |
|
348 |
||
752 | 349 |
javaComponentClass |
350 |
||
351 |
^Byte |
|
352 |
||
353 |
"Created: / 20-12-2010 / 22:05:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
354 |
! ! |
|
355 |
!ByteArray class methodsFor:'accessing'! |
|
356 |
||
357 |
javaName |
|
358 |
||
359 |
^'[B'. |
|
360 |
||
361 |
"Modified: / 25-02-2011 / 19:02:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
362 |
! ! |
|
363 |
!Character class methodsFor:'queries'! |
|
364 |
||
365 |
isJavaPrimitiveType |
|
366 |
||
367 |
^true |
|
368 |
||
369 |
"Created: / 20-12-2010 / 22:18:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
370 |
! ! |
|
371 |
!Character class methodsFor:'accessing'! |
|
372 |
||
851 | 373 |
javaArrayClass |
374 |
^ String |
|
375 |
||
376 |
"Created: / 11-02-2011 / 10:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
377 |
! ! |
|
917 | 378 |
!Character class methodsFor:'autoboxing support'! |
379 |
||
380 |
javaBox:anObject |
|
381 |
||
382 |
| wrapper | |
|
383 |
||
384 |
wrapper := (Java classForName: 'java.lang.Character') new. |
|
385 |
wrapper perform: #'<init>(C)V' with: anObject. |
|
386 |
^wrapper |
|
387 |
||
388 |
"Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
389 |
! ! |
|
851 | 390 |
!Character class methodsFor:'accessing'! |
391 |
||
752 | 392 |
javaName |
393 |
||
394 |
^'char'. |
|
395 |
||
396 |
"Modified: / 25-02-2011 / 18:58:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
397 |
! ! |
|
398 |
!CharacterArray class methodsFor:'encoding & decoding'! |
|
399 |
||
400 |
decodeFromJavaUTF8: bytes |
|
401 |
"Decodes a string from modified UTF8 encoding |
|
402 |
as used in Java .class files. see |
|
403 |
'The class file format specification', section 4.5.7" |
|
404 |
||
405 |
| string i s b codePoint realLength | |
|
406 |
||
407 |
string := String new: bytes size. |
|
408 |
realLength := bytes size. |
|
409 |
s := bytes readStream. |
|
410 |
i := 1. |
|
411 |
[ s atEnd ] whileFalse: |
|
412 |
[ b := s next. |
|
413 |
(b & 2r10000000) == 0 |
|
414 |
ifTrue: [ codePoint := b ] |
|
415 |
ifFalse: |
|
416 |
[ self assert: (b & 2r01000000) = 2r01000000. |
|
417 |
(b & 2r00100000) = 0 |
|
418 |
ifTrue: |
|
419 |
[ "two byte utf char" |
|
420 |
realLength := realLength - 1. |
|
421 |
self assert: s size > 0. |
|
422 |
self assert: (b & 2r01000000) = 2r01000000. |
|
423 |
string bitsPerCharacter = 8 |
|
424 |
ifTrue: [ string := Unicode16String fromString: string ]. |
|
425 |
codePoint := (b & 2r00011111) << 6. |
|
426 |
b := s next. |
|
427 |
self assert: (b & 2r11000000) = 2r10000000. |
|
428 |
codePoint := codePoint + (b & 2r00111111). ] |
|
429 |
ifFalse: |
|
430 |
[ "at lease 3 byte utf char" |
|
431 |
realLength := realLength - 2. |
|
900 | 432 |
string bitsPerCharacter ~= 16"was: 32" |
433 |
ifTrue: [ string := Unicode16String"was: Unicode32String" fromString: string ]. |
|
752 | 434 |
self assert: s size > 1. |
435 |
(b & 2r00010000) = 0 |
|
436 |
ifTrue: |
|
437 |
[ | utf32Possible utf32Value | |
|
438 |
||
439 |
"3 or 6 byte utf char" |
|
440 |
self assert: s size > 1. |
|
441 |
s size < 5 |
|
442 |
ifTrue: [ utf32Possible := false ] |
|
443 |
ifFalse: [ utf32Possible := true ]. |
|
444 |
b ~= 2r11101101 ifTrue: [ utf32Possible := false ]. |
|
445 |
codePoint := (b & 2r00001111) << 12. |
|
446 |
b := s next. |
|
447 |
self assert: (b & 2r11000000) = 2r10000000. |
|
448 |
((b & 2r11110000) = 2r10100000 and: [ utf32Possible ]) |
|
449 |
ifTrue: [ utf32Value := 2r00010000 + ((b & 2r00001111) << 16) ] |
|
450 |
ifFalse: [ utf32Possible := false ]. |
|
451 |
codePoint := codePoint + ((b & 2r00111111) << 6). |
|
452 |
b := s next. |
|
453 |
self assert: (b & 2r11000000) = 2r10000000. |
|
454 |
utf32Possible |
|
455 |
ifTrue: [ utf32Value := utf32Value + ((b & 2r00111111) << 10) ]. |
|
456 |
codePoint := codePoint + (b & 2r00111111). |
|
457 |
utf32Possible |
|
458 |
ifTrue: |
|
459 |
[ | tmpB | |
|
460 |
||
461 |
tmpB := s copy. |
|
462 |
b := tmpB next. |
|
463 |
b = 2r11101101 |
|
464 |
ifTrue: |
|
465 |
[ b := tmpB next. |
|
466 |
(b & 2r11110000) = 2r10110000 |
|
467 |
ifTrue: |
|
468 |
[ utf32Value := utf32Value + ((b & 2r00001111) << 6). |
|
469 |
b := tmpB next. |
|
470 |
self assert: (b & 2r11000000) = 2r10000000. |
|
471 |
utf32Value := utf32Value + (b & 2r00111111). |
|
472 |
codePoint := utf32Value. |
|
473 |
realLength := realLength - 3. s position: tmpB position.] ] ] ] |
|
474 |
ifFalse: |
|
475 |
[ "should not happen, ask mh" |
|
476 |
self halt. ] ] ]. |
|
477 |
string at: i put: (Character codePoint: codePoint). |
|
478 |
i := i + 1. ]. |
|
479 |
^ string subString: 1 to: realLength. |
|
480 |
||
481 |
" |
|
482 |
String decodeFromJavaUTF8: 'Hello world' asByteArray" |
|
483 |
||
484 |
"Created: / 22-12-2010 / 23:45:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
485 |
"Modified: / 09-02-2011 / 01:12:25 / Marcel Hlopko <hlopik@gmail.com>" |
|
486 |
"Modified: / 13-03-2011 / 15:52:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
900 | 487 |
"Modified: / 10-08-2011 / 01:00:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 488 |
! ! |
489 |
!CharacterArray class methodsFor:'instance creation'! |
|
490 |
||
491 |
fromJavaUTF8Bytes:aByteCollection |
|
492 |
"return a new string which represents the characters as decoded |
|
493 |
from the modified utf8 encoded bytes as specified in |
|
494 |
The class file format specification, section 4.5.7" |
|
495 |
||
496 |
^ self decodeFromJavaUTF8:aByteCollection. |
|
497 |
||
498 |
" |
|
499 |
CharacterArray fromUTF8Bytes:#[ 16r41 16r42 ] |
|
500 |
CharacterArray fromUTF8Bytes:#[ 16rC1 16r02 ] |
|
501 |
CharacterArray fromUTF8Bytes:#[ 16rE0 16r81 16r02 ] |
|
502 |
CharacterArray fromUTF8Bytes:#[ 16rEF 16rBF 16rBF ] |
|
503 |
||
504 |
rfc2279 examples: |
|
505 |
CharacterArray fromUTF8Bytes:#[ 16r41 16rE2 16r89 16rA2 16rCE 16r91 16r2E ] |
|
506 |
CharacterArray fromUTF8Bytes:#[ 16rED 16r95 16r9C 16rEA 16rB5 16rAD 16rEC 16r96 16rB4 ] |
|
507 |
CharacterArray fromUTF8Bytes:#[ 16rE6 16r97 16rA5 16rE6 16r9C 16rAC 16rE8 16rAA 16r9E ] |
|
508 |
||
509 |
invalid: |
|
510 |
CharacterArray fromUTF8Bytes:#[ 16rC0 16r80 ] |
|
511 |
CharacterArray fromUTF8Bytes:#[ 16rE0 16r80 16r80 ] |
|
512 |
" |
|
513 |
||
514 |
"Created: / 23-12-2010 / 09:01:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
515 |
! ! |
|
865 | 516 |
!CharacterArray class methodsFor:'queries'! |
517 |
||
518 |
isJavaArrayClass |
|
519 |
||
520 |
^true |
|
521 |
||
522 |
"Created: / 05-02-2011 / 22:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
523 |
! ! |
|
524 |
!CharacterArray class methodsFor:'accessing-java'! |
|
525 |
||
526 |
javaArrayClass |
|
527 |
||
901 | 528 |
^JavaArray javaArrayClassFor: Unicode16String |
865 | 529 |
|
530 |
"Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
901 | 531 |
"Modified: / 10-08-2011 / 13:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
865 | 532 |
! ! |
533 |
!CharacterArray class methodsFor:'accessing-java'! |
|
534 |
||
535 |
javaComponentClass |
|
536 |
||
537 |
^Character |
|
538 |
||
539 |
"Created: / 20-12-2010 / 22:05:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
540 |
! ! |
|
826
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
541 |
!DoubleArray class methodsFor:'testing'! |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
542 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
543 |
isInterface |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
544 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
545 |
^false |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
546 |
! ! |
752 | 547 |
!DoubleArray class methodsFor:'queries'! |
548 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
549 |
isJavaArrayClass |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
550 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
551 |
^true |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
552 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
553 |
"Created: / 20-12-2010 / 22:47:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
554 |
! ! |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
555 |
!DoubleArray class methodsFor:'queries'! |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
556 |
|
752 | 557 |
isJavaReferenceType |
558 |
||
559 |
"Java arrays are reference types" |
|
560 |
^true |
|
561 |
||
562 |
"Created: / 20-12-2010 / 22:30:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
563 |
! ! |
|
564 |
!DoubleArray class methodsFor:'accessing-java'! |
|
565 |
||
566 |
javaComponentClass |
|
567 |
||
568 |
^Float |
|
569 |
||
570 |
"Created: / 20-12-2010 / 22:06:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
571 |
! ! |
|
572 |
!DoubleArray class methodsFor:'accessing'! |
|
573 |
||
574 |
javaName |
|
575 |
||
576 |
^'[D'. |
|
577 |
||
578 |
"Modified: / 25-02-2011 / 19:03:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
579 |
! ! |
|
580 |
!Float class methodsFor:'queries'! |
|
581 |
||
582 |
isJavaPrimitiveType |
|
583 |
||
584 |
^true |
|
585 |
||
586 |
"Created: / 06-02-2011 / 17:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
587 |
! ! |
|
588 |
!Float class methodsFor:'accessing'! |
|
589 |
||
851 | 590 |
javaArrayClass |
591 |
^ DoubleArray |
|
592 |
||
593 |
"Created: / 11-02-2011 / 10:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
594 |
! ! |
|
917 | 595 |
!Float class methodsFor:'autoboxing support'! |
596 |
||
597 |
javaBox:anObject |
|
598 |
||
599 |
| wrapper | |
|
600 |
||
601 |
wrapper := (Java classForName: 'java.lang.Double') new. |
|
602 |
wrapper perform: #'<init>(D)V' with: anObject. |
|
603 |
^wrapper |
|
604 |
||
605 |
"Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
606 |
! ! |
|
851 | 607 |
!Float class methodsFor:'accessing'! |
608 |
||
752 | 609 |
javaName |
610 |
||
611 |
^'double'. |
|
612 |
||
613 |
"Modified: / 25-02-2011 / 18:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
614 |
! ! |
|
826
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
615 |
!FloatArray class methodsFor:'testing'! |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
616 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
617 |
isInterface |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
618 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
619 |
^false |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
620 |
! ! |
752 | 621 |
!FloatArray class methodsFor:'queries'! |
622 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
623 |
isJavaArrayClass |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
624 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
625 |
^true |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
626 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
627 |
"Created: / 20-12-2010 / 22:47:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
628 |
! ! |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
629 |
!FloatArray class methodsFor:'queries'! |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
905
diff
changeset
|
630 |
|
752 | 631 |
isJavaReferenceType |
632 |
||
633 |
"Java arrays are reference types" |
|
634 |
^true |
|
635 |
||
636 |
"Created: / 20-12-2010 / 22:30:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
637 |
! ! |
|
638 |
!FloatArray class methodsFor:'accessing-java'! |
|
639 |
||
640 |
javaComponentClass |
|
641 |
||
642 |
^ShortFloat |
|
643 |
||
644 |
"Created: / 20-12-2010 / 22:06:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
645 |
! ! |
|
646 |
!FloatArray class methodsFor:'accessing'! |
|
647 |
||
648 |
javaName |
|
649 |
||
650 |
^'[F'. |
|
651 |
||
652 |
"Modified: / 25-02-2011 / 19:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
653 |
! ! |
|
654 |
!GenericToolbarIconLibrary class methodsFor:'image specs'! |
|
655 |
||
656 |
javaClassBrowserIcon |
|
657 |
"This resource specification was automatically generated |
|
658 |
by the ImageEditor of ST/X." |
|
659 |
||
660 |
"Do not manually edit this!! If it is corrupted, |
|
661 |
the ImageEditor may not be able to read the specification." |
|
662 |
||
663 |
" |
|
664 |
self javaClassBrowserIcon inspect |
|
665 |
ImageEditor openOnClass:self andSelector:#javaClassBrowserIcon |
|
666 |
Icon flushCachedIcons |
|
667 |
" |
|
668 |
||
669 |
<resource: #image> |
|
670 |
||
671 |
^Icon |
|
672 |
constantNamed:'GenericToolbarIconLibrary class javaClassBrowserIcon' |
|
673 |
ifAbsentPut:[(Depth24Image new) width: 13; height: 11; photometric:(#rgb); bitsPerSample:(#[8 8 8]); samplesPerPixel:(3); bits:(ByteArray fromPackedString:' |
|
674 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
675 |
@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@ |
|
676 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@ |
|
677 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@96<@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
678 |
@@@@@@@@96<@96<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; mask:((Depth1Image new) width: 13; height: 11; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@\CA0LG@0\CA0LG@0\CA0\GA \@A0@a') ; yourself); yourself] |
|
679 |
! ! |
|
680 |
!Integer class methodsFor:'queries'! |
|
681 |
||
682 |
isJavaPrimitiveType |
|
683 |
||
684 |
^true |
|
685 |
||
686 |
"Created: / 11-02-2011 / 11:12:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
687 |
! ! |
|
688 |
!Integer class methodsFor:'accessing'! |
|
689 |
||
851 | 690 |
javaArrayClass |
873
933263bd2d27
Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents:
866
diff
changeset
|
691 |
^ SignedIntegerArray |
851 | 692 |
|
693 |
"Created: / 11-02-2011 / 10:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
694 |
! ! |
|
917 | 695 |
!Integer class methodsFor:'autoboxing support'! |
696 |
||
697 |
javaBox:anObject |
|
698 |
||
699 |
| wrapper | |
|
700 |
||
701 |
wrapper := (Java classForName: 'java.lang.Integer') new. |
|
702 |
wrapper perform: #'<init>(I)V' with: anObject. |
|
703 |
^wrapper |
|
704 |
||
705 |
"Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
706 |
! ! |
|
851 | 707 |
!Integer class methodsFor:'accessing'! |
708 |
||
752 | 709 |
javaName |
710 |
||
711 |
^'int'. |
|
712 |
||
713 |
"Modified: / 25-02-2011 / 18:59:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
714 |
! ! |
|
715 |
!LargeInteger class methodsFor:'queries'! |
|
716 |
||
717 |
isJavaPrimitiveType |
|
718 |
||
719 |
^true |
|
720 |
||
721 |
"Created: / 04-02-2011 / 11:55:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
722 |
! ! |
|
723 |
!LargeInteger class methodsFor:'accessing'! |
|
724 |
||
851 | 725 |
javaArrayClass |
873
933263bd2d27
Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents:
866
diff
changeset
|
726 |
^ SignedLongIntegerArray |
851 | 727 |
|
728 |
"Created: / 11-02-2011 / 10:51:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
729 |
! ! |
|
917 | 730 |
!LargeInteger class methodsFor:'autoboxing support'! |
731 |
||
732 |
javaBox:anObject |
|
733 |
||
734 |
| wrapper | |
|
735 |
||
736 |
wrapper := (Java classForName: 'java.lang.Long') new. |
|
737 |
wrapper perform: #'<init>(J)V' with: anObject. |
|
738 |
^wrapper |
|
739 |
||
740 |
"Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
741 |
! ! |
|
851 | 742 |
!LargeInteger class methodsFor:'accessing'! |
743 |
||
752 | 744 |
javaName |
745 |
||
746 |
^'long'. |
|
747 |
||
748 |
"Modified: / 25-02-2011 / 18:59:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
749 |
! ! |
|
750 |
!Object class methodsFor:'queries'! |
|
751 |
||
752 |
isJavaArrayClass |
|
753 |
||
754 |
^false |
|
755 |
||
756 |
"Created: / 19-12-2010 / 17:05:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
757 |
! ! |
|
758 |
!Object class methodsFor:'queries'! |
|
759 |
||
760 |
isJavaClassType |
|
761 |
||
762 |
^false |
|
763 |
||
764 |
"Created: / 11-02-2011 / 08:08:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
765 |
! ! |
|
766 |
!Object class methodsFor:'queries'! |
|
767 |
||
768 |
isJavaPrimitiveType |
|
769 |
||
770 |
^false |
|
771 |
||
772 |
"Created: / 20-12-2010 / 21:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
773 |
! ! |
|
774 |
!Object class methodsFor:'queries'! |
|
775 |
||
776 |
isJavaReferenceType |
|
777 |
||
778 |
^false |
|
779 |
||
780 |
"Created: / 20-12-2010 / 21:52:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
781 |
! ! |
|
782 |
!Object class methodsFor:'queries'! |
|
783 |
||
784 |
isJavaType |
|
785 |
||
786 |
^false |
|
787 |
||
788 |
"Created: / 20-12-2010 / 21:52:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
789 |
! ! |
|
790 |
!ShortFloat class methodsFor:'queries'! |
|
791 |
||
792 |
isJavaPrimitiveType |
|
793 |
||
794 |
^true |
|
795 |
||
796 |
"Created: / 06-02-2011 / 17:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
797 |
! ! |
|
798 |
!ShortFloat class methodsFor:'accessing'! |
|
799 |
||
851 | 800 |
javaArrayClass |
801 |
^ FloatArray |
|
802 |
||
803 |
"Created: / 11-02-2011 / 10:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
804 |
! ! |
|
917 | 805 |
!ShortFloat class methodsFor:'autoboxing support'! |
806 |
||
807 |
javaBox:anObject |
|
808 |
||
809 |
| wrapper | |
|
810 |
||
811 |
wrapper := (Java classForName: 'java.lang.Float') new. |
|
812 |
wrapper perform: #'<init>(F)V' with: anObject. |
|
813 |
^wrapper |
|
814 |
||
815 |
"Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
816 |
! ! |
|
851 | 817 |
!ShortFloat class methodsFor:'accessing'! |
818 |
||
752 | 819 |
javaName |
820 |
||
821 |
^'float'. |
|
822 |
||
823 |
"Modified: / 25-02-2011 / 18:59:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
824 |
! ! |
|
866 | 825 |
!SignedIntegerArray class methodsFor:'testing'! |
826 |
||
827 |
isInterface |
|
828 |
||
829 |
^false |
|
830 |
! ! |
|
831 |
!SignedIntegerArray class methodsFor:'queries'! |
|
832 |
||
833 |
isJavaArrayClass |
|
834 |
||
835 |
^true |
|
836 |
||
837 |
"Created: / 06-02-2011 / 15:16:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
838 |
! ! |
|
905 | 839 |
!SignedIntegerArray class methodsFor:'accessing-java'! |
840 |
||
841 |
javaArrayClass |
|
842 |
||
843 |
^JavaArray javaArrayClassFor: SignedIntegerArray |
|
844 |
||
845 |
"Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
846 |
"Modified: / 10-08-2011 / 22:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
847 |
! ! |
|
866 | 848 |
!SignedIntegerArray class methodsFor:'accessing'! |
849 |
||
850 |
javaComponentClass |
|
851 |
||
852 |
^ Integer |
|
853 |
||
854 |
"Created: / 25-06-2011 / 08:38:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
855 |
! ! |
|
856 |
!SignedIntegerArray class methodsFor:'accessing'! |
|
857 |
||
858 |
javaName |
|
859 |
||
860 |
^'[I'. |
|
861 |
||
862 |
"Modified: / 25-02-2011 / 19:03:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
863 |
! ! |
|
864 |
!SignedLongIntegerArray class methodsFor:'testing'! |
|
865 |
||
866 |
isInterface |
|
867 |
||
868 |
^false |
|
869 |
! ! |
|
870 |
!SignedLongIntegerArray class methodsFor:'queries'! |
|
871 |
||
872 |
isJavaArrayClass |
|
873 |
||
874 |
^true |
|
875 |
||
876 |
"Created: / 20-12-2010 / 22:47:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
877 |
! ! |
|
878 |
!SignedLongIntegerArray class methodsFor:'queries'! |
|
879 |
||
880 |
isJavaReferenceType |
|
881 |
||
882 |
"Java arrays are reference types" |
|
883 |
^true |
|
884 |
||
885 |
"Created: / 20-12-2010 / 22:30:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
886 |
! ! |
|
927 | 887 |
!SignedLongIntegerArray class methodsFor:'accessing-java'! |
888 |
||
889 |
javaArrayClass |
|
890 |
||
891 |
^JavaArray javaArrayClassFor: SignedLongIntegerArray |
|
892 |
||
893 |
"Modified: / 10-08-2011 / 22:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
894 |
"Created: / 26-08-2011 / 18:29:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
895 |
! ! |
|
866 | 896 |
!SignedLongIntegerArray class methodsFor:'accessing'! |
897 |
||
898 |
javaComponentClass |
|
899 |
||
900 |
^LargeInteger |
|
901 |
||
902 |
"Modified: / 25-06-2011 / 08:38:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
903 |
! ! |
|
904 |
!SignedLongIntegerArray class methodsFor:'accessing'! |
|
905 |
||
906 |
javaName |
|
907 |
||
908 |
^'[J'. |
|
909 |
||
910 |
"Modified: / 25-02-2011 / 19:03:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
911 |
! ! |
|
752 | 912 |
!UndefinedObject class methodsFor:'queries'! |
913 |
||
914 |
isJavaPrimitiveType |
|
915 |
||
916 |
"void" |
|
917 |
||
918 |
^true |
|
919 |
||
920 |
"Created: / 21-12-2010 / 22:52:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
921 |
! ! |
|
922 |
!UndefinedObject class methodsFor:'accessing'! |
|
923 |
||
924 |
javaName |
|
925 |
||
926 |
^'void'. |
|
927 |
||
928 |
"Modified: / 25-02-2011 / 18:59:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
929 |
! ! |
|
826
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
930 |
!WordArray class methodsFor:'testing'! |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
931 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
932 |
isInterface |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
933 |
|
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
934 |
^false |
db53b9c842d7
- TestletTestCaseProxy: debugging support improved.
vranyj1
parents:
774
diff
changeset
|
935 |
! ! |
752 | 936 |
!WordArray class methodsFor:'queries'! |
937 |
||
938 |
isJavaArrayClass |
|
939 |
||
940 |
^true |
|
941 |
||
942 |
"Created: / 20-12-2010 / 22:47:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
943 |
! ! |
|
944 |
!WordArray class methodsFor:'queries'! |
|
945 |
||
946 |
isJavaReferenceType |
|
947 |
||
948 |
"Java arrays are reference types" |
|
949 |
^true |
|
950 |
||
951 |
"Created: / 20-12-2010 / 22:30:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
952 |
! ! |
|
953 |
!WordArray class methodsFor:'accessing-java'! |
|
954 |
||
905 | 955 |
javaArrayClass |
956 |
||
957 |
^JavaArray javaArrayClassFor: WordArray |
|
958 |
||
959 |
"Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
960 |
"Modified: / 10-08-2011 / 22:46:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
961 |
! ! |
|
962 |
!WordArray class methodsFor:'accessing-java'! |
|
963 |
||
752 | 964 |
javaComponentClass |
965 |
||
966 |
^Short |
|
967 |
||
968 |
"Created: / 20-12-2010 / 22:13:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
969 |
! ! |
|
970 |
!WordArray class methodsFor:'accessing'! |
|
971 |
||
972 |
javaName |
|
973 |
||
974 |
^'['. |
|
975 |
! ! |
|
1020 | 976 |
!stx_libjava class methodsFor:'documentation'! |
977 |
||
978 |
extensionsVersion_SVN |
|
979 |
^ '$Id$' |
|
980 |
! ! |