Clownfish::Hash - Hashtable.
my $hash = Clownfish::Hash->new; $hash->store($key, $value); my $value = $hash->fetch($key);
Values are stored by reference and may be any kind of Obj.
my $hash = Clownfish::Hash->new( capacity => $capacity # default: 0 );
Return a new Hash.
$hash->clear();
Empty the hash of all key-value pairs.
$hash->store($key, $value);
Store a key-value pair.
my $obj = $hash->fetch($key);
Fetch the value associated with key
.
Returns: the value,
or undef if key
is not present.
my $obj = $hash->delete($key);
Attempt to delete a key-value pair from the hash.
Returns: the value if key
exists and thus deletion succeeds; otherwise undef.
my $bool = $hash->has_key($key);
Indicate whether the supplied key
is present.
my $arrayref = $hash->keys();
Return the Hash’s keys.
my $arrayref = $hash->values();
Return the Hash’s values.
my $int = $hash->get_size();
Return the number of key-value pairs.
Clownfish::Hash isa Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.