-
-
27 Feb 2018 08:38:55 UTC
- Distribution: Clownfish
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (1313 / 0 / 7)
- Kwalitee
Bus factor: 0- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (230.31KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Clownfish::Hash - Hashtable.
SYNOPSIS
my $hash = Clownfish::Hash->new; $hash->store($key, $value); my $value = $hash->fetch($key);
DESCRIPTION
Values are stored by reference and may be any kind of Obj.
CONSTRUCTORS
new
my $hash = Clownfish::Hash->new( capacity => $capacity, # default: 0 );
Return a new Hash.
capacity - The number of elements that the hash will be asked to hold initially.
METHODS
clear
$hash->clear();
Empty the hash of all key-value pairs.
store
$hash->store($key, $value);
Store a key-value pair.
fetch
my $obj = $hash->fetch($key);
Fetch the value associated with
key
.Returns: the value, or undef if
key
is not present.delete
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.has_key
my $bool = $hash->has_key($key);
Indicate whether the supplied
key
is present.keys
my $arrayref = $hash->keys();
Return the Hash’s keys.
values
my $arrayref = $hash->values();
Return the Hash’s values.
get_size
my $int = $hash->get_size();
Return the number of key-value pairs.
INHERITANCE
Clownfish::Hash isa Clownfish::Obj.
Module Install Instructions
To install Clownfish, copy and paste the appropriate command in to your terminal.
cpanm Clownfish
perl -MCPAN -e shell install Clownfish
For more information on module installation, please visit the detailed CPAN module installation guide.