src/JavaNameAndType2.st
author vranyj1
Sun, 01 May 2011 12:52:23 +0000
branchjk_new_structure
changeset 761 43e017ec7958
parent 758 be8e84381ce0
child 771 fb8026dda011
permissions -rw-r--r--
Merged with /branches/jk

"{ Package: 'stx:libjava' }"

Object subclass:#JavaNameAndType2
	instanceVariableNames:'name descriptor'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Reader-Support-new'
!

!JavaNameAndType2 class methodsFor:'documentation'!

documentation
"
    I represent NameAndTypeInfo structure found in java constant pool. 

    [author:]
        Marcel Hlopko <hlopkmar@fel.cvut.cz>

    [instance variables:]
        name - string found in constant pool at nameIndex. Represents field or method name.
        descriptor - string found in constant pool at descIndex. Represents field or method type.

    [class variables:]

    [see also:]

"
! !

!JavaNameAndType2 class methodsFor:'instance creation'!

name:arg1  descriptor:arg2
    "Create & return a new instance for arg."

    ^ self basicNew initializeName:arg1  descriptor:arg2
! !

!JavaNameAndType2 methodsFor:'accessing'!

descriptor
    ^ descriptor.

    "Created: / 08-04-2011 / 11:55:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!

name
^ name.

    "Created: / 08-04-2011 / 11:55:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!

selector
^ (name , descriptor) asSymbol.

    "Created: / 11-04-2011 / 21:31:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !

!JavaNameAndType2 methodsFor:'comparing'!

= aNameAndType 
    name ~= aNameAndType name ifTrue: [ ^ false ].
    ^ descriptor = aNameAndType descriptor.

    "Created: / 08-04-2011 / 11:56:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!

hash
    ^ name hash bitXor: descriptor hash.

    "Created: / 08-04-2011 / 11:57:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !

!JavaNameAndType2 methodsFor:'initialization'!

initializeName: nameString descriptor: descriptorString 
    name := nameString.
    descriptor := descriptorString.
    super initialize.

    "Modified: / 08-04-2011 / 13:51:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !

!JavaNameAndType2 class methodsFor:'documentation'!

version_SVN
    ^ '$Id$'
! !