1 " |
1 " |
2 COPYRIGHT (c) 1996-2011 by Claus Gittinger |
2 COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
3 |
|
4 New code and modifications done at SWING Research Group [1]: |
|
5 |
|
6 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
7 SWING Research Group, Czech Technical University in Prague |
3 |
8 |
4 This software is furnished under a license and may be used |
9 This software is furnished under a license and may be used |
5 only in accordance with the terms of that license and with the |
10 only in accordance with the terms of that license and with the |
6 inclusion of the above copyright notice. This software may not |
11 inclusion of the above copyright notice. This software may not |
7 be provided or otherwise made available to, or used by, any |
12 be provided or otherwise made available to, or used by, any |
8 other person. No title to or ownership of the software is |
13 other person. No title to or ownership of the software is |
9 hereby transferred. |
14 hereby transferred. |
|
15 |
|
16 [1] Code written at SWING Research Group contains a signature |
|
17 of one of the above copright owners. For exact set of such code, |
|
18 see the differences between this version and version stx:libjava |
|
19 as of 1.9.2010 |
10 " |
20 " |
11 "{ Package: 'stx:libjava' }" |
21 "{ Package: 'stx:libjava' }" |
12 |
22 |
13 Class subclass:#JavaBehavior |
23 Class subclass:#JavaBehavior |
14 instanceVariableNames:'constantPool interfaces accessFlags' |
24 instanceVariableNames:'constantPool interfaces accessFlags initValues' |
15 classVariableNames:'InitialValuePerType A_OBSOLETE A_INTERFACE A_PUBLIC A_FINAL |
25 classVariableNames:'InitialValuePerType ACX_ABSTRACT_OR_INTERFACE' |
16 A_ABSTRACT A_INITIALIZED A_SMALLTALK A_ABSTRACT_OR_INTERFACE |
26 poolDictionaries:'JavaConstants' |
17 A_STATIC A_NATIVE A_SYNTHETIC A_ANNOTATION A_ENUM' |
|
18 poolDictionaries:'' |
|
19 category:'Languages-Java-Classes' |
27 category:'Languages-Java-Classes' |
20 ! |
28 ! |
21 |
29 |
22 !JavaBehavior class methodsFor:'documentation'! |
30 !JavaBehavior class methodsFor:'documentation'! |
23 |
31 |
24 copyright |
32 copyright |
25 " |
33 " |
26 COPYRIGHT (c) 1996-2011 by Claus Gittinger |
34 COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
35 |
|
36 New code and modifications done at SWING Research Group [1]: |
|
37 |
|
38 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
39 SWING Research Group, Czech Technical University in Prague |
27 |
40 |
28 This software is furnished under a license and may be used |
41 This software is furnished under a license and may be used |
29 only in accordance with the terms of that license and with the |
42 only in accordance with the terms of that license and with the |
30 inclusion of the above copyright notice. This software may not |
43 inclusion of the above copyright notice. This software may not |
31 be provided or otherwise made available to, or used by, any |
44 be provided or otherwise made available to, or used by, any |
32 other person. No title to or ownership of the software is |
45 other person. No title to or ownership of the software is |
33 hereby transferred. |
46 hereby transferred. |
34 |
47 |
|
48 [1] Code written at SWING Research Group contains a signature |
|
49 of one of the above copright owners. For exact set of such code, |
|
50 see the differences between this version and version stx:libjava |
|
51 as of 1.9.2010 |
|
52 |
35 " |
53 " |
36 ! |
54 ! |
37 |
55 |
38 documentation |
56 documentation |
39 " |
57 " |
40 Describes what is known and required by the VM. |
58 A base class for all Java classes. Slots & behavior defined here |
|
59 is known to the VM. Do not change the order of slots and |
|
60 add only to the end. You will have to modify stc.h then. |
|
61 |
|
62 Non-VM known stuff could be added to JavaClass safely. |
|
63 |
|
64 [author:] |
|
65 Jan Vrany <jan.vrany@fit.cvut.cz> |
|
66 |
|
67 [instance variables:] |
|
68 constantPool |
|
69 interfaces |
|
70 accessFlags |
|
71 [class variables:] |
|
72 |
|
73 [see also:] |
|
74 |
41 " |
75 " |
42 ! ! |
76 ! ! |
43 |
77 |
44 !JavaBehavior class methodsFor:'initialization'! |
78 !JavaBehavior class methodsFor:'initialization'! |
45 |
79 |
46 initialize |
80 initialize |
47 "/ those are defined in Java and read from the classFile |
81 |
48 A_PUBLIC := 16r000001. |
82 "/ Cannot do this as the constant pool may not be initialized |
49 "/ A_PRIVATE := 16r000002. |
83 "/ACX_ABSTRACT_OR_INTERFACE := ACC_ABSTRACT bitOr:ACC_INTERFACE. |
50 "/ A_PROTECTED := 16r000004. |
84 ACX_ABSTRACT_OR_INTERFACE := 16r0000400 bitOr: 16r0000200. |
51 A_STATIC := 16r000008. |
|
52 A_FINAL := 16r000010. |
|
53 "/ A_SUPER := 16r000020. |
|
54 "/ A_SYNCHRONIZED := 16r000020. |
|
55 "/ A_VOLATILE := 16r000040. |
|
56 "/ A_TRANSIENT := 16r000080. |
|
57 A_NATIVE := 16r000100. |
|
58 |
|
59 A_INTERFACE := 16r000200. |
|
60 A_ABSTRACT := 16r000400. |
|
61 A_SYNTHETIC := 16r001000. "/ 1.1 |
|
62 A_ANNOTATION := 16r002000. "/ 1.1 |
|
63 A_ENUM := 16r004000. "/ 1.1 |
|
64 A_OBSOLETE := 16r008000. |
|
65 |
|
66 "/ those are local to the ST/X implementation |
|
67 A_INITIALIZED := 16r100000. |
|
68 A_SMALLTALK := 16r200000. |
|
69 |
|
70 A_ABSTRACT_OR_INTERFACE := A_ABSTRACT bitOr:A_INTERFACE. |
|
71 |
85 |
72 InitialValuePerType := IdentityDictionary new. |
86 InitialValuePerType := IdentityDictionary new. |
73 InitialValuePerType at:$B put:0. |
87 InitialValuePerType at:$B put:0. |
74 InitialValuePerType at:$C put:0. |
88 InitialValuePerType at:$C put:0. |
75 InitialValuePerType at:$D put:0.0. |
89 InitialValuePerType at:$D put:0.0. |
235 |
255 |
236 isAbstract |
256 isAbstract |
237 "return true, if the receiver is abstract |
257 "return true, if the receiver is abstract |
238 (i.e. may not have instances)" |
258 (i.e. may not have instances)" |
239 |
259 |
240 ^ (accessFlags bitAnd:A_ABSTRACT) ~~ 0 |
260 ^ (accessFlags bitAnd:ACC_ABSTRACT) ~~ 0 |
241 |
261 |
242 "Modified: / 7.5.1998 / 12:24:42 / cg" |
262 "Modified: / 7.5.1998 / 12:24:42 / cg" |
|
263 ! |
|
264 |
|
265 isAnnotation |
|
266 "return true, if the receiver is an interface" |
|
267 |
|
268 ^ (accessFlags bitAnd:ACC_ANNOTATION) ~~ 0 |
|
269 |
|
270 "Modified: / 07-05-1998 / 12:23:39 / cg" |
|
271 "Created: / 11-02-2012 / 16:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
272 ! |
|
273 |
|
274 isEnum |
|
275 "return true, if the receiver is an interface" |
|
276 |
|
277 ^ (accessFlags bitAnd:ACC_ENUM) ~~ 0 |
|
278 |
|
279 "Modified: / 07-05-1998 / 12:23:39 / cg" |
|
280 "Created: / 11-02-2012 / 16:55:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
243 ! |
281 ! |
244 |
282 |
245 isFinal |
283 isFinal |
246 "return true, if the receiver is final |
284 "return true, if the receiver is final |
247 (i.e. may not be subclassed)" |
285 (i.e. may not be subclassed)" |
248 |
286 |
249 ^ (accessFlags bitAnd:A_FINAL) ~~ 0 |
287 ^ (accessFlags bitAnd:ACC_FINAL) ~~ 0 |
250 |
288 |
251 "Modified: / 7.5.1998 / 12:24:21 / cg" |
289 "Modified: / 7.5.1998 / 12:24:21 / cg" |
252 ! |
290 ! |
253 |
291 |
254 isInitialized |
292 isInitialized |
255 "return true, if the receiver is initialized" |
293 "return true, if the receiver is initialized" |
256 |
294 |
257 ^ (accessFlags bitAnd:A_INITIALIZED) ~~ 0 |
295 ^ (accessFlags bitAnd:ACX_INITIALIZED) ~~ 0 |
258 |
296 |
259 "Modified: / 7.5.1998 / 12:23:54 / cg" |
297 "Modified: / 7.5.1998 / 12:23:54 / cg" |
260 ! |
298 ! |
261 |
299 |
262 isInterface |
300 isInterface |
263 "return true, if the receiver is an interface" |
301 "return true, if the receiver is an interface" |
264 |
302 |
265 ^ (accessFlags bitAnd:A_INTERFACE) ~~ 0 |
303 ^ (accessFlags bitAnd:ACC_INTERFACE) ~~ 0 |
266 |
304 |
267 "Modified: / 7.5.1998 / 12:23:39 / cg" |
305 "Modified: / 7.5.1998 / 12:23:39 / cg" |
268 ! |
306 ! |
269 |
307 |
270 isObsolete |
308 isObsolete |
271 "return true, if the receiver is obsolete |
309 "return true, if the receiver is obsolete |
272 Java classes are never." |
310 Java classes are never." |
273 |
311 |
274 ^ (accessFlags bitAnd:A_OBSOLETE) ~~ 0. |
312 ^ (accessFlags bitAnd:ACC_OBSOLETE) ~~ 0. |
275 |
313 |
276 "Modified: 7.8.1997 / 19:04:28 / cg" |
314 "Modified: 7.8.1997 / 19:04:28 / cg" |
|
315 ! |
|
316 |
|
317 isPackagePrivate |
|
318 ^ (accessFlags bitAnd:ACC_PRIVATE | ACC_PUBLIC | ACC_PROTECTED) = 0 |
|
319 |
|
320 "Created: / 05-07-2012 / 10:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
321 ! |
|
322 |
|
323 isPrivate |
|
324 "return true, if the receiver is an interface" |
|
325 |
|
326 ^ (accessFlags bitAnd:ACC_PRIVATE) ~~ 0 |
|
327 |
|
328 "Modified: / 07-05-1998 / 12:23:39 / cg" |
|
329 "Created: / 11-02-2012 / 16:55:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
330 ! |
|
331 |
|
332 isProtected |
|
333 "return true, if the receiver is an interface" |
|
334 |
|
335 ^ (accessFlags bitAnd:ACC_PROTECTED) ~~ 0 |
|
336 |
|
337 "Modified: / 07-05-1998 / 12:23:39 / cg" |
|
338 "Created: / 11-02-2012 / 16:56:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
277 ! |
339 ! |
278 |
340 |
279 isPublic |
341 isPublic |
280 "return true, if the receiver is public" |
342 "return true, if the receiver is public" |
281 |
343 |
282 ^ (accessFlags bitAnd:A_PUBLIC) ~~ 0 |
344 ^ (accessFlags bitAnd:ACC_PUBLIC) ~~ 0 |
283 |
345 |
284 "Modified: / 7.5.1998 / 12:22:44 / cg" |
346 "Modified: / 7.5.1998 / 12:22:44 / cg" |
|
347 ! |
|
348 |
|
349 isSynthetic |
|
350 "return true, if the receiver is a synthetic class |
|
351 (usually a proxy generated at runtime)" |
|
352 |
|
353 ^ (accessFlags bitAnd:ACC_SYNTHETIC) ~~ 0 |
|
354 |
|
355 "Created: / 13-04-2012 / 18:51:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
285 ! ! |
356 ! ! |
286 |
357 |
287 !JavaBehavior class methodsFor:'documentation'! |
358 !JavaBehavior class methodsFor:'documentation'! |
288 |
359 |
289 version |
360 version |
290 ^ '$Header: /cvs/stx/stx/libjava/JavaBehavior.st,v 1.6 2011-11-24 11:54:40 cg Exp $' |
361 ^ '$Header: /cvs/stx/stx/libjava/JavaBehavior.st,v 1.7 2013-02-16 18:08:32 vrany Exp $' |
291 ! |
362 ! |
292 |
363 |
293 version_CVS |
364 version_CVS |
294 ^ '$Header: /cvs/stx/stx/libjava/JavaBehavior.st,v 1.6 2011-11-24 11:54:40 cg Exp $' |
365 ^ '$Header: /cvs/stx/stx/libjava/JavaBehavior.st,v 1.7 2013-02-16 18:08:32 vrany Exp $' |
|
366 ! |
|
367 |
|
368 version_HG |
|
369 |
|
370 ^ '$Changeset: <not expanded> $' |
295 ! |
371 ! |
296 |
372 |
297 version_SVN |
373 version_SVN |
298 ^ '§Id: JavaBehavior.st,v 1.4 2011/08/18 18:42:48 vrany Exp §' |
374 ^ '§Id§' |
299 ! ! |
375 ! ! |
|
376 |
300 |
377 |
301 JavaBehavior initialize! |
378 JavaBehavior initialize! |