The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Meta::Ds::Ohash - Ordered hash data structure.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

        MANIFEST: Ohash.pm
        PROJECT: meta
        VERSION: 0.36

SYNOPSIS

        package foo;
        use Meta::Ds::Ohash qw();

DESCRIPTION

This is an object which is a hash table which can also give you a random element.

FUNCTIONS

        new($)
        insert($$$)
        put($$$)
        overwrite($$$)
        remove($$)
        elem($$)
        key($$)
        val($$)
        get_elem_number($$)
        TEST($)

FUNCTION DOCUMENTATION

new($)

Gives you a new Ohash object.

insert($$$)

Inserts an element into the hash. This just does a Hash insert and updates the list if the hash was actually inserted.

put($$$)

Overriden put method so that we could do our own accounting. Refer to the SUPER implementation.

overwrite($$$)

Overriden overwrite method so that we could do our own accounting. Refer to the SUPER implementation.

remove($$)

Remove an element from the hash. This just calls the SUPER remove and removes the element from the list if it was successful.

elem($$)

This returns a specific element in the hash.

key($$)

This returns the key with the specified number.

val($$)

This returns the value with the specified number.

get_elem_number($$)

This method will give you the sequential number of an element in the ordered hash.

TEST($)

Test suite for this module. Currently this tests creates an object, puts some data in it and then writes it out in bash format.

SUPER CLASSES

Meta::Ds::Hash(3)

BUGS

None.

AUTHOR

        Name: Mark Veltzer
        Email: mailto:veltzer@cpan.org
        WWW: http://www.veltzer.org
        CPAN id: VELTZER

HISTORY

        0.00 MV initial code brought in
        0.01 MV bring databases on line
        0.02 MV ok. This is for real
        0.03 MV make quality checks on perl code
        0.04 MV more perl checks
        0.05 MV check that all uses have qw
        0.06 MV fix todo items look in pod documentation
        0.07 MV add enumerated types to options
        0.08 MV more on tests/more checks to perl
        0.09 MV fix all tests change
        0.10 MV change new methods to have prototypes
        0.11 MV perl code quality
        0.12 MV more perl quality
        0.13 MV more perl quality
        0.14 MV perl documentation
        0.15 MV more perl quality
        0.16 MV perl qulity code
        0.17 MV more perl code quality
        0.18 MV revision change
        0.19 MV languages.pl test online
        0.20 MV finish db export
        0.21 MV upload system revamp
        0.22 MV PDMT/SWIG support
        0.23 MV perl packaging
        0.24 MV md5 project
        0.25 MV database
        0.26 MV perl module versions in files
        0.27 MV movies and small fixes
        0.28 MV graph visualization
        0.29 MV more thumbnail code
        0.30 MV thumbnail user interface
        0.31 MV more thumbnail issues
        0.32 MV website construction
        0.33 MV web site automation
        0.34 MV SEE ALSO section fix
        0.35 MV move tests to modules
        0.36 MV md5 issues

SEE ALSO

Meta::Ds::Hash(3), strict(3)

TODO

-add/subtract a hash.

-read/write a hash from a file.

-get a list from a hash.

-get a set from a hash.

-get a hash from a list.

-get a hash from a set.

-insert an element and make sure that he wasnt there.

-remove an element and make sure that he was there.

-add a limitation on the types of objects going into the hash (they must be inheritors from some kind of object).