MethodChange.st
author Claus Gittinger <cg@exept.de>
Tue, 06 Jul 1999 12:37:02 +0200
changeset 784 1e50cc7fd07d
parent 779 d2c59a219cbc
child 798 999fff0aa0d0
permissions -rw-r--r--
added compare methods #sameAs: and #isForSameAs:

"
 COPYRIGHT (c) 1993 by Claus Gittinger
	       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.
"

ClassChange subclass:#MethodChange
	instanceVariableNames:'selector methodCategory privacy'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Changes'
!

!MethodChange class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1993 by Claus Gittinger
	       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.
"
!

documentation
"
    instances represent method-changes (as done in the browser). 
    They are typically held in a ChangeSet.

    [author:]
        Claus Gittinger
"
! !

!MethodChange class methodsFor:'instance creation'!

class:cls selector:sel source:src category:cat
    ^ self basicNew class:cls selector:sel source:src category:cat
! !

!MethodChange methodsFor:'accessing'!

class:cls selector:sel source:src category:cat
    className := cls name.
    selector := sel.
    source := src.
    methodCategory := cat
!

className:clsName selector:sel source:src category:cat
    className := clsName.
    selector := sel.
    source := src.
    methodCategory := cat

    "Created: / 16.2.1998 / 12:29:49 / cg"
!

className:clsName selector:sel source:src category:cat privacy:priv
    className := clsName.
    selector := sel.
    source := src.
    methodCategory := cat.
    privacy := priv.

    "Created: / 16.2.1998 / 12:29:49 / cg"
    "Modified: / 16.2.1998 / 14:28:12 / cg"
!

methodCategory
    ^ methodCategory

    "Created: / 7.2.1998 / 19:47:53 / cg"
!

selector
    ^ selector

    "Created: / 6.2.1998 / 13:29:25 / cg"
! !

!MethodChange methodsFor:'comparing'!

isForSameAs:changeB
    "return true, if the given change represents a change for the same
     thingy as the receiver (i.e. same method, same definition etc.)."

    "/ I am a methodChange - B must be as well.
    changeB isMethodChange ifFalse:[^ false].   

    className ~= changeB className ifTrue:[^ false].
    selector ~= changeB selector ifTrue:[^ false].

    ^ true




!

sameAs:changeB
    "return true, if the given change represents the same change as the receiver."

    "/ I am a methodChange - B must be as well.
    changeB isMethodChange ifFalse:[^ false].   

    className ~= changeB className ifTrue:[^ false].
    selector ~= changeB selector ifTrue:[^ false].

    ^ self sameSourceAs:changeB




! !

!MethodChange methodsFor:'printing'!

printOn:aStream
    aStream nextPutAll:className; 
		 space; 
	    nextPutAll:selector 
!

printWithoutClassOn:aStream
    (className endsWith:' class') ifTrue:[
        aStream nextPutAll:'class '
    ].
    aStream nextPutAll:selector 
! !

!MethodChange methodsFor:'queries'!

isMethodChange
    ^ true

    "Created: / 7.2.1998 / 19:26:59 / cg"
! !

!MethodChange class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.18 1999-07-06 10:36:46 cg Exp $'
! !