JavaNameandType.st
author Claus Gittinger <cg@exept.de>
Wed, 10 Dec 2003 11:06:45 +0100
changeset 2114 cbdc4c02a8e2
parent 2108 ca8c4e7db2e8
permissions -rw-r--r--
ExecutionErrorSignal -> ExecutionError

"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"



"{ Package: 'stx:libjava' }"

Object subclass:#JavaNameandType
	instanceVariableNames:'name signature'
	classVariableNames:'KnownNamesAndTypes'
	poolDictionaries:''
	category:'Languages-Java-Reader-Support'
!

!JavaNameandType class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


! !

!JavaNameandType class methodsFor:'instance creation'!

name:aString signature:signature
    |idx nt|

"/    KnownNamesAndTypes notNil ifTrue:[
"/        idx := KnownNamesAndTypes findFirst:[:nt | nt signature == signature and:[nt name = aString]].
"/        idx ~~ 0 ifTrue:[
"/            nt := KnownNamesAndTypes at:idx.
"/            (nt ~~ 0 and:[nt notNil]) ifTrue:[
"/                ^ nt
"/            ]
"/        ]
"/    ].
    nt := self new name:aString signature:signature.
"/    KnownNamesAndTypes isNil ifTrue:[
"/        KnownNamesAndTypes := WeakIdentitySet new.
"/    ].
"/    KnownNamesAndTypes add:nt.
    ^ nt

    "Created: / 15.4.1996 / 16:17:14 / cg"
    "Modified: / 16.5.1998 / 02:59:54 / cg"
! !

!JavaNameandType methodsFor:'accessing'!

name
     ^ name 

    "Created: 15.4.1996 / 16:16:47 / cg"
!

name:aString signature:aSignature
     name := aString asSymbol.
     signature := aSignature asSymbol

    "Created: 15.4.1996 / 16:16:47 / cg"
!

signature
     ^ signature 

    "Created: 15.4.1996 / 16:16:47 / cg"
! !

!JavaNameandType methodsFor:'comparing'!

= aNameandType
    name ~= aNameandType name ifTrue:[^ false].
    ^ signature = aNameandType signature

    "Created: 19.8.1997 / 13:58:29 / cg"
!

hash
    ^ name hash bitXor:signature hash

    "Created: 19.8.1997 / 13:59:03 / cg"
! !

!JavaNameandType methodsFor:'printing & storing'!

displayString
    ^ self class name , '(name:' , name displayString, ' signature:' , signature displayString , ')'

    "Created: 15.4.1996 / 16:32:40 / cg"
! !

!JavaNameandType methodsFor:'queries'!

isJavaClassRef
    ^ false

    "Created: / 9.11.1999 / 17:13:22 / cg"
    "Modified: / 9.11.1999 / 17:13:45 / cg"
!

isJavaMethodRef
    ^ false

    "Created: / 9.11.1999 / 15:50:01 / cg"
!

isUnresolved
    ^ false


! !

!JavaNameandType methodsFor:'special'!

updateClassRefsFrom:oldClass to:newClass
    "/ nothing done here

    "Created: 7.8.1997 / 15:12:25 / cg"
! !

!JavaNameandType class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libjava/Attic/JavaNameandType.st,v 1.12 2002-11-22 20:11:50 cg Exp $'
! !