NAME

Collections::Set - Easy to use iterator with unique elements

VERSION

Version 0.01

SYNOPSIS

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;

INSTANCE METHODS

add($element)

Add $element as part of receiver's elements, if the element already exists it does nothing

$colection->add(1);

add_all($elements)

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]);

to_ordered()

Returns an Collections::Ordered with the same elements of this collection

my $col = $collection->to_ordered;

AUTHOR

Mariano Wahlmann, <dichoso at gmail.com>

BUGS

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 & LICENSE

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.