BioMart::Configuration BooleanFilter
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
BioMart::Configuration::BooleanFilter
Package variables
No package variables defined.
Included modules
Digest::MD5
Inherit
BioMart::Configuration::BaseFilter
Synopsis
Object responsible for boolean included/excluded filters
Description
Object responsible for boolean included/excluded filters
Methods
_hashCode
No description
Code
_init
No description
Code
_newDescriptionCode
_toSQL
No description
Code
attributeDescriptionCode
getExcludedDescriptionCode
getNumberFlagDescriptionCode
setExcludedDescriptionCode
setIncludedDescriptionCode
setNumberFlagDescriptionCode
tableDescriptionCode
Methods description
_newcode    nextTop
  
Usage : no arguments
Description: creates a new BooleanFilter object which can contain a single
Attribue object and a flag for excluded vs included
Returntype : BioMart::Configuration::BooleanFilter
Exceptions : none
Caller : general
attributecodeprevnextTop
  Usage      : Arg[1] - (optional) BioMart::Configuration::Attribute object
Description: get/set method for the Attribute object for this BooleanFilter
Returntype : BioMart::Configuration::Attribute object
Exceptions : none
Caller : caller
getExcludedcodeprevnextTop
  Usage      : no arguments
Description: gets this BooleanFilter as an exclude rather than include filter
Returntype : none
Exceptions : none
Caller : caller
getNumberFlagcodeprevnextTop
  Usage      :  $filt->getNumberFlag;
Description: geet the number flag for 1,0, null type filters
Returntype : none
Exceptions : none
Caller : caller
setExcludedcodeprevnextTop
  Usage      : no arguments
Description: sets this BooleanFilter as an exclude rather than include filter
Returntype : none
Exceptions : none
Caller : caller
setIncludedcodeprevnextTop
  Usage      : no arguments
Description: sets this BooleanFilter as an include rather than exclude filter
Returntype : none
Exceptions : none
Caller : caller
setNumberFlagcodeprevnextTop
  Usage      :  $filt->setNumberFlag;
Description: set the number flag for 1,0, null type filters
Returntype : none
Exceptions : none
Caller : caller
tablecodeprevnextTop
  Usage      : 
Description: returns the table name associated with this filter;
Returntype : String table name
Exceptions : none
Caller : caller
Methods code
_hashCodedescriptionprevnextTop
sub _hashCode {
  my $self = shift;

  my $digest = Digest::MD5->new;

  $digest->add($self->SUPER::_hashCode);
  $digest->add($self->table) if ($self->table);
  $digest->add($self->get('excluded'));
  $digest->add($self->attribute()->hashCode);
  return $digest->hexdigest;
}

1;
}
_initdescriptionprevnextTop
sub _init {
  my ($self, @param) = @_;

  $self->SUPER::_init(@param);

  my $proto = shift @param;

  $self->attr('attribute', $proto->attribute);
  $self->attr('excluded', 0);
  $self->attr('number_flag',0);
}
_newdescriptionprevnextTop
sub _new {
  my ($self, @param) = @_;
  $self->SUPER::_new(@param);
  $self->attr('attribute',undef);
  $self->attr('excluded',0);
  $self->attr('number_flag',0);
}
_toSQLdescriptionprevnextTop
sub _toSQL {
  my $self = shift;
  my $attribute = $self->attribute();
  my $condition = $self->get('number_flag') ? ' > 0' : ' IS NOT NULL';
  if ($self->get('excluded')){
      $condition = $self->get('number_flag') ? ' = 0' : ' IS NULL';
  }
  return $attribute->toSQL().$condition;
}
attributedescriptionprevnextTop
sub attribute {
# stores attribute
my ($self, $attribute) = @_; if ($attribute){ $self->set('attribute', $attribute); } return $self->get('attribute');
}
getExcludeddescriptionprevnextTop
sub getExcluded {
  my $self = shift;
  return $self->get('excluded');
}
getNumberFlagdescriptionprevnextTop
sub getNumberFlag {
  my $self = shift;
  return $self->get('number_flag');
}
setExcludeddescriptionprevnextTop
sub setExcluded {
  my ($self, $val) = @_;
	if (defined($val))
	{
		$self->set('excluded',$val);
	}
	else
	{
	  $self->set('excluded',1);
	}
}
setIncludeddescriptionprevnextTop
sub setIncluded {
  my $self = shift;
  $self->set('excluded',0);
}
setNumberFlagdescriptionprevnextTop
sub setNumberFlag {
  my $self = shift;
    $self->set('number_flag',1);
}
tabledescriptionprevnextTop
sub table {
  my $self = shift;
  my $attribute = $self->get('attribute');
  return $attribute->table;
}
General documentation
AUTHOR - Arek Kasprzyk, Syed Haider, Damian SmedleyTop
CONTACTTop
This module is part of the BioMart project http://www.biomart.org
Questions can be posted to the mart-dev mailing list: mart-dev@ebi.ac.uk