Dictionary.st
branchjv
changeset 21026 81e280fc1b93
parent 20398 8cb53f870d39
parent 20989 42266e2b5d40
child 21242 19fabe339f8b
equal deleted inserted replaced
21025:442ca2ef6f76 21026:81e280fc1b93
   174         newDict at:assoc key put:assoc value
   174         newDict at:assoc key put:assoc value
   175     ].
   175     ].
   176     ^ newDict
   176     ^ newDict
   177 
   177 
   178     "
   178     "
   179      Dictionary withAssociations:(Array
   179      Dictionary withAssociations:{ #'one'->1 .
   180                                     with:#'one'->1
   180                                    #'two'->2 .
   181                                     with:#'two'->2
   181                                    #'three'->3 .
   182                                     with:#'three'->3
   182                                    #'four'->4 }
   183                                     with:#'four'->4)
       
   184     "
   183     "
   185 
   184 
   186     "Created: / 11.2.2000 / 10:05:54 / cg"
   185     "Created: / 11.2.2000 / 10:05:54 / cg"
   187 !
   186 !
   188 
   187 
   294         ( aDictionary at: key ifAbsent: [ ^false ] ) = value
   293         ( aDictionary at: key ifAbsent: [ ^false ] ) = value
   295         ifFalse: [ ^false ]
   294         ifFalse: [ ^false ]
   296     ].
   295     ].
   297     ^ true
   296     ^ true
   298 ! !
   297 ! !
       
   298 
       
   299 
   299 
   300 
   300 !Dictionary methodsFor:'accessing'!
   301 !Dictionary methodsFor:'accessing'!
   301 
   302 
   302 associationAt:aKey
   303 associationAt:aKey
   303     "return an association consisting of aKey and the element indexed
   304     "return an association consisting of aKey and the element indexed
  1633      Obsolete: use keysDo: for ST-80 compatibility."
  1634      Obsolete: use keysDo: for ST-80 compatibility."
  1634 
  1635 
  1635     <resource:#obsolete>
  1636     <resource:#obsolete>
  1636 
  1637 
  1637     self obsoleteMethodWarning:'please use #keysDo:'.
  1638     self obsoleteMethodWarning:'please use #keysDo:'.
  1638     ^ super do:aBlock
  1639     ^ self keysDo:aBlock
  1639 
  1640 
  1640     "Modified: 20.4.1996 / 11:22:01 / cg"
  1641     "Modified: 20.4.1996 / 11:22:01 / cg"
  1641 !
  1642 !
  1642 
  1643 
  1643 associationsCollect:aBlock
  1644 associationsCollect:aBlock
  2453     "dispatch for visitor pattern; send #visitDictionary:with: to aVisitor"
  2454     "dispatch for visitor pattern; send #visitDictionary:with: to aVisitor"
  2454 
  2455 
  2455     ^ aVisitor visitDictionary:self with:aParameter
  2456     ^ aVisitor visitDictionary:self with:aParameter
  2456 ! !
  2457 ! !
  2457 
  2458 
       
  2459 
  2458 !Dictionary class methodsFor:'documentation'!
  2460 !Dictionary class methodsFor:'documentation'!
  2459 
  2461 
  2460 version
  2462 version
  2461     ^ '$Header$'
  2463     ^ '$Header$'
  2462 !
  2464 !