NAME

Meta::Ds::Set - data structure that represents a set.

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: Set.pm
PROJECT: meta
VERSION: 0.35

SYNOPSIS

package foo;
use Meta::Ds::Set qw();
my($set)=Meta::Ds::Set->new();
$set->insert("mark");

DESCRIPTION

This is a library to let you create a set like data structure. The set data structure is akin to the mathematical object of a set. A set is a collection of items where duplicates are not allowed (if you insert an item which is already in the set the set does not change). The sets operations are mainly insert, remove and testing whether elements are memebers of it or not. The set here is not ordered so you CANT iterate it's elements. If you do want to iterate them use the Oset object. If you don't - use this object and same time and memory. Don't worry - if you don't know if you do or you don't - use this object for starters - if you wind up needing iteration just switch to using the Oset - they have the same interface so you will only need to change your code in the use and object construction points. The implementation is simply based on a perl hash table and does not use the capability of the hash table to store value items beside the keys in the table.

FUNCTIONS

new($)
clear($)
insert($$)
remove($$)
has($$)
hasnt($$)
check_elem($$)
check_not_elem($$)
print($$)
size($)
TEST($)

FUNCTION DOCUMENTATION

new($)

Gives you a new Set object.

clear($)

This will clear the set (make it the empty set).

insert($$)

Inserts a new element into the set.

remove($$)

Removes an element from the set.

has($$)

Returns whether the current element is a member of the set.

hasnt($$)

Returns whether the current element is not a member of the set.

check_elem($$)

Check that the element received is in the set and die if it is not. This method receives: 0. The object handle. 1. The element to check for. This method does not return anything.

check_not_elem($$)

Check that the element received is in not the set and die if it is. This method receives: 0. The object handle. 1. The element to check for. This method does not return anything.

print($$)

Prints the current set to a specified file. This method receives: 0. The object handle. 1. The file handle to print to. This method returns nothing.

size($)

Return the size of the set. The real size (not size-1). This method receives: 0. The object handle. This method returns the size of the set object in question.

TEST($)

Test suite for this module.

SUPER CLASSES

None.

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 make Meta::Utils::Opts object oriented
0.06 MV check that all uses have qw
0.07 MV fix todo items look in pod documentation
0.08 MV more on tests/more checks to perl
0.09 MV silense all tests
0.10 MV correct die usage
0.11 MV finish Simul documentation
0.12 MV perl code quality
0.13 MV more perl quality
0.14 MV more perl quality
0.15 MV get basic Simul up and running
0.16 MV perl documentation
0.17 MV more perl quality
0.18 MV perl qulity code
0.19 MV more perl code quality
0.20 MV revision change
0.21 MV languages.pl test online
0.22 MV PDMT/SWIG support
0.23 MV Pdmt stuff
0.24 MV perl packaging
0.25 MV some chess work
0.26 MV md5 project
0.27 MV database
0.28 MV perl module versions in files
0.29 MV movies and small fixes
0.30 MV more thumbnail code
0.31 MV thumbnail user interface
0.32 MV more thumbnail issues
0.33 MV website construction
0.34 MV web site automation
0.35 MV SEE ALSO section fix

SEE ALSO

Meta::Utils::System(3), strict(3)

TODO

Nothing.