# -*- perl -*-
# DO NOT EDIT - This file is generated by UMMF; http://ummf.sourceforge.net 
# From template: $Id: PerlTemplate.txt,v 1.74 2004/08/01 03:50:07 kstephens Exp $

package UMMF::UML::MetaModel::Foundation::Core::Attribute;

#use 5.6.1;
use strict;
use warnings;

#################################################################
# Version
#

our $VERSION = do { my @r = (q{1.0} =~ /\d+/g); sprintf "%d." . "%03d" x $#r, @r };


#################################################################
# Documentation
#

=head1 NAME

UMMF::UML::MetaModel::Foundation::Core::Attribute -- 

=head1 VERSION

1.0

=head1 SYNOPSIS

=head1 DESCRIPTION 

=head1 USAGE

=head1 EXPORT

=head1 METATYPE

L<UMMF::UML::MetaModel::Foundation::Core::Class|UMMF::UML::MetaModel::Foundation::Core::Class>

=head1 SUPERCLASSES

L<UMMF::UML::MetaModel::Foundation::Core::StructuralFeature|UMMF::UML::MetaModel::Foundation::Core::StructuralFeature>




=head1 ATTRIBUTES


=head2 C<initialValue> : UMMF::UML::MetaModel::Foundation::Data_Types::Expression 


=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::Attribute|UMMF::UML::MetaModel::Foundation::Core::Attribute>

=item type = L<UMMF::UML::MetaModel::Foundation::Data_Types::Expression|UMMF::UML::MetaModel::Foundation::Data_Types::Expression>

=item visibility = C<private>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<unordered>

=item initialValue = I<UNSPECIFIED>

=item container_type = C<Set::Object>

=back



=head1 ASSOCIATIONS


=head2 C<0..*> : C<qualifier> E<lt>---E<gt>  C<associationEnd> : UMMF::UML::MetaModel::Foundation::Core::AssociationEnd C<0..1>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item multiplicity = C<0..1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<composite>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<0..*> : C<avaliableQualifier> E<lt>---E<gt>  C<associationEndRole> : UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole C<0..*>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<aggregate>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back


=head2 C<1> : C<attribute> E<lt>----  C<> : UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Attribute_Actions::AttributeAction C<0..*>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Attribute_Actions::AttributeAction|UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Attribute_Actions::AttributeAction>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<0>

=item aggregation = C<none>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back


=head2 C<1> : C<attribute> E<lt>---E<gt>  C<attributeLink> : UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink C<0..*>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back


=head2 C<1> : C<qualifier> E<lt>----  C<> : UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::ReadLinkObjectQualifierAction C<0..1>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::ReadLinkObjectQualifierAction|UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::ReadLinkObjectQualifierAction>

=item multiplicity = C<0..1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<0>

=item aggregation = C<none>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back


=head2 C<1> : C<qualifier> E<lt>----  C<> : UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue C<0..*>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML::MetaModel::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<0>

=item aggregation = C<none>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back


=head2 C<1> : C<referredAttribute> E<lt>----  C<> : UMMF::UML::MetaModel::OCL::Expressions::AttributeCallExp C<0..*>



=over 4

=item metatype = L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML::MetaModel::OCL::Expressions::AttributeCallExp|UMMF::UML::MetaModel::OCL::Expressions::AttributeCallExp>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<0>

=item aggregation = C<none>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back



=head1 METHODS

=cut



#################################################################
# Dependencies
#





use Carp qw(croak confess);
use Set::Object 1.05;
use Class::Multimethods 1.70;
use Data::Dumper;
use Scalar::Util qw(weaken);
use UMMF::UML::MetaModel::__ObjectBase qw(:__ummf_array);


#################################################################
# Generalizations
#

use base qw(
  UMMF::UML::MetaModel::Foundation::Core::StructuralFeature



);


#################################################################
# Exports
#

our @EXPORT_OK = qw(
);
our %EXPORT_TAGS = ( 'all' => \@EXPORT_OK );





#################################################################
# Validation
#


=head2 C<__validate_type>

  UMMF::UML::MetaModel::Foundation::Core::Attribute->__validate_type($value);

Returns true if C<$value> is a valid representation of L<UMMF::UML::MetaModel::Foundation::Core::Attribute|UMMF::UML::MetaModel::Foundation::Core::Attribute>.

=cut
sub __validate_type($$)
{
  my ($self, $x) = @_;

  no warnings;

  UNIVERSAL::isa($x, 'UMMF::UML::MetaModel::Foundation::Core::Attribute')  ;
}


=head2 C<__typecheck>

  UMMF::UML::MetaModel::Foundation::Core::Attribute->__typecheck($value, $msg);

Calls C<confess()> with C<$msg> if C<<UMMF::UML::MetaModel::Foundation::Core::Attribute->__validate_type($value)>> is false.

=cut
sub __typecheck
{
  my ($self, $x, $msg) = @_;

  confess("typecheck: $msg: type '" . 'UMMF::UML::MetaModel::Foundation::Core::Attribute' . ": value '$x'")
    unless __validate_type($self, $x);
}


=head2 C<isaAttribute>


Returns true if receiver is a L<UMMF::UML::MetaModel::Foundation::Core::Attribute|UMMF::UML::MetaModel::Foundation::Core::Attribute>.
Other receivers will return false.

=cut
sub isaAttribute { 1 }


=head2 C<isaFoundation__Core__Attribute>


Returns true if receiver is a L<UMMF::UML::MetaModel::Foundation::Core::Attribute|UMMF::UML::MetaModel::Foundation::Core::Attribute>.
Other receivers will return false.
This is the fully qualified version of the C<isaAttribute> method.

=cut
sub isaFoundation__Core__Attribute { 1 }


#################################################################
# Introspection
#

=head2 C<__model_name> 

  my $name = $obj_or_package->__model_name;

Returns the UML Model name (C<'Foundation::Core::Attribute'>) for an object or package of
this Classifier.

=cut
sub __model_name { 'Foundation::Core::Attribute' }



=head2 C<__isAbstract>

  $package->__isAbstract;

Returns C<0>.

=cut
sub __isAbstract { 0; }


my $__tangram_schema;
=head2 C<__tangram_schema>

  my $tangram_schema $obj_or_package->__tangram_schema

Returns a HASH ref that describes this Classifier for Tangram.

See L<UMMF::UML::Export::Perl::Tangram|UMMF::UML::Export::Perl::Tangram>

=cut
sub __tangram_schema
{
  my ($self) = @_;

  $__tangram_schema ||=
  {
   'classes' =>
   [
     'UMMF::UML::MetaModel::Foundation::Core::Attribute' =>
     {
       'table' => 'Foundation__Core__Attribute',
       'abstract' => 0,
       'slots' => 
       { 
	 # Attributes
	 	       'initialValue'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML::MetaModel::Foundation::Data_Types::Expression',

                                             'col' => 'initialValue', 

                                                                                                                   }
      ,
         
	 # Associations
	 	 	       'associationEnd'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML::MetaModel::Foundation::Core::AssociationEnd',

                  'null' => '1', 

                                    'col' => 'associationEnd', 

                                                                                                                   }
      ,
                  	 	       'associationEndRole'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole',

                           'table' => 'AssociationEndRole_AvaliableQualifier', 

                                                      'item' => 'associationEndRole', 

                  'coll' => 'avaliableQualifier',

                                                                               }
      ,
                  	 	                     	 	       'attributeLink'
       => {
	 'type_impl' => 'iset',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink',

                           'table' => 'Foundation__Core__Attribute__attributeLink', 

                                                               'coll' => 'attribute',

                                                                               }
      ,
                  	 	                     	 	                     	 	                            },
       'bases' => [  'UMMF::UML::MetaModel::Foundation::Core::StructuralFeature',  ],
       'sql' => {

       },
     },
   ],

   'sql' =>
   {
    # Note Tangram::Ref::get_exporter() has
    # "UPDATE $table SET $self->{col} = $refid WHERE id = $id",
    # The id_col is hard-coded, 
    # Thus id_col will not work.
    #'id_col' => '__sid',
    #'class_col' => '__stype',
   },
     # 'set_id' => sub { }
     # 'get_id' => sub { }

      
  };
}


