author | hlopkmar |
Wed, 18 May 2011 10:45:12 +0000 | |
branch | jk_new_structure |
changeset 794 | 9635f32d1723 |
parent 778 | caa3a009f617 |
child 806 | 7d1f2ba6d2df |
permissions | -rw-r--r-- |
752 | 1 |
"{ Package: 'stx:libjava' }" |
2 |
||
3 |
JavaRef2 subclass:#JavaClassContentRef2 |
|
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
4 |
instanceVariableNames:'classRefIndex nameAndTypeIndex classCache nameAndTypeCache' |
752 | 5 |
classVariableNames:'' |
6 |
poolDictionaries:'' |
|
7 |
category:'Languages-Java-Reader-Support-new' |
|
8 |
! |
|
9 |
||
10 |
||
758 | 11 |
!JavaClassContentRef2 class methodsFor:'instance creation'! |
12 |
||
777 | 13 |
in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
14 |
^ self basicNew |
|
15 |
initializeIn: aJavaConstantPool |
|
16 |
withNameAndTypeAt: nameAndTypeCPIndex |
|
17 |
andClassAt: classRefCPIndex. |
|
758 | 18 |
|
777 | 19 |
"Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 20 |
! ! |
21 |
||
22 |
!JavaClassContentRef2 methodsFor:'accessing'! |
|
23 |
||
24 |
classRef |
|
777 | 25 |
^ constantPool at: classRefIndex. |
26 |
||
27 |
"Modified: / 12-05-2011 / 18:38:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
758 | 28 |
! |
29 |
||
30 |
descriptor |
|
777 | 31 |
^ self nameAndType descriptor. |
758 | 32 |
|
33 |
"Created: / 08-04-2011 / 15:08:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 34 |
"Modified: / 12-05-2011 / 18:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 35 |
! |
36 |
||
37 |
name |
|
777 | 38 |
^ self nameAndType name. |
758 | 39 |
|
40 |
"Created: / 08-04-2011 / 13:54:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 41 |
"Modified: / 12-05-2011 / 18:39:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 42 |
! |
43 |
||
44 |
nameAndType |
|
777 | 45 |
^ constantPool at: nameAndTypeIndex. |
761 | 46 |
|
47 |
"Created: / 11-04-2011 / 19:57:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 48 |
"Modified: / 12-05-2011 / 18:39:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 49 |
! |
50 |
||
51 |
selector |
|
777 | 52 |
^ self nameAndType selector. |
761 | 53 |
|
54 |
"Created: / 11-04-2011 / 20:38:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 55 |
"Modified: / 12-05-2011 / 18:39:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 56 |
! ! |
57 |
||
752 | 58 |
!JavaClassContentRef2 methodsFor:'comparing'! |
59 |
||
60 |
= anotherJavaRef |
|
61 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
62 |
||
63 |
^ self shouldImplement |
|
64 |
! |
|
65 |
||
66 |
hash |
|
67 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
68 |
||
69 |
^ self shouldImplement |
|
70 |
! ! |
|
71 |
||
758 | 72 |
!JavaClassContentRef2 methodsFor:'initialization'! |
73 |
||
777 | 74 |
initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
75 |
constantPool := aJavaConstantPool. |
|
76 |
classRefIndex := classRefCPIndex. |
|
77 |
nameAndTypeIndex := nameAndTypeCPIndex. |
|
758 | 78 |
super initialize. |
79 |
||
777 | 80 |
"Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
771 | 81 |
! ! |
82 |
||
83 |
!JavaClassContentRef2 methodsFor:'printing'! |
|
84 |
||
85 |
printString |
|
777 | 86 |
^ 'JavaClassContentRef: class=[' , self classRef printString , '] name=[' |
87 |
, self nameAndType printString , ']'. |
|
771 | 88 |
|
89 |
"Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 90 |
"Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 91 |
! ! |
92 |
||
93 |
!JavaClassContentRef2 methodsFor:'resolving'! |
|
94 |
||
761 | 95 |
invalidate |
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
96 |
self classRef invalidate. |
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
97 |
classCache := nil. |
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
98 |
nameAndTypeCache := nil. |
771 | 99 |
super invalidate. |
761 | 100 |
|
101 |
"Created: / 13-04-2011 / 12:21:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
102 |
"Modified: / 18-05-2011 / 12:41:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 103 |
! |
104 |
||
758 | 105 |
invalidateForClass: internalJavaClassName |
106 |
"Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded). |
|
107 |
Return true, if reference was invalidated." |
|
108 |
||
777 | 109 |
(self classRef invalidateForClass: internalJavaClassName) |
110 |
ifTrue: |
|
111 |
[ self invalidate. |
|
112 |
^ true ]. |
|
113 |
^ false. |
|
758 | 114 |
|
777 | 115 |
"Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 116 |
! ! |
117 |
||
752 | 118 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
119 |
||
120 |
version_SVN |
|
121 |
^ '$Id$' |
|
122 |
! ! |