Object subclass: #Page instanceVariableNames: 'pid page' classVariableNames: 'pages' poolDictionaries: '' category: nil ! Page comment: 'I am an abstract memory page' ! !Page class methodsFor: 'instance creation'! new self shouldNotImplement. ! by: aPid at: aPage | r | pages ifNil: [ pages := Dictionary new ]. r := super new. r pid: aPid. r page: aPage. pages at: r ifAbsentPut: [ pages size ]. ^r. ! ! !Page methodsFor: 'equality'! = rhs ^( ((self pid) = (rhs pid)) & ((self page) = (rhs page)) ). ! hash "This is a dumb hack, but oh well" ^(pid hash) + (page hash) ! ! !Page methodsFor: 'global key access'! num ^pages at: self. ! ! !Page methodsFor: 'printing'! printOn: aStream aStream nextPutAll: 'Page '. self num printOn: aStream. aStream nextPut: $(. pid printOn: aStream. aStream nextPut: $'. aStream nextPutAll: 's '. page printOn: aStream. aStream nextPut: $). ! ! Page createGetMethod: 'pid' ! Page createGetMethod: 'page' ! Page createSetMethod: 'pid' ! Page createSetMethod: 'page' !