#################################################################
# Class Attributes
#


      

#################################################################
# Class Associations
#


    

#################################################################
# Initialization
#


=head2 C<___initialize>

Initialize all Attributes and AssociationEnds in a instance of this Classifier.
Does B<not> initalize slots in its Generalizations.

See also: C<__initialize>.

=cut
sub ___initialize
{
  my ($self) = @_;

  # Attributes

    # Attribute initialValue
  if ( exists $self->{'initialValue'} ) {
    my $x = $self->{'initialValue'};
    $self->{'initialValue'} = undef;
    $self->set_initialValue($x);
  } else {
      }
  


  # Associations

  # AssociationEnd 
  #  qualifier 0..*
  #  <--> 
  #  associationEnd 0..1 UMMF::UML::MetaModel::Foundation::Core::AssociationEnd.
    if ( defined $self->{'associationEnd'} ) {
    my $x = $self->{'associationEnd'};
    $self->{'associationEnd'} = undef;
    $self->set_associationEnd($x);
  }
  
  # AssociationEnd 
  #  avaliableQualifier 0..*
  #  <--> 
  #  associationEndRole 0..* UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole.
    if ( defined $self->{'associationEndRole'} ) {
    my $x = $self->{'associationEndRole'};
        $self->{'associationEndRole'} = Set::Object->new();
        $self->set_associationEndRole(@$x);
  }
  
  # AssociationEnd 
  #  attribute 1
  #  <--> 
  #  attributeLink 0..* UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink.
    if ( defined $self->{'attributeLink'} ) {
    my $x = $self->{'attributeLink'};
        $self->{'attributeLink'} = Set::Object->new();
        $self->set_attributeLink(@$x);
  }
  

  $self;
}


my $__initialize_use;

=head2 C<__initialize>

Initialize all slots in this Classifier and all its Generalizations.

See also: C<___initialize>.

=cut
sub __initialize
{
  my ($self) = @_;

  # $DB::single = 1;

  unless ( ! $__initialize_use ) {
    $__initialize_use = 1;
    $self->__use('UMMF::UML::MetaModel::Foundation::Core::Element');
    $self->__use('UMMF::UML::MetaModel::Foundation::Core::ModelElement');
    $self->__use('UMMF::UML::MetaModel::Foundation::Core::Feature');
    $self->__use('UMMF::UML::MetaModel::Foundation::Core::StructuralFeature');
  }

  $self->UMMF::UML::MetaModel::Foundation::Core::Attribute::___initialize;
  $self->UMMF::UML::MetaModel::Foundation::Core::Element::___initialize;
  $self->UMMF::UML::MetaModel::Foundation::Core::ModelElement::___initialize;
  $self->UMMF::UML::MetaModel::Foundation::Core::Feature::___initialize;
  $self->UMMF::UML::MetaModel::Foundation::Core::StructuralFeature::___initialize;

  $self;
}
      

=head2 C<__create>

Calls all <<create>> Methods for this Classifier and all Generalizations.

See also: C<___create>.

=cut
sub __create
{
  my ($self, @args) = @_;

  # $DB::single = 1;
  $self->UMMF::UML::MetaModel::Foundation::Core::Attribute::___create(@args);
  $self->UMMF::UML::MetaModel::Foundation::Core::Element::___create();
  $self->UMMF::UML::MetaModel::Foundation::Core::ModelElement::___create();
  $self->UMMF::UML::MetaModel::Foundation::Core::Feature::___create();
  $self->UMMF::UML::MetaModel::Foundation::Core::StructuralFeature::___create();

  $self;
}




#################################################################
# Attributes
#



=for html <hr/>

=cut

