DETECTER

Node

Summary Package variables Synopsis Description General documentation Methods

Summary
 Parsing the PAML Files
Package variables top
No package variables defined.
Synopsistop
 Node handler
Descriptiontop
 Node is a module that identifies and handles all of the sites that are contained 
within the input PAML files.
Methodstop
add_siteDescriptionCode
get_numb_of_sitesDescriptionCode
get_siteDescriptionCode
get_site_by_idDescriptionCode
newDescriptionCode
set_node_noDescriptionCode

Methods description

add_sitecodetopprevnext
 Title    : add_site 
Usage : $node->add_site($site_obj)
Function : adds site object to the sites array
Returns : none
Argument : $site_obj
get_numb_of_sitescodetopprevnext
 Title    : get_numb_of_sites
Usage : $no_of_sites = $node->get_numb_of_sites
Function : obtain the total number of the sites within the nodes
Returns : number of sites stored in the nodes
Argument : none
get_sitecodetopprevnext
 Title    : get_site 
Usage : $site_obj = $node->get_site($site_no)
Function : get the site objects based on array position
Returns : sites_obj
Argument : site object array position
get_site_by_idcodetopprevnext
 Title    : get_site_by_id 
Usage : $site_obj = $node->get_site($site_id)
Function : get the site objects based on site id
Returns : sites_obj
Argument : site_id from site object
newcodetopprevnext
 Title    : new 
Usage : $node = new Node();
Function : creates new object for storing node data
Returns : node object
Argument : none
set_node_nocodetopprevnext
 Title    : set_node_no 
Usage : $node->set_node_no($node_no)
Function : sets the node number for the object
Returns : none
Argument : $node_no

Methods code

add_sitedescriptiontopprevnext
sub add_site {
	my $class = shift;
	my $site  = shift;
	push(@{$class->{_sites_array}},$site);
	$class->{id_ref}->{$site->get_site_id} = $class->{'temp_index'};
	$class->{'temp_index'}++;
}
get_numb_of_sitesdescriptiontopprevnext
sub get_numb_of_sites {
	my $class = shift;
	my $numbOfnodes = @{$class->{_sites_array}};
	return $numbOfnodes;
}
get_sitedescriptiontopprevnext
sub get_site {
	my $class = shift;
	return $class->{_sites_array}->[$_[0]];
}
get_site_by_iddescriptiontopprevnext
sub get_site_by_id {
	my $class = shift;
	my $site_id = $class->{id_ref}->{$_[0]};
	if (defined($site_id)){
		return $class->{_sites_array}->[$site_id];
	}
	else {
		return undef;
	}
}
newdescriptiontopprevnext
sub new {
	my $class = shift;
	my $data  = {
		'_no' 	     => undef,
		'_sites_array' => [],
		'temp_index' => 0,
		'id_ref' =>{} 
	};
	bless ($data,$class);
	return $data;
}
set_node_nodescriptiontopprevnext
sub set_node_no {
	my $class     = shift;
	$class->{_no} = shift;
}

General documentation

Node top
 Package 'Node'
FEEDBACK top
 All feedback (bugs, feature enhancements, etc.) are greatly appreciated.
AUTHOR top
 Danny W. De Kee (dan.dekee@gmail.com)