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