ensembl-analysis Checker
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Test::Checker
Package variables
No package variables defined.
Inherit
Bio::EnsEMBL::Root
Synopsis
Module to define the interface for and implement the basic functionality of
the various Checker classes
Description
Methods
add_ErrorDescriptionCode
add_Warning
No description
Code
check
No description
Code
get_all_Errors
No description
Code
get_all_Warnings
No description
Code
has_Errors
No description
Code
ignorewarnings
No description
Code
output
No description
Code
Methods description
add_Error code    nextTop
 
Title : add_Error
Usage : $obj->add_Error($newval)
Function:
Returns : value of errors
Methods code
add_ErrordescriptionprevnextTop
sub add_Error {
   my $self = shift;
   if( @_ ) {
      my $value = shift;
      push @{$self->{_errors}},$value;
    }
    return @{$self->{_errors}};
}
add_WarningdescriptionprevnextTop
sub add_Warning {
   my $self = shift;
   if( @_ ) {
      my $value = shift;
      push @{$self->{_warnings}},$value;
    }
    return @{$self->{_warnings}};
}
checkdescriptionprevnextTop
sub check {
  my $self = shift;

  $self->throw("Object did not provide the check method of the Checker interface");
}
get_all_ErrorsdescriptionprevnextTop
sub get_all_Errors {
   my $self = shift;
   if (!defined($self->{_errors})) {
     @{$self->{_errors}} = ();
   }
   return @{$self->{_errors}};
}
get_all_WarningsdescriptionprevnextTop
sub get_all_Warnings {
   my $self = shift;
   if (!defined($self->{_warnings})) {
     @{$self->{_warnings}} = ();
   }
   return @{$self->{_warnings}};
}
has_ErrorsdescriptionprevnextTop
sub has_Errors {
  my $self = shift;

  if (scalar($self->get_all_Errors) || 
      (scalar($self->get_all_Warnings) && !$self->ignorewarnings)) {
    return 1;
  } 
  return 0;
}
ignorewarningsdescriptionprevnextTop
sub ignorewarnings {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{_ignorewarnings} = $arg;
  }
  return $self->{_ignorewarnings};
}
outputdescriptionprevnextTop
sub output {
  my $self = shift;

  if (scalar($self->get_all_Errors)) {
    print "\nErrors:\n";
    foreach my $error ($self->get_all_Errors()) {
      print "  " . $error;
    }
  }
  if (scalar($self->get_all_Warnings)) {
    print "\nWarnings:\n";
    foreach my $warning ($self->get_all_Warnings) {
      print "  " . $warning;
    }
  }
}
General documentation
CONTACTTop
  Steve Searle <searle@sanger.ac.uk>
APPENDIXTop
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _