'From Squeak3.1alpha of 28 February 2001 [latest update: #4187] on 5 July 2001 at 10:23:13 pm'! "Change Set: Equals-tk Date: 5 July 2001 Author: Ted Kaehler Made sure each implementation of = (equals) would not cause an error if the argument were of some wildly different class. Test class or species of argument before sending an oddball message to the argument."! !CRChar methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:53'! = aCRChar self species == aCRChar species ifFalse: [^ false]. ^ self string = aCRChar string! ! !CRChar methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:53'! species ^CRChar! ! !CRLookupItem methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:54'! = aCRLookupItem self species == aCRLookupItem species ifFalse: [^ false]. aCRLookupItem == self ifTrue: [^ true]. self distance = aCRLookupItem distance ifFalse: [^ false]. ^ true! ! !CRLookupItem methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:54'! species ^CRLookupItem! ! !CRParameters methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:56'! = aCRParameters | index | self species == aCRParameters species ifFalse: [^ false]. aCRParameters == self ifTrue: [^ true]. index _ self class instSize. [index > 0] whileTrue: [(aCRParameters instVarAt: index) = (self instVarAt: index) ifFalse: [^ false]. index _ index - 1]. ^ true! ! !CRParameters methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:56'! species ^CRParameters! ! !CharacterSet methodsFor: 'comparison' stamp: 'tk 7/5/2001 21:58'! = anObject ^self species == anObject species and: [ self byteArrayMap = anObject byteArrayMap ]! ! !CharacterSet methodsFor: 'comparison' stamp: 'tk 7/5/2001 21:57'! species ^CharacterSet! ! !ColorMap methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:59'! = aColorMap "Return true if the receiver is equal to aColorMap" self species == aColorMap species ifFalse:[^false]. self isIndexed == aColorMap isIndexed ifFalse:[^false]. ^self colors = aColorMap colors and:[ self shifts = aColorMap shifts and:[ self masks = aColorMap masks]]! ! !Date methodsFor: 'comparing' stamp: 'tk 7/5/2001 21:50'! = aDate "Answer whether aDate is the same day as the receiver." self species == aDate species ifFalse: [^ false]. ^julianDayNumber = aDate asJulianDayNumber. ! ! !MessageTally methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:05'! = aMessageTally self species == aMessageTally species ifFalse: [^ false]. ^ aMessageTally method == method! ! !MessageTally methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:04'! species ^MessageTally! ! !MethodReference methodsFor: 'comparisons' stamp: 'tk 7/5/2001 21:49'! = anotherMethodReference self species == anotherMethodReference species ifFalse: [^ false]. classSymbol = anotherMethodReference classSymbol ifFalse: [^false]. classIsMeta = anotherMethodReference classIsMeta ifFalse: [^false]. ^methodSymbol = anotherMethodReference methodSymbol ! ! !MethodReference methodsFor: 'comparisons' stamp: 'tk 7/5/2001 21:48'! species ^ MethodReference! ! !POHalfedge methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:06'! = aHalfedge self species == aHalfedge species ifFalse: [^ false]. ^ (self origin = aHalfedge origin) and: [self opposite origin = aHalfedge opposite origin]! ! !POHalfedge methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:06'! species ^POHalfedge! ! !POTriangle methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:08'! = aTDTriangle ^ self species == aTDTriangle species and: [ self edges asSet = aTDTriangle edges asSet]! ! !POTriangle methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:07'! species ^POTriangle! ! !PhoneticRule methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:08'! = anObject self species == anObject species ifFalse: [^ false]. ^ anObject left = self left and: [anObject right = self right and: [anObject text = self text and: [anObject phonemes = self phonemes]]]! ! !PhoneticRule methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:09'! species ^PhoneticRule ! ! !ResourceLocator methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:10'! = aLocator ^ self species == aLocator species and: [self urlString = aLocator urlString] ! ! !ResourceLocator methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:10'! species ^ResourceLocator! ! !Set methodsFor: 'testing' stamp: 'tk 7/5/2001 22:15'! = aSet self species == aSet species ifFalse: [^ false]. self size = aSet size ifFalse: [^ false]. self do: [:each | (aSet includes: each) ifFalse: [^ false]]. ^ true! ! !Set methodsFor: 'testing' stamp: 'tk 7/5/2001 22:14'! species ^Set! ! !TextStyle methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:18'! = other self species == other species ifFalse: [^ false]. 1 to: self class instSize do: [:i | (self instVarAt: i) == (other instVarAt: i) ifFalse: [^ false]]. ^ true! ! !TextStyle methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:18'! species ^TextStyle! ! !ThreeDSChunkDescription methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:19'! = aChunk self species == aChunk species ifFalse: [^ false]. ^id = aChunk id! ! !ThreeDSChunkDescription methodsFor: 'comparing' stamp: 'tk 7/5/2001 22:19'! species ^ThreeDSChunkDescription! !