Erick Antezana > ONTO-PERL > OBO::APO::GoaAssociationSet

Download:
ONTO-PERL/ONTO-PERL-1.41.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

OBO::APO::GoaAssociationSet - A GoaAssociationSet implementation

SYNOPSIS ^

use OBO::APO::GoaAssociationSet; use OBO::APO::GoaAssociation; use strict;

my $my_set = OBO::APO::GoaAssociationSet->new();

# three new goa_association's my $goa_association1 = OBO::APO::GoaAssociation->new(); my $goa_association2 = OBO::APO::GoaAssociation->new(); my $goa_association3 = OBO::APO::GoaAssociation->new();

$goa_association1->assc_id("APO:vm"); $goa_association2->assc_id("APO:ls"); $goa_association3->assc_id("APO:ea");

# remove from my_set $my_set->remove($goa_association1); $my_set->add($goa_association1); $my_set->remove($goa_association1);

### set versions ### $my_set->add($goa_association1); $my_set->add($goa_association2); $my_set->add($goa_association3);

my $goa_association4 = OBO::APO::GoaAssociation->new(); my $goa_association5 = OBO::APO::GoaAssociation->new(); my $goa_association6 = OBO::APO::GoaAssociation->new();

$goa_association4->assc_id("APO:ef"); $goa_association5->assc_id("APO:sz"); $goa_association6->assc_id("APO:qa");

$my_set->add_all($goa_association4, $goa_association5, $goa_association6);

$my_set->add_all($goa_association4, $goa_association5, $goa_association6);

# remove from my_set $my_set->remove($goa_association4);

my $goa_association7 = $goa_association4; my $goa_association8 = $goa_association5; my $goa_association9 = $goa_association6;

my $my_set2 = OBO::APO::GoaAssociationSet->new();

$my_set->add_all($goa_association4, $goa_association5, $goa_association6); $my_set2->add_all($goa_association7, $goa_association8, $goa_association9, $goa_association1, $goa_association2, $goa_association3);

$my_set2->clear();

DESCRIPTION ^

A set (OBO::Util::Set) of goa_association records.

COPYRIGHT AND LICENSE ^

Copyright (C) 2006 by ONTO-perl

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.

add

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

add_unique

 Usage    - $set->add_unique($goa_association)
 Returns  - 1 (the element is always added)
 Args     - the element (OBO::APO::GoaAssociation) to be added which is known to be unique!
 Function - adds an element to this set
 Remark   - this function should be used when the element to be added is known to be unique,
                        this function has a tremendous impact on the performance (compared to simply add())  

remove

 Usage    - $set->remove($element)
 Returns  - the removed element (OBO::APO::GoaAssociation)
 Args     - the element to be removed (OBO::APO::GoaAssociation)
 Function - removes an element from this set

remove_duplicates

 Usage    - $set->remove_duplicates()
 Returns  - a set object (OBO::APO::GoaAssociationSet) 
 Args     - none 
 Function - eliminates redundency in a GOA association set object (OBO::APO::GoaAssociationSet)

contains

 Usage    - $set->contains($goa_association)
 Returns  - either 1(true) or 0 (false)
 Args     - the element (OBO::APO::GoaAssociation) to be checked
 Function - checks if this set constains the given element

equals

 Usage    - $set->equals($another_goa_assocations_set)
 Returns  - either 1 (true) or 0 (false)
 Args     - the set (OBO::APO::GoaAssociationSet) to compare with
 Function - tells whether this set is equal to the given one
syntax highlighting: