[bug 2686]
[bioperl-live.git] / Bio / IdCollectionI.pm
blobc8be8f6ff9a6f59079446679e486b4e6fde3057e
1 # $Id$
4 # This module is licensed under the same terms as Perl itself. You use,
5 # modify, and redistribute it under the terms of the Perl Artistic License.
8 =head1 NAME
10 Bio::IdCollectionI - interface for objects with multiple identifiers
12 =head1 SYNOPSIS
15 # to test this is an identifiable collection object
17 $obj->isa("Bio::IdCollectionI") ||
18 $obj->throw("$obj does not implement the Bio::IdCollectionI interface");
20 # accessors
21 @authorities = $obj->id_authorities();
22 @ids = $obj->ids();
23 $id = $obj->ids($authority);
25 =head1 DESCRIPTION
27 This interface describes methods expected on objects that have
28 multiple identifiers, each of which is controlled by a different
29 authority.
31 =head1 FEEDBACK
33 =head2 Mailing Lists
35 User feedback is an integral part of the evolution of this and other
36 Bioperl modules. Send your comments and suggestions preferably to one
37 of the Bioperl mailing lists. Your participation is much appreciated.
39 bioperl-l@bioperl.org - General discussion
40 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
42 =head2 Reporting Bugs
44 Report bugs to the Bioperl bug tracking system to help us keep track
45 the bugs and their resolution. Bug reports can be submitted via the
46 web:
48 http://bugzilla.open-bio.org/
50 =head1 AUTHOR - Lincoln Stein
52 Email lstein@cshl.org
54 =cut
56 package Bio::IdCollectionI;
57 use strict;
60 use base qw(Bio::Root::RootI);
62 =head1 Implementation Specific Functions
64 These functions are the ones that a specific implementation must
65 define.
67 =head2 id_authorities
69 Title : id_authorities
70 Usage : @array = $obj->id_authorities()
71 Function: Return the authorities which have names for this object.
72 The authorities can then be used to select ids.
74 Returns : An array
75 Status : Virtual
77 =cut
79 sub id_authorities {
80 my ($self) = @_;
81 $self->throw_not_implemented();
84 =head2 ids
86 Title : ids
87 Usage : @ids = $obj->ids([$authority1,$authority2...])
88 Function: return a list of Bio::IdentifiableI objects, optionally
89 filtered by the list of authorities.
91 Returns : A list of Bio::IdentifiableI objects.
92 Status : Virtual
94 =cut
96 sub ids {
97 my ($self) = @_;
98 my @authorities = @_;
99 $self->throw_not_implemented();