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