add
Usage - $set->add($dbxref)
Returns - true if the element was successfully added
Args - the element (CCO::Core::Dbxref) to be added
Function - adds an element to this set
remove
Usage - $set->remove($element)
Returns - the removed element (CCO::Core::Dbxref)
Args - the element to be removed (CCO::Core::Dbxref)
Function - removes an element from this set
contains
Usage - $set->contains($dbxref)
Returns - either 1(true) or 0 (false)
Args - the element (CCO::Core::Dbxref) to be checked
Function - checks if this set constains the given element
equals
Usage - $set->equals($another_dbxref_set)
Returns - either 1 (true) or 0 (false)
Args - the set (CCO::Util::DbxrefSet) to compare with
Function - tells whether this set is equal to the given one
NAME
CCO::Util::DbxrefSet - a DbxrefSet implementation
SYNOPSIS
use CCO::Util::DbxrefSet; use CCO::Core::Dbxref; use strict;
my $my_set = CCO::Util::DbxrefSet->new;
# three new dbxref's my $ref1 = CCO::Core::Dbxref->new; my $ref2 = CCO::Core::Dbxref->new; my $ref3 = CCO::Core::Dbxref->new;
$ref1->name("CCO:vm"); $ref2->name("CCO:ls"); $ref3->name("CCO:ea");
# remove from my_set $my_set->remove($ref1); $my_set->add($ref1); $my_set->remove($ref1);
### set versions ### $my_set->add($ref1); $my_set->add($ref2); $my_set->add($ref3);
my $ref4 = CCO::Core::Dbxref->new; my $ref5 = CCO::Core::Dbxref->new; my $ref6 = CCO::Core::Dbxref->new;
$ref4->name("CCO:ef"); $ref5->name("CCO:sz"); $ref6->name("CCO:qa");
$my_set->add_all($ref4, $ref5, $ref6);
$my_set->add_all($ref4, $ref5, $ref6);
# remove from my_set $my_set->remove($ref4);
my $ref7 = $ref4; my $ref8 = $ref5; my $ref9 = $ref6;
my $my_set2 = CCO::Util::DbxrefSet->new;
$my_set->add_all($ref4, $ref5, $ref6); $my_set2->add_all($ref7, $ref8, $ref9, $ref1, $ref2, $ref3);
$my_set2->clear();
DESCRIPTION
A set (CCO::Util::Set) of dbxref (CCO::Core::Dbxref) elements.
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.