BioMart::Configuration
BooleanFilter
Toolbar
Summary
BioMart::Configuration::BooleanFilter
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
Object responsible for boolean included/excluded filters
Description
Object responsible for boolean included/excluded filters
Methods
Methods description
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 |
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 |
Usage : no arguments Description: gets this BooleanFilter as an exclude rather than include filter Returntype : none Exceptions : none Caller : caller |
Usage : $filt->getNumberFlag; Description: geet the number flag for 1,0, null type filters Returntype : none Exceptions : none Caller : caller |
Usage : no arguments Description: sets this BooleanFilter as an exclude rather than include filter Returntype : none Exceptions : none Caller : caller |
Usage : no arguments Description: sets this BooleanFilter as an include rather than exclude filter Returntype : none Exceptions : none Caller : caller |
Usage : $filt->setNumberFlag; Description: set the number flag for 1,0, null type filters Returntype : none Exceptions : none Caller : caller |
Usage : Description: returns the table name associated with this filter; Returntype : String table name Exceptions : none Caller : caller |
Methods code
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; } |
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); } |
sub _new
{ my ($self, @param) = @_;
$self->SUPER::_new(@param);
$self->attr('attribute',undef);
$self->attr('excluded',0);
$self->attr('number_flag',0); } |
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; } |
sub attribute
{
my ($self, $attribute) = @_;
if ($attribute){
$self->set('attribute', $attribute);
}
return $self->get('attribute'); } |
sub getExcluded
{ my $self = shift;
return $self->get('excluded'); } |
sub getNumberFlag
{ my $self = shift;
return $self->get('number_flag'); } |
sub setExcluded
{ my ($self, $val) = @_;
if (defined($val))
{
$self->set('excluded',$val);
}
else
{
$self->set('excluded',1);
} } |
sub setIncluded
{ my $self = shift;
$self->set('excluded',0); } |
sub setNumberFlag
{ my $self = shift;
$self->set('number_flag',1); } |
sub table
{ my $self = shift;
my $attribute = $self->get('attribute');
return $attribute->table; } |
General documentation
AUTHOR - Arek Kasprzyk, Syed Haider, Damian Smedley | Top |