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