Updates:
[bioperl-live.git] / Bio / Tools / EUtilities / Query / GlobalQuery.pm
blobfeca548796a73ce7ff28091fd0028e7eb55d5839
1 package Bio::Tools::EUtilities::Query::GlobalQuery;
2 use strict;
3 use warnings;
5 use base qw(Bio::Root::Root Bio::Tools::EUtilities::EUtilDataI);
7 sub new {
8 my ($class, @args) = @_;
9 my $self = $class->SUPER::new(@args);
10 $self->eutil('egquery');
11 $self->datatype('globalquery');
12 return $self;
15 =head2 get_term
17 Title : get_term
18 Usage : $st = $qd->get_term;
19 Function: retrieve the term for the global search
20 Returns : string
21 Args : none
23 =cut
25 sub get_term {
26 my ($self) = @_;
27 return $self->{'_term'};
30 =head2 get_database
32 Title : get_database
33 Usage : $ct = $qd->get_database;
34 Function: retrieve the database
35 Returns : string
36 Args : none
38 =cut
40 sub get_database {
41 my ($self) = @_;
42 return $self->{'_dbname'};
45 =head2 get_count
47 Title : get_count
48 Usage : $ct = $qd->get_count;
49 Function: retrieve the count for the database
50 Returns : string
51 Args : none
53 =cut
55 sub get_count {
56 my ($self) = @_;
57 return $self->{'_count'};
60 =head2 get_status
62 Title : get_status
63 Usage : $st = $qd->get_status;
64 Function: retrieve the query status for database in db()
65 Returns : string
66 Args : none
68 =cut
70 sub get_status {
71 my ($self) = @_;
72 return $self->{'_status'};
75 =head2 get_menu_name
77 Title : get_menu_name
78 Usage : $ct = $qd->get_menu_name;
79 Function: retrieve the full name for the database in db()
80 Returns : string
81 Args : None
83 =cut
85 sub get_menu_name {
86 my $self = shift;
87 return $self->{'_menuname'};
90 # private method
92 sub _add_data {
93 my ($self, $data) = @_;
94 map {$self->{'_'.lc $_} = $data->{$_}} keys %$data;
97 =head2 to_string
99 Title : to_string
100 Usage : $foo->to_string()
101 Function : converts current object to string
102 Returns : none
103 Args : (optional) simple data for text formatting
104 Note : Used generally for debugging and for the print_GlobalQuery method
106 =cut
108 sub to_string {
109 my $self = shift;
110 my $string .= sprintf("%-20s Total:%-10d Status:%s\n",
111 $self->get_database,
112 $self->get_count,
113 $self->get_status);
114 return $string;