NAME
Symphero::SimpleHash - Simple 2D hash manipulations
SYNOPSIS
use Symphero::SimpleHash;
my $h=new Symphero::SimpleHash a => 11, b => 12, c => 13;
$h->put(d => 14);
$h->fill(\%config);
my @keys=$h->keys;
DESCRIPTION
Base object from which various hash-like containers are derived.
Methods are (alphabetical order, PERL API):
sub contains ($$)
Returns key of the element, containing given text. Case is insignificant in comparision.
If no value found `undef' is returned.
sub defined ($$)
Boolean method to check if element with given key defined or not. Exactly the same as `defined ($hash->get($key))'.
sub delete ($$)
Deletes given key from the hash.
sub exists ($$)
Checks if given key exists in the hash or not (regardless of value, which can be undef).
sub fill ($@)
Allows to fill hash with multiple values. Supports variety of argument formats:
$hash->fill(key1 => value1, key2 => value2, ...); $hash->fill({ key1 => value1, key2 => value2, ... }); $hash->fill([ key1 => value1 ], [ key2 => value2 ], ...);
sub get ($$)
Returns element by given key.
sub getref ($$)
Return reference to the element by given key or `undef' if such element does not exist.
sub keys ($)
Returns array of keys.
sub new ($;@)
Creates new hash and pre-fills it with given values. Values are in the same format as in fill().
sub put ($$$)
Puts single key-value pair into hash. Usually called as:
$hash->put(key => value);
sub value ($)
Pure virtual method which is supposed to be overriden in all derived classes. Should return the value an object as a whole.
sub values ($)
Returns array of values in the same order as $hash->keys returns keys (on non-modified hash).
JAVA STYLE API
In addition to normal Perl style API outlined above Symphero::SimpleHash allows developer to use Java style API. Here is the mapping between Perl API and Java API:
isSet -- defined
containsKey -- exists
elements -- values
remove -- delete
containsValue -- contains
EXPORTS
Nothing.
AUTHORS
Brave New Worlds: Bil Drury <bild@xao.com>, Andrew Maltsev <am@xao.com>.
SEE ALSO
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 389:
You forgot a '=back' before '=head1'