JavaClassContentRef2.st
branchdevelopment
changeset 2698 c243b2455f71
parent 2429 ebece4dcaab9
child 2711 a00302fe5083
equal deleted inserted replaced
2697:d5110c6822c6 2698:c243b2455f71
    51      as of 1.9.2010
    51      as of 1.9.2010
    52 
    52 
    53 "
    53 "
    54 ! !
    54 ! !
    55 
    55 
    56 
       
    57 !JavaClassContentRef2 class methodsFor:'instance creation'!
    56 !JavaClassContentRef2 class methodsFor:'instance creation'!
    58 
    57 
    59 in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex 
    58 in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex 
    60     ^ self basicNew 
    59     ^ self basicNew 
    61         initializeIn: aJavaConstantPool
    60         initializeIn: aJavaConstantPool
    62         withNameAndTypeAt: nameAndTypeCPIndex
    61         withNameAndTypeAt: nameAndTypeCPIndex
    63         andClassAt: classRefCPIndex.
    62         andClassAt: classRefCPIndex.
    64 
    63 
    65     "Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
    64     "Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
    66 ! !
    65 ! !
    67 
       
    68 
    66 
    69 !JavaClassContentRef2 methodsFor:'accessing'!
    67 !JavaClassContentRef2 methodsFor:'accessing'!
    70 
    68 
    71 classRef
    69 classRef
    72     ^ constantPool at: classRefIndex.
    70     ^ constantPool at: classRefIndex.
   106     ^ self nameAndType signature.
   104     ^ self nameAndType signature.
   107 
   105 
   108     "Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   106     "Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   109 ! !
   107 ! !
   110 
   108 
   111 
       
   112 !JavaClassContentRef2 methodsFor:'comparing'!
   109 !JavaClassContentRef2 methodsFor:'comparing'!
   113 
   110 
   114 = anotherJavaRef
   111 = anotherJavaRef
   115     "superclass JavaRef2 says that I am responsible to implement this method"
       
   116 
   112 
   117     ^ self shouldImplement
   113     ^ self class == anotherJavaRef class 
       
   114         and:[self classRef = anotherJavaRef classRef
       
   115             and:[self nameAndType = anotherJavaRef nameAndType]]
       
   116 
       
   117     "Modified: / 30-08-2013 / 17:15:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   118 !
   118 !
   119 
   119 
   120 hash
   120 hash
   121     "superclass JavaRef2 says that I am responsible to implement this method"
   121     ^ self classRef hash bitXor: self nameAndType hash
   122 
   122 
   123     ^ self shouldImplement
   123     "Modified: / 30-08-2013 / 17:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   124 ! !
   124 ! !
   125 
       
   126 
   125 
   127 !JavaClassContentRef2 methodsFor:'initialization'!
   126 !JavaClassContentRef2 methodsFor:'initialization'!
   128 
   127 
   129 initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex    
   128 initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex    
   130     constantPool := aJavaConstantPool.
   129     constantPool := aJavaConstantPool.
   132     nameAndTypeIndex := nameAndTypeCPIndex.
   131     nameAndTypeIndex := nameAndTypeCPIndex.
   133     super initialize.
   132     super initialize.
   134 
   133 
   135     "Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   134     "Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   136 ! !
   135 ! !
   137 
       
   138 
   136 
   139 !JavaClassContentRef2 methodsFor:'printing'!
   137 !JavaClassContentRef2 methodsFor:'printing'!
   140 
   138 
   141 displayString
   139 displayString
   142     "superclass JavaRef2 says that I am responsible to implement this method"
   140     "superclass JavaRef2 says that I am responsible to implement this method"
   151         , self nameAndType printString , ']'.
   149         , self nameAndType printString , ']'.
   152 
   150 
   153     "Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   151     "Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   154     "Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   152     "Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   155 ! !
   153 ! !
   156 
       
   157 
   154 
   158 !JavaClassContentRef2 methodsFor:'resolving'!
   155 !JavaClassContentRef2 methodsFor:'resolving'!
   159 
   156 
   160 invalidate
   157 invalidate
   161     self classRef invalidate.    
   158     self classRef invalidate.    
   179 
   176 
   180     "Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   177     "Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   181     "Modified (format): / 21-02-2012 / 10:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   178     "Modified (format): / 21-02-2012 / 10:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   182 ! !
   179 ! !
   183 
   180 
   184 
       
   185 !JavaClassContentRef2 class methodsFor:'documentation'!
   181 !JavaClassContentRef2 class methodsFor:'documentation'!
   186 
   182 
   187 version_CVS
   183 version_CVS
   188     ^ '$Header: /cvs/stx/stx/libjava/JavaClassContentRef2.st,v 1.5 2013-02-25 11:15:31 vrany Exp $'
   184     ^ '$Header: /cvs/stx/stx/libjava/JavaClassContentRef2.st,v 1.5 2013-02-25 11:15:31 vrany Exp $'
   189 !
   185 !