123456789101112131415161718192021222324252627282930313233 |
- Smalltalk createPackage: 'Trapped-Counter'!
- Object subclass: #TrappedCounter
- instanceVariableNames: 'value'
- package: 'Trapped-Counter'!
- !TrappedCounter methodsFor: 'accessing'!
- value
- ^value
- !
- value: aNumber
- value := aNumber
- ! !
- !TrappedCounter methodsFor: 'action'!
- decrement
- value := value - 1
- !
- increment
- value := value + 1
- ! !
- !TrappedCounter methodsFor: 'initialization'!
- initialize
- super initialize.
- SimpleAxon new registerIn: self.
- value := 0
- ! !
|