add

Usage    - $set->add()
Returns  - true if the element was successfully added
Args     - the element to be added
Function - adds an element to this set

add_all

Usage    - $set->add_all($ele1, $ele2, $ele3, ...)
Returns  - true if the elements were successfully added
Args     - the elements to be added
Function - adds the given elements to this set

get_set

Usage    - $set->get_set()
Returns  - this set
Args     - 
Function - returns this set

contains

Usage    - $set->contains()
Returns  - 1 (true) if this set contains the given element
Args     - the element to be checked
Function - checks if this set constains the given element

size

Usage    - $set->size()
Returns  - the size of this set
Args     - 
Function - tells the number of elements held by this set

clear

Usage    - $set->clear()
Returns  - 
Args     - 
Function - clears this list

is_empty

Usage    - $set->is_empty()
Returns  - true if this set is empty
Args     - 
Function - checks if this set is empty

equals

Usage    - $set->equals($another_set)
Returns  - either 1 (true) or 0 (false)
Args     - the set (Core::Util::Set) to compare with
Function - tells whether this set is equal to the given one

NAME Util::Set - a Set implementation =head1 SYNOPSIS

use Set;

################# # class methods # ################# $my_set = Set->new;

####################### # object data methods # #######################

### set versions ### $my_set->add("CCO:P0000001"); $my_set->add_all("CCO:P0000002", "CCO:P0000003", "CCO:P0000004");

### get versions ### foreach ($my_set->get_set()) { print $_, "\n"; }

######################## # other object methods # ########################

print "\nContained!\n" if ($my_set->contains("CCO:P0000001"));

$my_set2 = Set->new; $my_set2->add_all("CCO:P0000001", "CCO:P0000002", "CCO:P0000003", "CCO:P0000004"); print $my_set->equals($my_set2);

DESCRIPTION A set.

AUTHOR

Erick Antezana, <erant@psb.ugent.be>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by erant

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.