* sync with trunk
[bioperl-live.git] / Bio / DescribableI.pm
bloba2ee8536cb5e1624a66965130522dc3d2a04234d
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::DescribableI - interface for objects with human readable names and descriptions
12 =head1 SYNOPSIS
15 # to test this is a describable object
17 $obj->isa("Bio::DescribableI") ||
18 $obj->throw("$obj does not implement the Bio::DescribableI interface");
20 # accessors
22 $name = $obj->display_name();
23 $desc = $obj->description();
27 =head1 DESCRIPTION
29 This interface describes methods expected on describable objects, ie
30 ones which have human displayable names and descriptions
32 =head1 FEEDBACK
34 =head2 Mailing Lists
36 User feedback is an integral part of the evolution of this and other
37 Bioperl modules. Send your comments and suggestions preferably to one
38 of the Bioperl mailing lists. Your participation is much appreciated.
40 bioperl-l@bioperl.org - General discussion
41 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
43 =head2 Reporting Bugs
45 Report bugs to the Bioperl bug tracking system to help us keep track
46 the bugs and their resolution. Bug reports can be submitted via the web:
48 http://bugzilla.open-bio.org/
50 =head1 AUTHOR - Ewan Birney
52 Email birney@sanger.ac.uk
54 =cut
56 package Bio::DescribableI;
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 display_name
69 Title : display_name
70 Usage : $string = $obj->display_name()
71 Function: A string which is what should be displayed to the user
72 the string should have no spaces (ideally, though a cautious
73 user of this interface would not assumme this) and should be
74 less than thirty characters (though again, double checking
75 this is a good idea)
76 Returns : A scalar
77 Status : Virtual
79 =cut
81 sub display_name {
82 my ($self) = @_;
83 $self->throw_not_implemented();
87 =head2 description
89 Title : description
90 Usage : $string = $obj->description()
91 Function: A text string suitable for displaying to the user a
92 description. This string is likely to have spaces, but
93 should not have any newlines or formatting - just plain
94 text. The string should not be greater than 255 characters
95 and clients can feel justified at truncating strings at 255
96 characters for the purposes of display
97 Returns : A scalar
98 Status : Virtual
100 =cut
102 sub description {
103 my ($self) = @_;
104 $self->throw_not_implemented();