"Happy Squeaking Sample(1)" "Copyright (C) 1999 OGIS-RI" Object subclass: #Animal instanceVariableNames: 'name knowledge habitat ' classVariableNames: '' poolDictionaries: '' category: 'AnimalApplication'! !Animal commentStamp: '' prior: 0! Animal: {abstract} defining attributes and behevior of animal Instance Variables: habitat knowledge name topSpeed Instance Methods: talk ! !Animal methodsFor: 'initialize-release' stamp: 'MU 1/7/1999 14:42'! initialize name := ''. knowledge := 0. habitat := ''.! ! !Animal methodsFor: 'accessing'! habitat ^habitat! ! !Animal methodsFor: 'accessing'! habitat: aString habitat := aString! ! !Animal methodsFor: 'accessing'! knowledge ^knowledge! ! !Animal methodsFor: 'accessing'! knowledge: anInteger knowledge := anInteger! ! !Animal methodsFor: 'accessing'! name ^name! ! !Animal methodsFor: 'accessing'! name: aString name := aString! ! !Animal methodsFor: 'actions'! talk self display: '...cannot talk...'! ! !Animal methodsFor: 'private'! display: aString Transcript cr; show: (self class name, ':', self name, '"',aString, '"').! ! Animal subclass: #Bird instanceVariableNames: 'canFly ' classVariableNames: '' poolDictionaries: '' category: 'AnimalApplication'! !Bird commentStamp: '' prior: 0! Bird: {abstract} Instance Variables: canFly ! !Bird methodsFor: 'initialize-release'! initialize super initialize. habitat := 'sky'. canFly := true! ! !Bird methodsFor: 'actions' stamp: 'MU 1/7/1999 16:26'! fly self canFly ifTrue:[ self display: '*** FLYING ***' ]! ! !Bird methodsFor: 'accessing'! canFly ^canFly! ! !Bird methodsFor: 'accessing'! canFly: aBoolean canFly := aBoolean! ! Bird subclass: #Parrot instanceVariableNames: 'vocablary ' classVariableNames: '' poolDictionaries: '' category: 'AnimalApplication'! !Parrot commentStamp: '' prior: 0! Parrot: Instance Variables: vocablary ! !Parrot methodsFor: 'initialize-release'! initialize super initialize. knowledge := 30. habitat := 'bird cage'. vocablary := ''! ! !Parrot methodsFor: 'actions'! talk vocablary = '' ifTrue: [super talk] ifFalse: [self display: vocablary]! ! !Parrot methodsFor: 'accessing'! vocablary ^vocablary! ! !Parrot methodsFor: 'accessing'! vocablary: aString vocablary := aString! ! Bird subclass: #Swallow instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'AnimalApplication'! !Swallow commentStamp: '' prior: 0! Swallow:! !Swallow methodsFor: 'initialize-release' stamp: 'MU 1/7/1999 14:47'! initialize super initialize. knowledge := 25. ! !