JavaNameandType.st
author cg
Sat, 16 May 1998 12:39:02 +0000
changeset 356 861abc393bc7
parent 244 30a32734cc47
child 454 38f590639d65
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     1
Object subclass:#JavaNameandType
083530508d9c intitial checkin
cg
parents:
diff changeset
     2
	instanceVariableNames:'name signature'
90
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
     3
	classVariableNames:'KnownNamesAndTypes'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     4
	poolDictionaries:''
4
07264ed96b97 checkin from browser
cg
parents: 1
diff changeset
     5
	category:'Java-Reader-Support'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     6
!
083530508d9c intitial checkin
cg
parents:
diff changeset
     7
083530508d9c intitial checkin
cg
parents:
diff changeset
     8
135
098936234135 *** empty log message ***
cg
parents: 90
diff changeset
     9
!JavaNameandType class methodsFor:'instance creation'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    10
083530508d9c intitial checkin
cg
parents:
diff changeset
    11
name:aString signature:signature
356
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    12
    |idx nt|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    13
356
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    14
"/    KnownNamesAndTypes notNil ifTrue:[
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    15
"/        idx := KnownNamesAndTypes findFirst:[:nt | nt signature == signature and:[nt name = aString]].
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    16
"/        idx ~~ 0 ifTrue:[
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    17
"/            nt := KnownNamesAndTypes at:idx.
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    18
"/            (nt ~~ 0 and:[nt notNil]) ifTrue:[
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    19
"/                ^ nt
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    20
"/            ]
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    21
"/        ]
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    22
"/    ].
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    23
    nt := self new name:aString signature:signature.
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    24
"/    KnownNamesAndTypes isNil ifTrue:[
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    25
"/        KnownNamesAndTypes := WeakIdentitySet new.
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    26
"/    ].
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    27
"/    KnownNamesAndTypes add:nt.
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    28
    ^ nt
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    29
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    30
    "Created: / 15.4.1996 / 16:17:14 / cg"
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    31
    "Modified: / 16.5.1998 / 02:59:54 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    32
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
    33
083530508d9c intitial checkin
cg
parents:
diff changeset
    34
!JavaNameandType methodsFor:'accessing'!
083530508d9c intitial checkin
cg
parents:
diff changeset
    35
27
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    36
name
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    37
     ^ name 
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    38
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    39
    "Created: 15.4.1996 / 16:16:47 / cg"
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    40
!
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    41
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    42
name:aString signature:aSignature
90
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    43
     name := aString asSymbol.
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    44
     signature := aSignature asSymbol
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    45
083530508d9c intitial checkin
cg
parents:
diff changeset
    46
    "Created: 15.4.1996 / 16:16:47 / cg"
27
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    47
!
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    48
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    49
signature
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    50
     ^ signature 
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    51
4560bb77bb36 checkin from browser
cg
parents: 4
diff changeset
    52
    "Created: 15.4.1996 / 16:16:47 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    53
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
    54
244
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    55
!JavaNameandType methodsFor:'comparing'!
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    56
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    57
= aNameandType
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    58
    name ~= aNameandType name ifTrue:[^ false].
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    59
    ^ signature = aNameandType signature
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    60
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    61
    "Created: 19.8.1997 / 13:58:29 / cg"
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    62
!
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    63
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    64
hash
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    65
    ^ name hash bitXor:signature hash
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    66
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    67
    "Created: 19.8.1997 / 13:59:03 / cg"
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    68
! !
30a32734cc47 checkin from browser
cg
parents: 203
diff changeset
    69
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    70
!JavaNameandType methodsFor:'printing & storing'!
083530508d9c intitial checkin
cg
parents:
diff changeset
    71
083530508d9c intitial checkin
cg
parents:
diff changeset
    72
displayString
90
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    73
    ^ self class name , '(name:' , name displayString, ' signature:' , signature displayString , ')'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    74
083530508d9c intitial checkin
cg
parents:
diff changeset
    75
    "Created: 15.4.1996 / 16:32:40 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
    76
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
    77
90
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    78
!JavaNameandType methodsFor:'queries'!
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    79
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    80
isUnresolved
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    81
    ^ false
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    82
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    83
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    84
! !
918e2740098c resolve rewritten
cg
parents: 27
diff changeset
    85
203
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    86
!JavaNameandType methodsFor:'special'!
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    87
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    88
updateClassRefsFrom:oldClass to:newClass
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    89
    "/ nothing done here
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    90
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    91
    "Created: 7.8.1997 / 15:12:25 / cg"
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    92
! !
67af98594672 *** empty log message ***
cg
parents: 135
diff changeset
    93
135
098936234135 *** empty log message ***
cg
parents: 90
diff changeset
    94
!JavaNameandType class methodsFor:'documentation'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    95
083530508d9c intitial checkin
cg
parents:
diff changeset
    96
version
356
861abc393bc7 checkin from browser
cg
parents: 244
diff changeset
    97
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaNameandType.st,v 1.8 1998/05/16 12:39:02 cg Exp $'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    98
! !