JavaClassRef subclass:#JavaBuiltInClassPointerRef
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Java-Reader-Support'
!
!JavaBuiltInClassPointerRef methodsFor:'accessing'!
nameandType:aJavaNameandType
nameandType := aJavaNameandType.
nameandType = '[B' ifTrue:[ "/ byte[]
class := ByteArray.
^ self
].
nameandType = '[Z' ifTrue:[ "/ boolean[]
class := ByteArray.
^ self
].
nameandType = '[I' ifTrue:[ "/ int[]
class := SignedIntegerArray.
^ self
].
nameandType = '[J' ifTrue:[ "/ long[]
class := Array.
^ self
].
nameandType = '[S' ifTrue:[ "/ short[]
class := SignedWordArray.
^ self
].
nameandType = '[C' ifTrue:[ "/ char[]
class := String. "/ should be TwoByteString ...
^ self
].
nameandType = '[F' ifTrue:[ "/ float[]
class := FloatArray.
^ self
].
nameandType = '[D' ifTrue:[ "/ double[]
class := DoubleArray.
^ self
].
"/ nameandType = '[[D' ifTrue:[ "/ double[][]
"/ ref := JavaBuiltInClassPointerRef class:DoubleArray nameandType:fullName.
"/ constantPool at:constantPoolIndex put:ref.
"/ ^ ref
"/ ].
"/ nameandType = '[[I' ifTrue:[ "/ int[][]
"/ ref := JavaBuiltInClassPointerRef class:Array nameandType:fullName.
"/ constantPool at:constantPoolIndex put:ref.
"/ ^ ref
"/ ].
self halt.
"Modified: / 13.1.1998 / 00:08:04 / cg"
! !
!JavaBuiltInClassPointerRef methodsFor:'printing & storing'!
displayString
^ self class name , '(class:' , class name , ' ; name&type: ' , nameandType displayString , ')'
! !
!JavaBuiltInClassPointerRef methodsFor:'queries'!
arrayClass
(nameandType startsWith:'[[') ifTrue:[
^ Array
].
(nameandType startsWith:'[I') ifTrue:[
^ SignedIntegerArray
].
(nameandType startsWith:'[B') ifTrue:[
^ ByteArray
].
self halt.
^ self
"Created: / 13.1.1998 / 00:02:39 / cg"
"Modified: / 13.1.1998 / 00:03:07 / cg"
!
asClassPointerRef
^ self
"Created: / 13.1.1998 / 00:01:02 / cg"
"Modified: / 13.1.1998 / 00:10:00 / cg"
!
deref
(nameandType startsWith:'[[') ifTrue:[
^ self class new nameandType:(nameandType copyFrom:2)
].
self halt.
"Created: / 13.1.1998 / 00:03:44 / cg"
"Modified: / 13.1.1998 / 00:09:15 / cg"
!
isUnresolved
^ false
"Created: 2.7.1996 / 17:17:39 / cg"
!
javaClass
^ class
"Created: 2.7.1996 / 17:19:43 / cg"
! !
!JavaBuiltInClassPointerRef class methodsFor:'documentation'!
version
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaBuiltInClassPointerRef.st,v 1.5 1998/01/16 16:11:11 cg Exp $'
! !