A JudyHash is intended as a drop-in replacement
for Ruby's Hash; that is, the keys can be of any type (not only integers or
strings) and it still uses the keys' hash method to compute a hash
code. This is an implementation of the ideas set out in the Judy application note "Scalable Hashing"
For reasons I have not yet determined, JudyHash's performance is not as good as Ruby's
Hash, but I suspect this is my (Lyle's) fault and doesn't indicate a flaw
in Judy itself ;)
Insert a key and value into the array. If key is
already present, replace the old value with value.
Delete key from the array and return the value previously stored
for that key (or nil if this key is not present).
Return the value stored for key (or nil if the key is not
Free the entire array and return the number of bytes freed.
Return true if the given key is present, otherwise
Call block once for each key present, passing the key and value as
parameters. Returns a reference to the array.
Call block once for each key present, passing the key as parameter. Returns
a reference to the array.
Call block once for each key, passing the value as parameter. Returns a
reference to the array.
Remove all key-value pairs from the array and return a reference to the
Return true if array contains no keys, otherwise false.
Return a new array populated with the keys from this hash. See also values.
Return a new array populated with the values from this hash. See also keys.
Return the number of key-value pairs in the array.
Convert this hash to a nested array of [key, value]
Convert this hash to a string by converting it to an Array of
[key, value] pairs and then converting that array to a
string using Array#join with the default separator.