Bio::MAGE::Base - generic base class
use Bio::MAGE::Base; # create an empty instance my $obj = Bio::MAGE::Base->new(); # create an instance and populate with data my $obj = Bio::MAGE::Base->new(attr1=>$val1, attr2=>$val2); # copy an existing instance my $obj_copy = $obj->new();
The base class for all other Bio::MAGE classes
The following methods can all be called without first having an instance of the class via the Namespace::Class->methodname() syntax, i.e. the class name must be given as an argument to the method.
The new() method is the class constructor.
new()
Parameters: if given a list of name/value parameters the corresponding slots, attributes, or associations will have their initial values set by the constructor.
Return value: It returns a reference to an object of the class.
Side effects: It invokes the initialize() method if it is defined by the class.
initialize()
The following methods can all be called with either the Namespace::Class->methodname() and $obj->methodname() syntaxes.
The get_slot_names() method is used to retrieve the name of all slots defined for a given object.
get_slot_names()
NOTE: the list of names does not include attribute or association names.
Return value: A list of the names of all slots defined for this class.
Side effects: none
returns the list of attribute data members for this class.
returns the list of association data members for this class.
returns the list of superclasses for this class.
returns the list of subclasses for this class.
Returns the full class name for this class.
Returns the base package name (i.e. no 'namespace::') of the package that contains this class.
returns the association meta-information in a hash where the keys are the association names and the values are Association objects that provide the meta-information for the association.
Association
These methods must be invoked with the direct object syntax using an existing instance, i.e. $object->method_name().
When invoked with an existing object reference and not a class name, the new() method acts as a copy constructor - with the new object's initial values set to be those of the existing object.
Parameters: No input parameters are used in the copy constructor, the initial values are taken directly from the object to be copied.
The set_slots() method is used to set a number of slots at the same time. It has two different invocation methods. The first takes a named parameter list, and the second takes two array references.
set_slots()
Return value: none
Side effects: will call croak() if a slot_name is used that the class does not define.
croak()
The get_slots() method is used to get the values of a number of slots at the same time.
get_slots()
Return value: a list of instance objects
The set_slot() method sets the slot $name to the value $val
set_slot()
$name
$val
Return value: the new value of the slot, i.e. $val
The get_slot() method is used to get the values of a number of slots at the same time.
get_slot()
Return value: a single slot value, or undef if the slot has not been initialized.
Title : throw Usage : Function: Example : Returns : Args :
Title : throw_not_implemented Usage : Function: Example : Returns : Args :
Please send bug reports to the project mailing list: ()
perl(1).
To install Bio::MAGE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::MAGE
CPAN shell
perl -MCPAN -e shell install Bio::MAGE
For more information on module installation, please visit the detailed CPAN module installation guide.