MAGE::Array(3pm)
MAGE::Array(3pm) πβ¨ β bestie, you found the page for Bio::MAGE::Array, and it's lowkey the container module for the Array package. No cap.
β¨ NAME β¨
Bio::MAGE::Array β Container module for classes in the MAGE package: Array. periodt.
πΈ SYNOPSIS πΈ
use Bio::MAGE::Array;
π¦ DESCRIPTION π¦
This is a package module that encapsulates a number of classes in the Bio::MAGE hierarchy. These classes belong to the Array package of the MAGE-OM object model. it's giving very structured, very MAGE-OM. π§
π CLASSES π
The Bio::MAGE::Array module contains the following Bio::MAGE classes:
ArrayFeatureDefectArrayGroupArrayManufactureArrayManufactureDeviationFiducialManufactureLIMSManufactureLIMSBiomaterialPositionDeltaZoneDefect
π CLASS METHODS π
@class_list = Bio::MAGE::Array::classes();β This method returns a list of non-fully qualified class names (i.e. they do not have'Bio::MAGE::'as a prefix) in this package. slay.$obj = class->new(%parameters)β The"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.
@names = class->get_slot_names()β The"get_slot_names()"method is used to retrieve the name of all slots defined in a given class.
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
@name_list = get_attribute_names()β returns the list of attribute data members for this class.@name_list = get_association_names()β returns the list of association data members for this class.@class_list = get_superclasses()β returns the list of superclasses for this class.@class_list = get_subclasses()β returns the list of subclasses for this class.$name = class_name()β Returns the full class name for this class.$package_name = package_name()β Returns the base package name (i.e. no'namespace::') of the package that contains this class.%assns = associations()β 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.
π INSTANCE METHODS π
$obj_copy = $obj->new()β 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.
- 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.
$obj->set_slots(%parameters)/$obj->set_slots(\@name_list, \@value_list)β 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.- Return value: none
- Side effects: will call
"croak()"if a slot_name is used that the class does not define.
@obj_list = $obj->get_slots(@name_list)β The"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
$val = $obj->set_slot($name,$val)β The"set_slot()"method sets the slot$nameto the value$val- Return value: the new value of the slot, i.e.
$val - Side effects: none
- Return value: the new value of the slot, i.e.
$val = $obj->get_slot($name)β The"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
undefif the slot has not been initialized. - Side effects: none
- Return value: a single slot value, or
$val = $array->xml_lists()/$inval = $array->xml_lists($inval)β This is the unified setter/getter method for thexml_listsslot.- If
$invalis specified, the setter method is invoked, with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter the current value of the
xml_listsslot - Side effects: none
- Exceptions: none
- If
$val = $array->tagname()/$inval = $array->tagname($inval)β This is the unified setter/getter method for thetagnameslot.- If
$invalis specified, the setter method is invoked, with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter the current value of the
tagnameslot - Side effects: none
- Exceptions: none
- If
$val = $array->arraygroup_list()/$inval = $array->arraygroup_list($inval)β This is the unified setter/getter method for thearraygroup_listslot.- If
$invalis specified, the setter method is invoked, with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter the current value of the
arraygroup_listslot - Side effects: none
- Exceptions: none
- If
$val = $array->array_list()/$inval = $array->array_list($inval)β This is the unified setter/getter method for thearray_listslot.- If
$invalis specified, the setter method is invoked, with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter the current value of the
array_listslot - Side effects: none
- Exceptions: none
- If
$val = $array->arraymanufacture_list()/$inval = $array->arraymanufacture_list($inval)β This is the unified setter/getter method for thearraymanufacture_listslot.- If
$invalis specified, the setter method is invoked, with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter the current value of the
arraymanufacture_listslot - Side effects: none
- Exceptions: none
- If
$array_ref = $array->getArrayGroup_list()β This method handles the list for the"Bio::MAGE::Array::ArrayGroup"class. It returns a reference to an array of the class objects that have been associated with the package instance.- This is useful when retrieving data from parsed MAGE-ML file.
$array->addArrayGroup(@vals)β This method is an interface for adding"Bio::MAGE::Array::ArrayGroup"objects to the"arraygroup_list"list. It is generally used by generic methods such as those in the XMLWriter.- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted. - Return value: none
- Side effects: none
- Exceptions: will call
"croak()"if no input parameters are specified , or if any of the objects in@valsis not a subclass of class"Bio::MAGE::Array::ArrayGroup"
- Input parameters: the list of values
$array_ref = $array->getArray_list()β This method handles the list for the"Bio::MAGE::Array::Array"class. It returns a reference to an array of the class objects that have been associated with the package instance.- This is useful when retrieving data from parsed MAGE-ML file.
$array->addArray(@vals)β This method is an interface for adding"Bio::MAGE::Array::Array"objects to the"array_list"list. It is generally used by generic methods such as those in the XMLWriter.- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted. - Return value: none
- Side effects: none
- Exceptions: will call
"croak()"if no input parameters are specified , or if any of the objects in@valsis not a subclass of class"Bio::MAGE::Array::Array"
- Input parameters: the list of values
$array_ref = $array->getArrayManufacture_list()β This method handles the list for the"Bio::MAGE::Array::ArrayManufacture"class. It returns a reference to an array of the class objects that have been associated with the package instance.- This is useful when retrieving data from parsed MAGE-ML file.
$array->addArrayManufacture(@vals)β This method is an interface for adding"Bio::MAGE::Array::ArrayManufacture"objects to the"arraymanufacture_list"list. It is generally used by generic methods such as those in the XMLWriter.- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted. - Return value: none
- Side effects: none
- Exceptions: will call
"croak()"if no input parameters are specified , or if any of the objects in@valsis not a subclass of class"Bio::MAGE::Array::ArrayManufacture"
- Input parameters: the list of values
$array->obj2xml($writer)β Write out this object, and all sub-objects, as XML using the supplied$writerto actually do the XML formatting.- Input parameters:
$writermust be an XML writer, e.g. an instance ofBio::MAGE::XML::Writer. It must have methods:write_start_tag(),write_end_tag(), andobj2xml(). - Return value: none
- Side effects: all writing is delegated to the
$writer- it'swrite_start_tag()andwrite_end_tag()methods are invoked with the appropriate data, and all class sub-objects of the"Bio::MAGE::Array"instance will have theirobj2xml()methods invoked in turn. By allowing the$writerto do the actual formatting of the output XML, it enables the user to precisely control the format. - Exceptions: will call
"croak()"if no identifier has been set for the"Bio::MAGE::Array"instance.
- Input parameters:
$array->register($obj)β Store an object for later writing as XML.- Input parameters: object to be added to the list of registered objects.
- Return value: none
- Side effects: if
$objneeds to be stored by this class, a reference will be stored in the correct XML list for this class. - Exceptions: none
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
okay bestie so here's the tea π΅ β in the Perl implementation of MAGE-OM classes, there are literally three types of class data members, and you gotta know which is which:
- slots
- attributes
- associations
π§ SLOTS
So the term "slot" in this API means a data member of the class that was NOT in the UML model β it's there for mainly internal purposes. Translation: use only if you understand the inner workings of the API, fr fr. Most often slots get used by generic methods, like the ones in the XML writing and reading classes. iykyk π
Slots are implemented using unified getter/setter methods:
$var = $obj->slot_name();β grabs the current value of the slot. that's it, that's the whole vibe π«Ά$new_var = $obj->slot_name($new_var);β stores$new_varin the slot, and the return value is also$new_var(yes, it hands it right back to you, iconic behavior β¨)@names = $obj->get_slot_names()β returns the list of all slots in the class. the full roster, no gatekeeping π
DATA CHECKING: nope, no data type checking is made for these methods. zero vibe checks here π
πΈ ATTRIBUTES AND ASSOCIATIONS
The terms "attribute" and "association" mean data members of the class that were specified directly from the UML model. so these are the official ones, not the internal gremlins.
In the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented using three separate methods:
get*β retrieves the current value.
NOTE: for associations, if the association has list cardinality, an array reference is returned. so expect a ref, not a plain list, bestie π
DATA CHECKING: ensure that no argument is provided.
set*β sets the current value, replacing any existing value. out with the old, in with the new π
NOTE: for associations, if the association has list cardinality, the argument must be an array reference. and because of that... you probably should be using the add* methods instead. just saying π
DATA CHECKING: for attributes, ensure that a single value is provided as the argument. for associations, if the association has list cardinality, ensure the argument is a reference to an array of instances of the correct MAGE-OM class; otherwise ensure there's a single argument of the correct MAGE-OM class. the type check is real and it will catch you π€
add*β appends a list of objects to any values that may already be stored in the association.
NOTE: only present in associations with list cardinality. if you don't see it, that's why π¦
DATA CHECKING: ensure that all arguments are of the correct MAGE-OM class. every single one. no stragglers π¨
π GENERIC METHODS
The unified base class of all MAGE-OM classes, Bio::MAGE::Base, provides a set of generic methods that will operate on slots, attributes, and associations β all of them, no favorites π:
$val = $obj->get_slot($name)
\@list_ref = $obj->get_slots(@name_list);
$val = $obj->set_slot($name,$val)
$obj->set_slots(%parameters)
$obj->set_slots(\@name_list, \@value_list)
See elsewhere in this page for a detailed description of these methods. (yes, it's giving "go read the other section" but that's literally what it says π« )
π BUGS
Please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)
like, actually send them. don't just suffer in silence, bestie π
π AUTHOR
Jason E. Stewart (jasons 'at' cpan 'dot' org)
the blueprint. the moment. the icon π
π SEE ALSO
and that's the whole page, bestie!! πβ¨ you made it to the end, so proud of you π«Ά this was MAGE::Array(3pm), from perl v5.32.0, dated 2020-11-27 β go forth and slay your MAGE-OM classes ππ
π¦ where this page comes from
- debian bookworm: libbio-mage-perl 20030502.3-6 Β· MIT
- debian trixie: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu jammy: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu noble: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu resolute: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu stonking: libbio-mage-perl 20030502.3-6 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms