| as yet unclassified |
| at: key
|
^ self at: key ifAbsent: [self error: 'No entry for ', key]
|
| at: key ifAbsent: errorBlock
|
|val|
val _ table at: key ifAbsent: [^ errorBlock value].
ageTable at: val put: 0.
^ val.
|
| at: key put: val
|
|removals|
table at: key put: val.
ageTable at: val put: 0.
removals _ OrderedCollection new.
ageTable associationsDo:
[:assoc |
assoc value > max ifTrue: [removals add: assoc key].
assoc value: assoc value + 1].
removals do: [:ea | self remove: ea].
|
| capacity: aNumber
|
max _ aNumber
|
| initialize
|
max _ 20.
table _ Dictionary new.
ageTable _ Dictionary new.
|
| isEmpty
|
^ table isEmpty
|
| nextKey
|
|key|
[table includesKey: (key _ WAExternalID new asString)] whileTrue.
^ key
|
| remove: anObject
|
ageTable removeKey: anObject.
table removeKey: (table keyAtValue: anObject)
|
| store: anObject
|
|key|
key _ self nextKey.
self at: key put: anObject.
^ key
|