#################################################################
# Attribute initialValue
# type = UMMF::UML::MetaModel::Foundation::Data_Types::Expression
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = 

=head2 C<initialValue>

  my $val = $obj->initialValue;

Returns the L<UMMF::UML::MetaModel::Foundation::Data_Types::Expression|UMMF::UML::MetaModel::Foundation::Data_Types::Expression> value of Attribute C<initialValue>.

=cut
sub initialValue ($)
{
  my ($self) = @_;

  ;

  my $val = $self->{'initialValue'};

  ;

  $val;
}


=head2 C<set_initialValue>

  $obj->set_initialValue($val);

Sets the value of Attribute C<initialValue>.
C<$val> must be of type L<UMMF::UML::MetaModel::Foundation::Data_Types::Expression|UMMF::UML::MetaModel::Foundation::Data_Types::Expression> or C<undef>.
Returns C<$obj>.

=cut
sub set_initialValue ($$)
{
  my ($self, $val) = @_;

  ;

  if ( defined $val ) {
    $self->__use('UMMF::UML::MetaModel::Foundation::Data_Types::Expression')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.initialValue");
  }

    $self->{'initialValue'} = $val
  ;

  ;

  $self;
}


=head2 C<count_initialValue>

  $obj->count_initialValue;

Returns the number of elements (0 or 1) in C<initialValue>.

=cut
sub count_initialValue ($)
{
  my ($self) = @_;

  ;

  my $val = $self->{'initialValue'};

  ;

  defined $val ? 1 : 0;
}




#################################################################
# Association
#


=for html <hr/>

=cut

#################################################################
# AssociationEnd qualifier <---> associationEnd
# type = UMMF::UML::MetaModel::Foundation::Core::AssociationEnd
# multiplicity = 0..1
# ordering = 

=head2 C<associationEnd>

  my $val = $obj->associationEnd;

Returns the AssociationEnd C<associationEnd> value of type L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>.

=cut
sub associationEnd ($)
{
  my ($self) = @_;
		  
  $self->{'associationEnd'};
}


=head2 C<set_associationEnd>

  $obj->set_associationEnd($val);

Sets the AssociationEnd C<associationEnd> value.
C<$val> must of type L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>.
Returns C<$obj>.

