Squeak Class Documentation category index | class index  
 
PluggableDictionary
  category: Collections-Unordered
  superclass: Dictionary
  subclasses:

Class PluggableDictionary allows the redefinition of hashing and equality by clients. This is in particular useful if the clients know about specific properties of the objects stored in the dictionary. See the class comment of PluggableSet for an example.

Instance variables:
hashBlock <BlockContext> A one argument block used for hashing the elements.
equalBlock <BlockContext> A two argument block used for comparing the elements.

instance methods
  accessing
  equalBlock
equalBlock:
hashBlock
hashBlock:
keys

  copying
  copy
postCopyBlocks

  private
  scanFor:

class methods
  as yet unclassified
  integerDictionary

instance methods
  accessing top  
 

equalBlock

Return the block used for comparing the elements in the receiver.


 

equalBlock:

Set a new equality block. The block must accept two arguments and return true if the argumets are considered to be equal, false otherwise


 

hashBlock

Return the block used for hashing the elements in the receiver.


 

hashBlock:

Set a new hash block. The block must accept one argument and must return the hash value of the given argument.


 

keys

Answer a Set containing the receiver's keys.


  copying top  
 

copy

Must copy the associations, or later store will effect both the
original and the copy


 

postCopyBlocks


  private top  
 

scanFor:

Scan the key array for the first slot containing either a nil
(indicating
an empty slot) or an element that matches anObject. Answer the index

of that slot or zero if no slot is found. This method will be
overridden
in various subclasses that have different interpretations for matching

elements.


class methods
  as yet unclassified top  
 

integerDictionary