Bio-MAGE

 view release on metacpan or  search on metacpan

MAGE/Measurement/ConcentrationUnit.pm  view on Meta::CPAN

##############################
#
# Bio::MAGE::Measurement::ConcentrationUnit
#
##############################
# C O P Y R I G H T   N O T I C E
#  Copyright (c) 2001-2006 by:
#    * The MicroArray Gene Expression Database Society (MGED)
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.



package Bio::MAGE::Measurement::ConcentrationUnit;
use strict;
use Carp;

use base qw(Bio::MAGE::Measurement::Unit);

use Bio::MAGE::Association;

use vars qw($__ASSOCIATIONS
	    $__CLASS_NAME
	    $__PACKAGE_NAME
	    $__SUBCLASSES
	    $__SUPERCLASSES
	    $__ATTRIBUTE_NAMES
	    $__ASSOCIATION_NAMES
	   );

use constant UNITNAMECV_ML_PER_L => 'mL_per_L';
use constant UNITNAMECV_MM => 'mM';
use constant UNITNAMECV_G_PER_L => 'g_per_L';
use constant UNITNAMECV_FM => 'fM';
use constant UNITNAMECV_PM => 'pM';
use constant UNITNAMECV_MG_PER_ML => 'mg_per_mL';
use constant UNITNAMECV_OTHER => 'other';
use constant UNITNAMECV_UM => 'uM';
use constant UNITNAMECV_M => 'M';
use constant UNITNAMECV_MASS_PER_VOLUME_PERCENT => 'mass_per_volume_percent';
use constant UNITNAMECV_GRAM_PERCENT => 'gram_percent';
use constant UNITNAMECV_MASS_PER_MASS_PERCENT => 'mass_per_mass_percent';
use constant UNITNAMECV_NM => 'nM';

=head1 NAME

Bio::MAGE::Measurement::ConcentrationUnit - Class for the MAGE-OM API

=head1 SYNOPSIS

  use Bio::MAGE::Measurement::ConcentrationUnit

  # creating an empty instance
  my $concentrationunit = Bio::MAGE::Measurement::ConcentrationUnit->new();

  # creating an instance with existing data
  my $concentrationunit = Bio::MAGE::Measurement::ConcentrationUnit->new(
        unitNameCV=>$unitnamecv_val,
        unitName=>$unitname_val,
        propertySets=>\@namevaluetype_list,
  );


  # 'unitNameCV' attribute
  my $unitNameCV_val = $concentrationunit->unitNameCV(); # getter
  $concentrationunit->unitNameCV($value); # setter

  # 'unitName' attribute
  my $unitName_val = $concentrationunit->unitName(); # getter
  $concentrationunit->unitName($value); # setter


  # 'propertySets' association
  my $namevaluetype_array_ref = $concentrationunit->propertySets(); # getter
  $concentrationunit->propertySets(\@namevaluetype_list); # setter



=head1 DESCRIPTION

From the MAGE-OM documentation for the C<ConcentrationUnit> class:

Concentration



=cut

=head1 INHERITANCE


Bio::MAGE::Measurement::ConcentrationUnit has the following superclasses:

=over


=item * Bio::MAGE::Measurement::Unit


=back


MAGE/Measurement/ConcentrationUnit.pm  view on Meta::CPAN

=item $val = $obj->set_slot($name,$val)

The C<set_slot()> method sets the slot C<$name> to the value C<$val>

B<Return value>: the new value of the slot, i.e. C<$val>

B<Side effects>: none

=cut

#
# code for set_slot() inherited from Base.pm
#

=item $val = $obj->get_slot($name)

The C<get_slot()> method is used to get the values of a number of
slots at the same time.

B<Return value>: a single slot value, or undef if the slot has not been
initialized.

B<Side effects>: none

=cut

#
# code for get_slot() inherited from Base.pm
#


=head2 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.

C<Bio::MAGE::Measurement::ConcentrationUnit> has the following attribute accessor methods:

=over


=item unitNameCV

Methods for the C<unitNameCV> attribute.


From the MAGE-OM documentation:




=over


=item $val = $concentrationunit->setUnitNameCV($val)

The restricted setter method for the C<unitNameCV> attribute.

C<unitNameCV> is an B<enumerated> attribute - it can only be set to C<undef> or one of the following values: M mM uM nM pM fM mg_per_mL mL_per_L g_per_L gram_percent mass_per_volume_percent  mass_per_mass_percent other


Input parameters: the value to which the C<unitNameCV> attribute will be set 

Return value: the current value of the C<unitNameCV> attribute 

Side effects: none

Exceptions: will call C<croak()> if no input parameters are specified, or
if too many input parameters are specified, or if C<$val> is not one of the accepted enumeration values: M mM uM nM pM fM mg_per_mL mL_per_L g_per_L gram_percent mass_per_volume_percent  mass_per_mass_percent other

=cut


sub setUnitNameCV {
  my $self = shift;
  croak(__PACKAGE__ . "::setUnitNameCV: no arguments passed to setter")
    unless @_;
  croak(__PACKAGE__ . "::setUnitNameCV: too many arguments passed to setter")
    if @_ > 1;
  my $val = shift;
    croak(__PACKAGE__ . "::setUnitNameCV: expected one of enum values : M mM uM nM pM fM mg_per_mL mL_per_L g_per_L gram_percent mass_per_volume_percent  mass_per_mass_percent other, got $val")
    unless (not defined $val) or (grep {$val eq $_} qw(M mM uM nM pM fM mg_per_mL mL_per_L g_per_L gram_percent mass_per_volume_percent  mass_per_mass_percent other));

  return $self->{__UNITNAMECV} = $val;
}


=item $val = $concentrationunit->getUnitNameCV()

The restricted getter method for the C<unitNameCV> attribute.

Input parameters: none

Return value: the current value of the C<unitNameCV> attribute : an instance of type C<M mM uM nM pM fM mg_per_mL mL_per_L g_per_L gram_percent mass_per_volume_percent  mass_per_mass_percent other>.

Side effects: none

Exceptions: will call C<croak()> if any input parameters are specified

=cut


sub getUnitNameCV {
  my $self = shift;
  croak(__PACKAGE__ . "::getUnitNameCV: arguments passed to getter")
    if @_;
  my $val = shift;
  return $self->{__UNITNAMECV};
}





=back


=item unitName

Methods for the C<unitName> attribute.


From the MAGE-OM documentation:

The name of the unit.


=over


=item $val = $concentrationunit->setUnitName($val)

The restricted setter method for the C<unitName> attribute.


Input parameters: the value to which the C<unitName> attribute will be set 

Return value: the current value of the C<unitName> attribute 

Side effects: none

Exceptions: will call C<croak()> if no input parameters are specified, or
if too many input parameters are specified

=cut


sub setUnitName {
  my $self = shift;
  croak(__PACKAGE__ . "::setUnitName: no arguments passed to setter")
    unless @_;
  croak(__PACKAGE__ . "::setUnitName: too many arguments passed to setter")
    if @_ > 1;
  my $val = shift;



( run in 0.803 second using v1.01-cache-2.11-cpan-39bf76dae61 )