| Collections documentation | view source | Contained in the Collections distribution. |
Collections::Set - Easy to use iterator with unique elements
Version 0.01
use Collections::Set;
my $col = Collections::Set->new;
# Add new element
$col->add('some string');
$col->add('some string');
# Size will return 1 (One unique element)
print $col->size;
# Remove element
$col>remove('some string');
# Size will return 0
print $col->size;
Add $element as part of receiver's elements, if the element already exists it does nothing
$colection->add(1);
Add all $collection's element as part of receiver's elements, it adds elements that don't already exists in the collection
$colection->add_all($another_collection); ... or ... $collection->add_all(1,2,3); ... or ... $colection->add_all([1,2,3]);
Returns an Collections::Ordered with the same elements of this collection
my $col = $collection->to_ordered;
Mariano Wahlmann, <dichoso at gmail.com>
Please report any bugs or feature requests to dichoso at gmail.com.
I will be notified, and then you'll be notified of progress on your bug as I
make changes.
Copyright 2009 Mariano Wahlmann, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Collections documentation | view source | Contained in the Collections distribution. |