home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
LANGUAGE
/
SMALTALK
/
TEXTBOOK
/
AP02.ST
(
.txt
)
< prev
next >
Wrap
Text File
|
1997-04-22
|
1KB
|
82 lines
'Smalltalk Textbook Appendix 02'!
Model subclass: #EngiVariable
instanceVariableNames: 'value '
classVariableNames: ''
poolDictionaries: ''
category: 'Engi-Kernel'!
EngiVariable comment:
'
Engi 0.01 (10 January 1994)
Copyright (C) 1994 by Atsushi Aoki
'!
!EngiVariable methodsFor: 'initialize-release'!
initialize
^self! !
!EngiVariable methodsFor: 'accessing'!
value
^value!
value: newValue
self setValue: newValue.
self changed: #value! !
!EngiVariable methodsFor: 'collection accessing'!
at: anInteger
^self value at: anInteger!
at: anInteger put: anObject
self value at: anInteger put: anObject.
self changed: #at with: anInteger!
size
^self value size! !
!EngiVariable methodsFor: 'private'!
setSize: sizeInteger
self setValue: (Array new: sizeInteger asInteger)!
setValue: newValue
value := newValue! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
EngiVariable class
instanceVariableNames: ''!
!EngiVariable class methodsFor: 'instance creation'!
new
^super new initialize!
new: size
^super new setSize: size!
value: anObject
^self new value: anObject!
values: objectCollection
| aVariable index |
aVariable := self new: objectCollection size.
index := 1.
objectCollection
do:
[:each |
aVariable at: index put: each.
index := index + 1].
^aVariable! !