MAGE::...osition(3pm)
๐ฆ MAGE::...osition(3pm) ๐ฆ
okay bestie, so this is the user-contributed Perl documentation for the man page Bio::MAGE::DesignElement::Position(3pm) โ yes the header is literally squished like that, no that's not a typo, that's just man pages being man pages ๐
โจ NAME โจ
Bio::MAGE::DesignElement::Position โ it's the class for the MAGE-OM API. that's it, that's the whole name section. iconic brevity ๐
๐ธ SYNOPSIS ๐ธ
here's the vibe, in code, exactly as written:
use Bio::MAGE::DesignElement::Position
# creating an empty instance
my $position = Bio::MAGE::DesignElement::Position->new();
# creating an instance with existing data
my $position = Bio::MAGE::DesignElement::Position->new(
x=>$x_val,
y=>$y_val,
propertySets=>\@namevaluetype_list,
distanceUnit=>$distanceunit_ref,
);
# 'x' attribute
my $x_val = $position->x(); # getter
$position->x($value); # setter
# 'y' attribute
my $y_val = $position->y(); # getter
$position->y($value); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $position->propertySets(); # getter
$position->propertySets(\@namevaluetype_list); # setter
# 'distanceUnit' association
my $distanceunit_ref = $position->distanceUnit(); # getter
$position->distanceUnit($distanceunit_ref); # setter
so like, you can make a blank one, or one that's already loaded with data. either way, slay ๐ซถ
๐ DESCRIPTION ๐
straight from the MAGE-OM documentation for the Position class, and I quote:
Specifies a position on an array.
that's the whole thing. it specifies a position. on an array. no notes, honestly. ๐ฏ
๐ INHERITANCE ๐
Bio::MAGE::DesignElement::Position has the following superclasses, and yes it's a whole family tree situation:
Bio::MAGE::Extendable
so it's got that Bio::MAGE::Extendable bloodline, iykyk ๐งฌ
๐ฅ CLASS METHODS ๐ฅ
the way these methods are all class methods โ meaning you can call every single one of them without ever making an instance first, just by going Bio::MAGE::DesignElement::Position->methodname(). no object required, main character energy, we love a class that's lowkey self-sufficient ๐
๐ new()
๐ new(%args)
the object constructor new() takes these optional named-value style arguments, so you can pass them like key => value and it just gets it:
xโ sets the value of thexattributeyโ sets the value of theyattributepropertySetsโ sets the value of thepropertySetsassociation. and bestie, heads up: this association was inherited from classBio::MAGE::Extendable. the value must be of type: array ofBio::MAGE::NameValueTypedistanceUnitโ sets the value of thedistanceUnitassociation. the value must be of type: instance ofBio::MAGE::Measurement::DistanceUnit
๐ง $obj = class->new(%parameters)
new() is the class constructor. the big one. the moment. โจ
- Parameters: if you hand it a list of name/value parameters, the corresponding slots, attributes, or associations get their initial values set by the constructor.
- Return value: it returns a reference to an object of the class. a whole new baby object ๐ฃ
- Side effects: it invokes the
initialize()method if it's defined by the class.
๐ @names = class->get_slot_names()
get_slot_names() retrieves the name of all slots defined in a given class.
NOTE: the list of names does not include attribute or association names. like, it's slots only. 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. zero. zilch. so chill. ๐ธ
โญ @name_list = get_attribute_names()
returns the list of attribute data members for this class. that's the whole gig ๐ซ
โญ @name_list = get_association_names()
returns the list of association data members for this class. bestie behaviour, honestly ๐ซถ
๐ @class_list = get_superclasses()
returns the list of superclasses for this class. the ancestors. the lineage. ๐
๐ @class_list = get_subclasses()
returns the list of subclasses for this class. the descendants, the little ones, the legacy ๐
๐ $name = class_name()
returns the full class name for this class. the whole government name, no nicknames ๐
๐ $package_name = package_name()
returns the base package name โ and by that I mean no namespace:: prefix โ of the package that contains this class. so like, the short version ๐
๐ฎ %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. a whole little lookup table of association lore, we love to see it ๐
more of this page is coming, bestie โ don't go anywhere ๐
โจ INSTANCE METHODS โจ
๐ซ $obj_copy = $obj->new()
okay so when you call new() on an existing object reference instead of a class name, it does double duty as a copy constructor ๐ซถ โ the new object's starting values get set to whatever the existing object has.
- Parameters: no input parameters are used in the copy constructor, bestie. the initial values are taken directly from the object you're copying. periodt.
- Return value: it hands you back a reference to an object of the class.
- Side effects: it invokes the
initialize()method if the class defines one.
๐ซ $obj->set_slots(%parameters) and $obj->set_slots(\@name_list, \@value_list)
set_slots() is the "set a bunch of slots at once" method, and it's lowkey versatile because it has two different invocation styles. the first one takes a named parameter list, the second takes two array references.
- Return value: none
- Side effects: it will call
croak()if you use aslot_namethat the class does not define ๐
๐ซ @obj_list = $obj->get_slots(@name_list)
get_slots() grabs the values of a bunch of slots all at the same time. very efficient of it โจ
- Return value: a list of instance objects
- Side effects: none
๐ซ $val = $obj->set_slot($name,$val)
set_slot() 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)
get_slot() 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
๐ ATTRIBUTES ๐
so attributes are these simple little 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 built out of separate setter and getter methods for each attribute โ one for each, no sharing, main character energy for every single one ๐
Bio::MAGE::DesignElement::Position has the following attribute accessor methods:
๐ธ x โ methods for the x attribute ๐ธ
straight from the MAGE-OM documentation:
The horizontal distance from the upper left corner of the array.
$val = $position->setX($val)โ the restricted setter method for thexattribute.- Input parameters: the value to which the
xattribute will be set - Return value: the current value of the
xattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
- Input parameters: the value to which the
$val = $position->getX()โ the restricted getter method for thexattribute.- Input parameters: none
- Return value: the current value of the
xattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
๐ธ y โ methods for the y attribute ๐ธ
also straight from the MAGE-OM documentation:
The vertical distance from the upper left corner of the array.
$val = $position->setY($val)โ the restricted setter method for theyattribute.- Input parameters: the value to which the
yattribute will be set - Return value: the current value of the
yattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
- Input parameters: the value to which the
$val = $position->getY()โ the restricted getter method for theyattribute.- Input parameters: none
- Return value: the current value of the
yattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
๐ฆ ASSOCIATIONS ๐ฆ
associations are references to other classes. and bestie, associations in MAGE-OM have a thing called cardinality, which decides the minimum and maximum number of instances of the 'other' class that may be included in the association:
- there must be exactly one item in the association, i.e. this is a mandatory data field.
0..1โ there may be one item in the association, i.e. this is an optional data field.1..Nโ there must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.0..Nโ there may be one or more items in the association, i.e. this is an optional data field, with list cardinality.
Bio::MAGE::DesignElement::Position has the following association accessor methods:
๐ propertySets โ methods for the propertySets association ๐
from the MAGE-OM documentation, no cap:
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 = $position->setPropertySets($array_ref)โ the restricted setter method for thepropertySetsassociation.- 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
- Input parameters: the value to which the
$array_ref = $position->getPropertySets()โ the restricted getter method for thepropertySetsassociation.- 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 = $position->addPropertySets(@vals)โ because thepropertySetsassociation has list cardinality, it may store more than one value. this method adds the current list of objects in thepropertySetsassociation.- 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
- Input parameters: the list of values
๐ distanceUnit โ methods for the distanceUnit association ๐
from the MAGE-OM documentation:
The units of the x, y positions.
$val = $position->setDistanceUnit($val)โ the restricted setter method for thedistanceUnitassociation.- Input parameters: the value to which the
distanceUnitassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
distanceUnitassociation : one of the accepted enumerated values. - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$valis not an instance of classBio::MAGE::Measurement::DistanceUnit
- Input parameters: the value to which the
$val = $position->getDistanceUnit()โ the restricted getter method for thedistanceUnitassociation.- Input parameters: none
- Return value: the current value of the
distanceUnitassociation : an instance of typeBio::MAGE::Measurement::DistanceUnit. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
sub initialize {
my $self = shift;
return 1;
}
๐ SLOTS, ATTRIBUTES, AND ASSOCIATIONS ๐
in the Perl implementation of MAGE-OM classes there are three types of class data members: slots, attributes, and associations. three flavours, one iconique little family ๐ซถ
โญ SLOTS โญ
this API uses the term "slot" to mean a data member of the class that wasn't present in the UML model and exists mainly for internal purposes โ so like, only touch this if you actually understand the inner workings of the API, bestie ๐. most of the time slots get used by generic methods, like the ones in the XML writing and reading classes.
slots are implemented with unified getter/setter methods:
$var = $obj->slot_name();โ retrieves 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.@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. none. zero. it simply does not check ๐
โญ ATTRIBUTES AND ASSOCIATIONS โญ
the terms "attribute" and "association" mean data members of the class that were specified directly from the UML model.
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.
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. - 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.
- 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*โ appends a list of objects to any values that may already be stored in the association.- NOTE: only present in associations with list cardinality.
- DATA CHECKING: ensure that all arguments are of the correct MAGE-OM class.
โญ GENERIC METHODS โญ
the unified base class of all MAGE-OM classes, Bio::MAGE::Base, provides a whole 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 on this page for a detailed description of these methods ๐
๐ BUGS ๐
okay bestie, found something cursed? ๐ don't suffer in silence, spill it to the project mailing list:
mged-mage 'at' lists 'dot' sf 'dot' net
that's the address, and yes you gotta de-obfuscate it yourself (swap the 'at' and 'dot' for the real symbols, you got this ๐
). tell them everything. they wanna know. ๐ซถ
๐ AUTHOR ๐
this whole thing was brought to you by:
- Jason E. Stewart โ
jasons 'at' cpan 'dot' org
living legend, honestly. main character energy fr fr. ๐โจ
๐ SEE ALSO ๐
that's it. that's the whole list. go read your perl manpage if you wanna understand the language underneath all this. iykyk ๐๐
๐จ POD ERRORS ๐จ
okay so ๐ the document above had some coding errors while it was being formatted, and they're all explained right here. not us being messy, just... the pod being messy. it's giving "we tried". here's the full receipts:
Around line 308: '=item' outside of any '=over'
Around line 393: You forgot a '=back' before '=head2'
Around line 565: Expected '=item 2'
Around line 570: Expected '=item 3'
Around line 575: Expected '=item 4'
so yeah, five little pod oopsies, all documented, nothing hidden. lowkey iconic that they told on themselves. ๐โจ
that's a wrap on the whole page bestie!! ๐ this one's from perl v5.32.0, dated 2020-11-27, filed under MAGE::...osition(3pm) in the User Contributed Perl Documentation. go forth and position your MAGE stuff with confidence. slay. periodt. ๐๐ฆ๐
๐ฆ 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