Programmer Reference : UnicodeSupport : StringDictionary
StringDictionary
This class is similar to Dictionary, but optimized for and restricted to String or UnicodeString instances as keys. It ensures consistency by converting keys to UTF-8 bytes prior to hashing.
Due to the unification of standard String and UnicodeString hashing, this class is primarily kept for users needing a guarantee of non-codepage-dependent hashing.
Class Methods
None
Instance Methods
add:
  Answer anAssociation having added anAssociation to the receiver.
     
     Arguments:
        anAssociation - <Association>
     Answers:
        <Association>
     
associationAt:ifAbsent:
  Answer the Association of the receiver that whose key is equivalent
     to the Object aKey.  If aKey is not found answer the result of
     evaluating the zero argument block, anExceptionBlock.
    
     Fail if the association is not found and
     anExceptionBlock is not a zero-argument Block.
     
     Arguments:
        aKey - <String | UnicodeString>
        anExceptionBlock - <Block>
     
at:ifAbsent:
  Answer the Object of the receiver that is associated with an Object
     equivalent to the Object aKey.  If an equivalent key is not found
     answer the result of evaluating the zero argument block, anExceptionBlock.
    
     Fail if aKey is not found and anExceptionBlock is not a zero-argument Block.
     
     Arguments:
        aKey - <String | UnicodeString>
        anExceptionBlock - <Block>
     
at:ifAbsentPut:
  Answer the element associated with aKey. If the receiver does not
     contain aKey, add aKey associated with the value of aBlock and
     return the value of the block.
     
      Arguments:
        aKey - <String | UnicodeString>
        anExceptionBlock - <Block>
     
at:ifPresent:
  Return the result of evaluating aBlock if aKey is in the receiver,
     otherwise return nil.
     
    Arguments:
        aKey - <String | UnicodeString>
        aBlock - <Block>
     
at:put:
  Answer anObject after associating the argument anObject with the
     argument Object aKey, in the receiver.  If the receiver does not
     contain a key equivalent to aKey, then create a new entry
     in the receiver for aKey.
     
     Arguments:
        aKey - <String | UnicodeString>
        anObject - <Object>
     
includesKey:
  Answer a Boolean which is true if the receiver has a key equivalent
     to the Object aKey, and false otherwise.
     
     Arguments:
        aKey - <String | UnicodeString>
     
removeAllKeys:
  Remove any elements from the receiver which are stored at one
     of the keys specified in aCollection.
     
     Arguments:
        aCollection - <Collection>
     
removeAllKeys:ifAbsent:
  Remove any elements from the receiver which are stored at one
     of the keys specified in aCollection.  For any element in aCollection
     which is not a valid key of the receiver, evaluate anExceptionBlock
     with that element as the argument.
     
     Arguments:
        aCollection - <Collection>
        anExceptionBlock - <Block>
     
removeKey:ifAbsent:
  Answer an Object which is the value associated with an Object
     equivalent to the Object aKey, after removing them from the receiver.
     If an key equivalent to aKey cannot be found, answer the result of
     evaluating the zero argument block, anExceptionBlock.
    
     Fail if anExceptionBlock is not a zero-argument Block.
     
     Arguments:
        aKey - <String | UnicodeString>
        anExceptionBlock - <Block>
     
Last modified date: 01/14/2026