=cut
sub set_associationEnd ($$)
{
  my ($self, $val) = @_;
		  
  no warnings; # Use of uninitialized value in string ne at ...
		  
  my $old;
  if ( ($old = $self->{'associationEnd'}) ne $val ) { # Recursion lock

    if ( defined $val ) { $self->__use('UMMF::UML::MetaModel::Foundation::Core::AssociationEnd')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.associationEnd") }

    # Recursion lock
        $self->{'associationEnd'} = $val
    ;

    # Remove and add associations with other ends.
        
    $old->remove_qualifier($self) if $old;
    $val->add_qualifier($self)    if $val;

    }
		  
  $self;
}


=head2 C<add_associationEnd>

  $obj->add_associationEnd($val);

Adds the AssociationEnd C<associationEnd> value.
C<$val> must of type L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>.
Throws exception if a value already exists.
Returns C<$obj>.

=cut
sub add_associationEnd ($$)
{
  my ($self, $val) = @_;

  no warnings; # Use of uninitialized value in string ne at ...

  my $old;
  if ( ($old = $self->{'associationEnd'}) ne $val ) { # Recursion lock
    $self->__use('UMMF::UML::MetaModel::Foundation::Core::AssociationEnd')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.associationEnd");
      
    # confess("UMMF::UML::MetaModel::Foundation::Core::Attribute::associationEnd: too many")
    # if defined $self->{'associationEnd'};

    # Recursion lock
        $self->{'associationEnd'} = $val
    ;

    # Remove and add associations with other ends.
        
    $old->remove_qualifier($self) if $old;
    $val->add_qualifier($self)    if $val;

  
  }

  $self;
}


=head2 C<remove_associationEnd>

  $obj->remove_associationEnd($val);

Removes the AssociationEnd C<associationEnd> value C<$val>.
Returns C<$obj>.

=cut
sub remove_associationEnd ($$)
{
  my ($self, $val) = @_;

  no warnings; # Use of uninitialized value in string ne at ...

  my $old;
  if ( ($old = $self->{'associationEnd'}) eq $val ) { # Recursion lock
    $val = $self->{'associationEnd'} = undef;         # Recursion lock

    # Remove and add associations with other ends.
        
    $old->remove_qualifier($self) if $old;
    $val->add_qualifier($self)    if $val;

  
  }
}


=head2 C<clear_associationEnd>

  $obj->clear_associationEnd;

Clears the AssociationEnd C<associationEnd> links to L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd>.
Returns C<$obj>.

=cut
sub clear_associationEnd ($@)
{
  my ($self) = @_;

  my $old;
  if ( defined ($old = $self->{'associationEnd'}) ) { # Recursion lock
    my $val = $self->{'associationEnd'} = undef;      # Recursion lock

    # Remove and add associations with other ends.
        
    $old->remove_qualifier($self) if $old;
    $val->add_qualifier($self)    if $val;

    }

  $self;
}


=head2 C<count_associationEnd>

  $obj->count_associationEnd;

Returns the number of elements of type L<UMMF::UML::MetaModel::Foundation::Core::AssociationEnd|UMMF::UML::MetaModel::Foundation::Core::AssociationEnd> associated with C<associationEnd>.

=cut
sub count_associationEnd ($)
{
  my ($self) = @_;

  my $x = $self->{'associationEnd'};

  defined $x ? 1 : 0;
}




=for html <hr/>

=cut

#################################################################
# AssociationEnd avaliableQualifier <---> associationEndRole
# type = UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole
# multiplicity = 0..*
# ordering = 

=head2 C<associationEndRole>

  my @val = $obj->associationEndRole;
  my $ary_val = $obj->associationEndRole;

Returns the AssociationEnd C<associationEndRole> values of type L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole>.
In array context, returns all the objects in the Association.
In scalar context, returns an array ref of all the objects in the Association.

=cut
sub associationEndRole ($)
{
  my ($self) = @_;

    my $x = $self->{'associationEndRole'};

  # confess("Container for associationEndRole $x is not a blessed ref: " . Data::Dumper->new([ $self ], [qw($self)])->Maxdepth(2)->Dump()) if $x && ref($x) !~ /::/;
 
  wantarray ? ($x ? $x->members() : ()) : [ $x ? $x->members() : () ];
  
}


=head2 C<set_associationEndRole>

  $obj->set_associationEndRole(@val);

Sets the AssociationEnd C<associationEndRole> value.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole>.
Returns C<$obj>.

=cut
sub set_associationEndRole ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_associationEndRole;
  $self->add_associationEndRole(@val);
}


=head2 C<add_associationEndRole>

  $obj->add_associationEndRole(@val);

Adds AssociationEnd C<associationEndRole> values.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole>.
Returns C<$obj>.

=cut
sub add_associationEndRole ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'associationEndRole'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.associationEndRole");

    # Recursion lock
        $x->insert($val);
    # weaken?
    
    # Remove and add associations with other ends.
        
    $old->remove_avaliableQualifier($self) if $old;
    $val->add_avaliableQualifier($self)    if $val;

    }
  
  $self;
}


=head2 C<remove_associationEndRole>

  $obj->remove_associationEndRole(@val);

Removes the AssociationEnd C<associationEndRole> values C<@val>.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole>.
Returns C<$obj>.

