|
Bio::MAGE::Base - generic base class |
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.
new(%params)new() method is the class constructor.
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.
The following methods can all be called with either the
Namespace::Class->methodname() and $obj->methodname() syntaxes.
get_slot_names()get_slot_names() method is used to retrieve the name of all
slots defined for a given object.
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
get_attribute_names()get_association_names()get_superclasses()get_subclasses()class_name()package_name()associations()Association objects that
provide the meta-information for the association.
These methods must be invoked with the direct object syntax using an existing instance, i.e. $object->method_name().
new()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.
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.
set_slots(%parameters)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.
Return value: none
Side effects: will call croak() if a slot_name is used that the class
does not define.
get_slots(@name_list)get_slots() method is used to get the values of a number of
slots at the same time.
Return value: a list of instance objects
Side effects: none
set_slot($name,$val)set_slot() method sets the slot $name to the value $val
Return value: the new value of the slot, i.e. $val
Side effects: none
get_slot($name)get_slot() method is used to get the values of a number of
slots at the same time.
Return value: a single slot value, or undef if the slot has not been initialized.
Side effects: none
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).
|
Bio::MAGE::Base - generic base class |