MAGE::...cation(3pm)
π NAME π
Bio::MAGE::DesignElement::FeatureLocation β a whole class for the MAGE-OM API, and yes bestie, this is the MAGE::...cation(3pm) page from the User Contributed Perl Documentation. Buckle up, it's a long one, and this is only part one. π
β¨ SYNOPSIS β¨
Okay so here's the vibe, copy-paste style:
use Bio::MAGE::DesignElement::FeatureLocation
# creating an empty instance
my $featurelocation = Bio::MAGE::DesignElement::FeatureLocation->new();
# creating an instance with existing data
my $featurelocation = Bio::MAGE::DesignElement::FeatureLocation->new(
row=>$row_val,
column=>$column_val,
propertySets=>\@namevaluetype_list,
);
# 'row' attribute
my $row_val = $featurelocation->row(); # getter
$featurelocation->row($value); # setter
# 'column' attribute
my $column_val = $featurelocation->column(); # getter
$featurelocation->column($value); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $featurelocation->propertySets(); # getter
$featurelocation->propertySets(\@namevaluetype_list); # setter
πΈ DESCRIPTION πΈ
Straight from the MAGE-OM documentation for the FeatureLocation class, no notes:
Specifies where a feature is located relative to a grid.
That's it, that's the whole point of this class. Grid math era. β¨
π¦ INHERITANCE π¦
Bio::MAGE::DesignElement::FeatureLocation has these superclasses, aka its whole ancestry:
Bio::MAGE::Extendable
π CLASS METHODS π
Bestie listen β every single one of these can be called without making an instance first. Just use the Bio::MAGE::DesignElement::FeatureLocation->methodname() syntax and you're good. π
new()
new(%args)
The object constructor new() takes these optional named-value style arguments, and they're all optional, so no pressure:
rowβ sets the value of therowattributecolumnβ sets the value of thecolumnattributepropertySetsβ sets the value of thepropertySetsassociation (fun fact: this association was inherited from the classBio::MAGE::Extendable). The value has to be of type: array ofBio::MAGE::NameValueType.
$obj = class->new(%parameters)
The new() method IS the class constructor. Main character energy fr.
- Parameters: if you hand it a list of name/value parameters, the matching slots, attributes, or associations get 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 the class defines one.
@names = class->get_slot_names()
The get_slot_names() method grabs the name of every slot defined in a given class.
β οΈ NOTE: this list of names does not include attribute or association names. Don't come for me, that's just how it is.
- 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. Simple, iconic.
$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. Meta, but make it a hash. π
π INSTANCE METHODS π
$obj_copy = $obj->new()
When you call it on an existing object reference and not a class name, the new() method acts as a copy constructor β the new object's initial values get set to be those of the existing object. Clone era. πͺ
- 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 the class defines one.
$obj->set_slots(%parameters)
$obj->set_slots(\@name_list, \@value_list)
The set_slots() method sets a bunch of slots at the same time. It's got two different invocation methods β the first takes a named parameter list, and the second takes two array references. Pick your fighter. βοΈ
- Return value: none
- Side effects: will call
croak()if a slot_name is used that the class does not define. Do not test this on purpose bestie. π
@obj_list = $obj->get_slots(@name_list)
The get_slots() method gets the values of a bunch 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 $name to the value $val.
- Return value: the new value of the slot, i.e. $val
- Side effects: none πΈ
$val = $obj->get_slot($name)
The get_slot() method gets the values of a bunch of slots at the same time.
- Return value: a single slot value, or
undefif the slot has not been initialized. - Side effects: none πΈ
π ATTRIBUTES π
Attributes are simple data types that belong to a single instance of a class. In the Perl implementation of the MAGE-OM classes, the interface to attributes is implemented using separate setter and getter methods for each attribute. So yes, you get a whole lil pair of methods per attribute.
Bio::MAGE::DesignElement::FeatureLocation has the following attribute accessor methods:
row
Methods for the row attribute.
From the MAGE-OM documentation:
row position in the Zone
$val = $featurelocation->setRow($val)
The restricted setter method for the row attribute.
- Input parameters: the value to which the
rowattribute will be set - Return value: the current value of the
rowattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified π
$val = $featurelocation->getRow()
The restricted getter method for the row attribute.
- Input parameters: none
- Return value: the current value of the
rowattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified π
column
Methods for the column attribute.
From the MAGE-OM documentation:
column position in the Zone.
$val = $featurelocation->setColumn($val)
The restricted setter method for the column attribute.
- Input parameters: the value to which the
columnattribute will be set - Return value: the current value of the
columnattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified π
$val = $featurelocation->getColumn()
The restricted getter method for the column attribute.
- Input parameters: none
- Return value: the current value of the
columnattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified π
π§ ASSOCIATIONS π§
Associations are references to other classes. In MAGE-OM, associations have a cardinality that determines the minimum and maximum number of instances of the 'other' class that may be included in the association. Cardinality is literally just the "how many of these am I allowed to have" vibe check.
- There must be exactly one item in the association, i.e. this is a mandatory data field.
0..1There may be one item in the association, i.e. this is an optional data field.1..NThere must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.0..NThere may be one or more items in the association, i.e. this is an optional data field, with list cardinality.
Bio::MAGE::DesignElement::FeatureLocation has the following association accessor methods:
propertySets
Methods for the propertySets association.
From the MAGE-OM documentation:
Allows specification of name/value pairs. Meant to primarily help in-house, pipeline processing of instances by providing a place for values that aren't part of the specification proper.
$array_ref = $featurelocation->setPropertySets($array_ref)
The restricted setter method for the propertySets association.
- Input parameters: the value to which the
propertySetsassociation will be set : a reference to an array of objects of typeBio::MAGE::NameValueType - Return value: the current value of the
propertySetsassociation : a reference to an array of objects of typeBio::MAGE::NameValueType - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array classBio::MAGE::NameValueTypeinstances π
$array_ref = $featurelocation->getPropertySets()
The restricted getter method for the propertySets association.
- Input parameters: none
- Return value: the current value of the
propertySetsassociation : a reference to an array of objects of typeBio::MAGE::NameValueType - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified π
$val = $featurelocation->addPropertySets(@vals)
Because the propertySets association has list cardinality, it may store more than one value. This method adds the current list of objects in the propertySets association. Add-to-the-pile behaviour, we love to see it.
- Input parameters: the list of values
@valsto add to thepropertySetsassociation. NOTE: submitting a single value is permitted. - Return value: the number of items stored in the slot after adding
@vals - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::NameValueTypeπ
And then there's this lil guy hanging out at the end, exactly as written:
sub initialize {
my $self = shift;
return 1;
}
Okay but don't go anywhere yet β part two is coming. π
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
Okay bestie, so in the Perl glow-up of MAGE-OM classes, there are literally three flavors of class data members: slots, attributes, and associations. Let's get into it. π
π SLOTS π
This API calls a data member a slot when it wasn't in the UML model and is mostly for internal stuff β only touch if you <em>really</em> know the API's inner workings, no cap. Most of the time slots get used by generic methods like the ones in the XML writing and reading classes. π§
Slots are built with unified getter/setter methods:
$var = $obj->slot_name();β grabs the current value of the slot. β¨$new_var = $obj->slot_name($new_var);β stores$new_varin the slot, and the return value is also$new_var. Slay.@names = $obj->get_slot_names()β returns the list of all slots in the class. π
DATA CHECKING: No data type checking is made for these methods. So like, be careful, bestie. π
π¦ ATTRIBUTES AND ASSOCIATIONS π¦
The words attribute and association mean data members of the class that came straight from the UML model. Iconic.
In the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented with three separate methods:
get*β retrieves the current value.
NOTE: For associations, if the association has list cardinality, an array reference is returned.
DATA CHECKING: Ensure that no argument is provided. Don't be out here passing args, okay? π
set*β sets the current value, replacing any existing value.
NOTE: For associations, if the association has list cardinality, the argument must be an array reference. Because of this, you probably should be using the add* methods. Lowkey important.
DATA CHECKING: For attributes, ensure that a single value is provided as the argument. For associations, if the association has list cardinality, ensure that the argument is a reference to an array of instances of the correct MAGE-OM class, otherwise ensure that there is a single argument of the correct MAGE-OM class. Basically, match the vibe of the class, periodt.
add*β
NOTE: Only present in associations with list cardinality.
Appends a list of objects to any values that may already be stored in the association.
DATA CHECKING: Ensure that all arguments are of the correct MAGE-OM class. No random objects allowed. π
πΈ 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:
$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. It's giving "go read the rest, bestie." πβ¨
π BUGS π
Please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net). They wanna hear from you. π«Ά
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org). Legend behavior. π
π SEE ALSO π
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
- Around line 274:
'=item' outside of any '=over' - Around line 359:
You forgot a '=back' before '=head2' - Around line 531:
Expected '=item 2' - Around line 536:
Expected '=item 3' - Around line 541:
Expected '=item 4'
Okay bestie, that's the whole vibe. This page was cooked up with perl v5.32.0 on 2020-11-27 and it's MAGE::...cation(3pm) β go forth and code slay. πβ¨π¦
π¦ 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