WeakValueDictionary.st
changeset 17265 556ffc7d34b4
parent 14311 81149029915a
child 18120 e3a375d5f6a8
child 18620 b4e9f25d6ce6
equal deleted inserted replaced
17264:548ea4dc5aa4 17265:556ffc7d34b4
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libbasic' }"
    12 "{ Package: 'stx:libbasic' }"
    13 
    13 
       
    14 "{ NameSpace: Smalltalk }"
       
    15 
    14 Dictionary subclass:#WeakValueDictionary
    16 Dictionary subclass:#WeakValueDictionary
    15 	instanceVariableNames:''
    17 	instanceVariableNames:''
    16 	classVariableNames:''
    18 	classVariableNames:''
    17 	poolDictionaries:''
    19 	poolDictionaries:''
    18 	category:'Collections-Weak'
    20 	category:'Collections-Weak'
   192     ].
   194     ].
   193 
   195 
   194     "Modified: / 13.12.2001 / 14:18:56 / martin"
   196     "Modified: / 13.12.2001 / 14:18:56 / martin"
   195 !
   197 !
   196 
   198 
   197 emptyCheck
   199 possiblyShrink
   198     "check if the receiver has become too empty (after a remove)
   200     "check if the receiver has become too empty (after a remove)
   199      and shrink if it makes sense.
   201      and shrink if it makes sense.
   200      Definition of 'too empty' is 'filled less than 12.5% (i.e. 1/8th)'"
   202      Definition of 'too empty' is: 'filled less than 12.5% (i.e. 1/8th)'"
   201 
   203 
   202     self clearDeadSlots.
   204     self clearDeadSlots.
   203     super emptyCheck
   205     super possiblyShrink
   204 !
   206 !
   205 
   207 
   206 slotIsEmpty:probe
   208 slotIsEmpty:probe
   207     ^ probe isNil or:[probe == 0 "collected"]
   209     ^ probe isNil or:[probe == 0 "collected"]
   208 !
   210 !
   261 ! !
   263 ! !
   262 
   264 
   263 !WeakValueDictionary class methodsFor:'documentation'!
   265 !WeakValueDictionary class methodsFor:'documentation'!
   264 
   266 
   265 version
   267 version
   266     ^ '$Header: /cvs/stx/stx/libbasic/WeakValueDictionary.st,v 1.19 2012-08-13 11:13:51 stefan Exp $'
   268     ^ '$Header: /cvs/stx/stx/libbasic/WeakValueDictionary.st,v 1.20 2014-12-30 12:35:34 cg Exp $'
   267 ! !
   269 ! !
       
   270