=cut
sub remove_associationEndRole ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'associationEndRole'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.associationEndRole");

    # Recursion lock
        $x->remove($old);
    
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_avaliableQualifier($self) if $old;
    $val->add_avaliableQualifier($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_associationEndRole>

  $obj->clear_associationEndRole;

Clears the AssociationEnd C<associationEndRole> links to L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::AssociationEndRole>.
Returns C<$obj>.

=cut
sub clear_associationEndRole ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'associationEndRole'} ||= Set::Object->new();
  
  my $val; # Place holder for other MACRO.
  
    $self->{'associationEndRole'} = Set::Object->new(); # Recursion lock
  for my $old ( $x->members() ) {     # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_avaliableQualifier($self) if $old;
    $val->add_avaliableQualifier($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_associationEndRole>

  $obj->count_associationEndRole;

Returns the number of elements associated with C<associationEndRole>.

=cut
sub count_associationEndRole ($)
{
  my ($self) = @_;

  my $x = $self->{'associationEndRole'};

    defined $x ? $x->size : 0;
  }




=for html <hr/>

=cut

#################################################################
# AssociationEnd attribute <---> attributeLink
# type = UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink
# multiplicity = 0..*
# ordering = 

=head2 C<attributeLink>

  my @val = $obj->attributeLink;
  my $ary_val = $obj->attributeLink;

Returns the AssociationEnd C<attributeLink> values of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink>.
In array context, returns all the objects in the Association.
In scalar context, returns an array ref of all the objects in the Association.

=cut
sub attributeLink ($)
{
  my ($self) = @_;

    my $x = $self->{'attributeLink'};

  # confess("Container for attributeLink $x is not a blessed ref: " . Data::Dumper->new([ $self ], [qw($self)])->Maxdepth(2)->Dump()) if $x && ref($x) !~ /::/;
 
  wantarray ? ($x ? $x->members() : ()) : [ $x ? $x->members() : () ];
  
}


=head2 C<set_attributeLink>

  $obj->set_attributeLink(@val);

Sets the AssociationEnd C<attributeLink> value.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink>.
Returns C<$obj>.

=cut
sub set_attributeLink ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_attributeLink;
  $self->add_attributeLink(@val);
}


=head2 C<add_attributeLink>

  $obj->add_attributeLink(@val);

Adds AssociationEnd C<attributeLink> values.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink>.
Returns C<$obj>.

=cut
sub add_attributeLink ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'attributeLink'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.attributeLink");

    # Recursion lock
        $x->insert($val);
    # weaken?
    
    # Remove and add associations with other ends.
        
    $old->remove_attribute($self) if $old;
    $val->add_attribute($self)    if $val;

    }
  
  $self;
}


=head2 C<remove_attributeLink>

  $obj->remove_attributeLink(@val);

Removes the AssociationEnd C<attributeLink> values C<@val>.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink>.
Returns C<$obj>.

=cut
sub remove_attributeLink ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'attributeLink'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink')->__typecheck($val, "UMMF::UML::MetaModel::Foundation::Core::Attribute.attributeLink");

    # Recursion lock
        $x->remove($old);
    
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_attribute($self) if $old;
    $val->add_attribute($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_attributeLink>

  $obj->clear_attributeLink;

Clears the AssociationEnd C<attributeLink> links to L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::AttributeLink>.
Returns C<$obj>.

=cut
sub clear_attributeLink ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'attributeLink'} ||= Set::Object->new();
  
  my $val; # Place holder for other MACRO.
  
    $self->{'attributeLink'} = Set::Object->new(); # Recursion lock
  for my $old ( $x->members() ) {     # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_attribute($self) if $old;
    $val->add_attribute($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_attributeLink>

  $obj->count_attributeLink;

Returns the number of elements associated with C<attributeLink>.

=cut
sub count_attributeLink ($)
{
  my ($self) = @_;

  my $x = $self->{'attributeLink'};

    defined $x ? $x->size : 0;
  }







# End of Class Attribute


=pod

=for html <hr/>

I<END OF DOCUMENT>

=cut

############################################################################

1; # is true!

############################################################################

### Keep these comments at end of file: kstephens@users.sourceforge.net 2003/04/06 ###
### Local Variables: ###
### mode:perl ###
### perl-indent-level:2 ###
### perl-continued-statement-offset:0 ###
### perl-brace-offset:0 ###
### perl-label-offset:0 ###
### End: ###

