author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 25 Jan 2013 00:15:51 +0000 | |
branch | refactoring-classpath |
changeset 2000 | 13a10b73aa83 |
parent 1864 | 60a8dc26c8c6 |
child 2069 | 75d40b7b986f |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
15 |
||
1155 | 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 |
|
1152 | 19 |
as of 1.9.2010 |
877 | 20 |
" |
752 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
1155 | 23 |
Integer subclass:#JavaShort |
752 | 24 |
instanceVariableNames:'value' |
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
1155 | 27 |
category:'Languages-Java-Support' |
752 | 28 |
! |
29 |
||
1155 | 30 |
!JavaShort class methodsFor:'documentation'! |
752 | 31 |
|
877 | 32 |
copyright |
33 |
" |
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 35 |
|
1155 | 36 |
New code and modifications done at SWING Research Group [1]: |
1152 | 37 |
|
877 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
39 |
SWING Research Group, Czech Technical University in Prague |
|
40 |
||
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
1155 | 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 |
|
1152 | 51 |
as of 1.9.2010 |
877 | 52 |
|
53 |
" |
|
752 | 54 |
! ! |
55 |
||
1155 | 56 |
!JavaShort class methodsFor:'accessing'! |
752 | 57 |
|
851 | 58 |
javaArrayClass |
59 |
^ WordArray |
|
752 | 60 |
|
61 |
"Created: / 11-02-2011 / 10:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
62 |
! |
|
63 |
||
64 |
javaName |
|
65 |
||
66 |
^'short'. |
|
67 |
||
68 |
"Modified: / 25-02-2011 / 18:59:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1385 | 69 |
! |
70 |
||
71 |
javaWrapperClass |
|
72 |
^(Java classForName: 'java.lang.Short') |
|
73 |
||
74 |
"Created: / 24-02-2012 / 19:42:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 75 |
! ! |
76 |
||
1155 | 77 |
!JavaShort class methodsFor:'autoboxing support'! |
880
a9171dcee2b0
Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents:
877
diff
changeset
|
78 |
|
1033 | 79 |
javaBox: anObject |
917 | 80 |
| wrapper | |
81 |
||
1033 | 82 |
wrapper := (JavaVM classForName: 'java.lang.Short') new. |
917 | 83 |
wrapper perform: #'<init>(S)V' with: anObject. |
1033 | 84 |
^ wrapper |
917 | 85 |
|
86 |
"Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
87 |
! |
|
88 |
||
915 | 89 |
javaUnbox:anObject |
90 |
self assert:anObject class isJavaClass message:'Not a java object'. |
|
91 |
self assert:anObject class name = 'java/lang/Short' |
|
92 |
message:'Invalid java wrapper class'. |
|
93 |
^ anObject instVarNamed:#value |
|
880
a9171dcee2b0
Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents:
877
diff
changeset
|
94 |
|
a9171dcee2b0
Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents:
877
diff
changeset
|
95 |
"Created: / 05-08-2011 / 19:08:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1151 | 96 |
! |
97 |
||
98 |
javaUnbox: object onError: errorBlock |
|
99 |
||
100 |
^self javaUnbox: object onError: errorBlock |
|
101 |
min: "Short.MIN_VALUE"-32768 |
|
102 |
max: "Short.MAX_VALUE" 32767 |
|
103 |
||
104 |
"Created: / 22-11-2011 / 11:44:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
880
a9171dcee2b0
Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents:
877
diff
changeset
|
105 |
! ! |
a9171dcee2b0
Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents:
877
diff
changeset
|
106 |
|
1155 | 107 |
!JavaShort class methodsFor:'queries'! |
752 | 108 |
|
109 |
isJavaPrimitiveType |
|
110 |
||
111 |
^true |
|
112 |
||
113 |
"Created: / 20-12-2010 / 22:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
114 |
! ! |
|
115 |
||
1155 | 116 |
!JavaShort class methodsFor:'documentation'! |
752 | 117 |
|
1864 | 118 |
version_HG |
119 |
||
120 |
^ '$Changeset: <not expanded> $' |
|
121 |
! |
|
122 |
||
752 | 123 |
version_SVN |
1864 | 124 |
^ '§Id§' |
752 | 125 |
! ! |