Yasushi Nakajima > Pogo-0.10 > PogoIndex

Download:
Pogo-0.10.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

NAME ^

PogoIndex - Alternate hash class which can have plural values

SYNOPSIS ^

  use PogoIndex;
  $index = new PogoIndex::Btree;
  $index->add('key', 'value1');
  $index->add('key', 'value2');
  @values = $index->getlist('key');  # gets ('value1', 'value2')

DESCRIPTION ^

By the Pogo's hash data structures (Pogo::Hash, Pogo::Htree, Pogo::Btree, Pogo::Ntree), each key may have only one value. This module provides multi-value available hash.

Methods

$obj = PogoIndex::Hash->new($size);

This class method makes and returns a PogoIndex::Hash object. It's substance is a hash reference which is tied to a Pogo::Hash object. $size specifies the size of hash entry table. $size can default.

$obj = PogoIndex::Htree->new($size);

Same as PogoIndex::Hash->new, but using Pogo::Htree.

$obj = PogoIndex::Btree->new;

Same as PogoIndex::Hash->new, but using Pogo::Btree.

$obj = PogoIndex::Ntree->new;

Same as PogoIndex::Hash->new, but using Pogo::Ntree.

$obj->add($key, $value);

This object method adds the value $value as a value of the key $key.

$obj->del($key, $value);

This object method deletes the value $value from the list of values of the key $key.

$obj->clear($key);

This object method deletes all values of the key $key. If $key defaults, the hash becomes empty.

@values = $obj->getlist($key);

This object method returns a list of all values of key $key.

$bool = $obj->have($key, $value);

This object method returns whether the key $key have the value $value.

@keys = $obj->keylist;

This object method returns a list of all keys.

AUTHOR ^

Sey Nakajima <sey@jkc.co.jp>

SEE ALSO ^

Pogo(3).

syntax highlighting: