454
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
|
|
14 |
|
713
|
15 |
"{ Package: 'stx:libjava' }"
|
|
16 |
|
106
|
17 |
JavaClassRef subclass:#JavaBuiltInClassPointerRef
|
|
18 |
instanceVariableNames:''
|
|
19 |
classVariableNames:''
|
|
20 |
poolDictionaries:''
|
713
|
21 |
category:'Languages-Java-Reader-Support'
|
106
|
22 |
!
|
|
23 |
|
454
|
24 |
!JavaBuiltInClassPointerRef class methodsFor:'documentation'!
|
|
25 |
|
|
26 |
copyright
|
|
27 |
"
|
|
28 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
29 |
All Rights Reserved
|
|
30 |
|
|
31 |
This software is furnished under a license and may be used
|
|
32 |
only in accordance with the terms of that license and with the
|
|
33 |
inclusion of the above copyright notice. This software may not
|
|
34 |
be provided or otherwise made available to, or used by, any
|
|
35 |
other person. No title to or ownership of the software is
|
|
36 |
hereby transferred.
|
|
37 |
"
|
|
38 |
|
|
39 |
|
|
40 |
! !
|
106
|
41 |
|
260
|
42 |
!JavaBuiltInClassPointerRef methodsFor:'accessing'!
|
|
43 |
|
|
44 |
nameandType:aJavaNameandType
|
|
45 |
nameandType := aJavaNameandType.
|
|
46 |
|
|
47 |
nameandType = '[B' ifTrue:[ "/ byte[]
|
|
48 |
class := ByteArray.
|
|
49 |
^ self
|
|
50 |
].
|
|
51 |
nameandType = '[Z' ifTrue:[ "/ boolean[]
|
|
52 |
class := ByteArray.
|
|
53 |
^ self
|
|
54 |
].
|
|
55 |
nameandType = '[I' ifTrue:[ "/ int[]
|
261
|
56 |
class := SignedIntegerArray.
|
260
|
57 |
^ self
|
|
58 |
].
|
|
59 |
nameandType = '[J' ifTrue:[ "/ long[]
|
|
60 |
class := Array.
|
|
61 |
^ self
|
|
62 |
].
|
|
63 |
nameandType = '[S' ifTrue:[ "/ short[]
|
261
|
64 |
class := SignedWordArray.
|
260
|
65 |
^ self
|
|
66 |
].
|
|
67 |
nameandType = '[C' ifTrue:[ "/ char[]
|
|
68 |
class := String. "/ should be TwoByteString ...
|
|
69 |
^ self
|
|
70 |
].
|
|
71 |
nameandType = '[F' ifTrue:[ "/ float[]
|
|
72 |
class := FloatArray.
|
|
73 |
^ self
|
|
74 |
].
|
|
75 |
nameandType = '[D' ifTrue:[ "/ double[]
|
|
76 |
class := DoubleArray.
|
|
77 |
^ self
|
|
78 |
].
|
|
79 |
"/ nameandType = '[[D' ifTrue:[ "/ double[][]
|
|
80 |
"/ ref := JavaBuiltInClassPointerRef class:DoubleArray nameandType:fullName.
|
|
81 |
"/ constantPool at:constantPoolIndex put:ref.
|
|
82 |
"/ ^ ref
|
|
83 |
"/ ].
|
|
84 |
"/ nameandType = '[[I' ifTrue:[ "/ int[][]
|
|
85 |
"/ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
|
|
86 |
"/ constantPool at:constantPoolIndex put:ref.
|
|
87 |
"/ ^ ref
|
|
88 |
"/ ].
|
|
89 |
self halt.
|
|
90 |
|
|
91 |
"Modified: / 13.1.1998 / 00:08:04 / cg"
|
|
92 |
! !
|
|
93 |
|
109
|
94 |
!JavaBuiltInClassPointerRef methodsFor:'printing & storing'!
|
|
95 |
|
|
96 |
displayString
|
|
97 |
^ self class name , '(class:' , class name , ' ; name&type: ' , nameandType displayString , ')'
|
|
98 |
|
|
99 |
|
406
|
100 |
!
|
|
101 |
|
|
102 |
fullName
|
|
103 |
^ class name
|
|
104 |
|
|
105 |
"Created: / 20.10.1998 / 23:02:48 / cg"
|
109
|
106 |
! !
|
|
107 |
|
106
|
108 |
!JavaBuiltInClassPointerRef methodsFor:'queries'!
|
|
109 |
|
260
|
110 |
arrayClass
|
395
|
111 |
|tc|
|
|
112 |
|
|
113 |
nameandType size >= 2 ifTrue:[
|
|
114 |
(nameandType at:1) == $[ ifTrue:[
|
|
115 |
tc := nameandType at:2.
|
|
116 |
|
|
117 |
( tc == $[ ) ifTrue:[
|
|
118 |
^ Array
|
|
119 |
].
|
|
120 |
( tc == $I ) ifTrue:[
|
|
121 |
^ SignedIntegerArray
|
|
122 |
].
|
|
123 |
( tc == $B ) ifTrue:[
|
|
124 |
^ ByteArray
|
|
125 |
].
|
601
|
126 |
( tc == $Z ) ifTrue:[ "/ Boolean array
|
|
127 |
^ ByteArray
|
|
128 |
].
|
395
|
129 |
( tc == $C ) ifTrue:[
|
|
130 |
^ String "/ soon: TwoByteString
|
|
131 |
].
|
|
132 |
( tc == $D ) ifTrue:[
|
|
133 |
^ DoubleArray
|
|
134 |
].
|
|
135 |
( tc == $F ) ifTrue:[
|
|
136 |
^ FloatArray
|
|
137 |
].
|
|
138 |
].
|
394
|
139 |
].
|
260
|
140 |
|
|
141 |
self halt.
|
|
142 |
^ self
|
|
143 |
|
|
144 |
"Created: / 13.1.1998 / 00:02:39 / cg"
|
395
|
145 |
"Modified: / 20.10.1998 / 15:05:13 / cg"
|
260
|
146 |
!
|
|
147 |
|
|
148 |
asClassPointerRef
|
|
149 |
^ self
|
|
150 |
|
|
151 |
"Created: / 13.1.1998 / 00:01:02 / cg"
|
|
152 |
"Modified: / 13.1.1998 / 00:10:00 / cg"
|
|
153 |
!
|
|
154 |
|
|
155 |
deref
|
|
156 |
(nameandType startsWith:'[[') ifTrue:[
|
|
157 |
^ self class new nameandType:(nameandType copyFrom:2)
|
|
158 |
].
|
|
159 |
self halt.
|
|
160 |
|
|
161 |
"Created: / 13.1.1998 / 00:03:44 / cg"
|
|
162 |
"Modified: / 13.1.1998 / 00:09:15 / cg"
|
|
163 |
!
|
|
164 |
|
625
|
165 |
isJavaClassRef
|
|
166 |
^ false
|
|
167 |
|
|
168 |
"Created: / 9.11.1999 / 17:16:55 / cg"
|
|
169 |
!
|
|
170 |
|
106
|
171 |
isUnresolved
|
|
172 |
^ false
|
|
173 |
|
|
174 |
"Created: 2.7.1996 / 17:17:39 / cg"
|
|
175 |
!
|
|
176 |
|
|
177 |
javaClass
|
|
178 |
^ class
|
|
179 |
|
|
180 |
"Created: 2.7.1996 / 17:19:43 / cg"
|
564
|
181 |
!
|
|
182 |
|
|
183 |
javaClassForNew
|
|
184 |
^ self
|
|
185 |
|
|
186 |
"Created: 2.7.1996 / 17:19:43 / cg"
|
106
|
187 |
! !
|
|
188 |
|
135
|
189 |
!JavaBuiltInClassPointerRef class methodsFor:'documentation'!
|
106
|
190 |
|
|
191 |
version
|
713
|
192 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaBuiltInClassPointerRef.st,v 1.14 2002/11/22 20:11:28 cg Exp $'
|
106
|
193 |
! !
|