# -*- perl -*-
# DO NOT EDIT - This file is generated by UML2CODE.
# From template: $Id: PerlTemplate.txt,v 1.12 2003/05/11 06:16:02 stephens Exp $

package UML::MetaModel::Foundation::Core::ModelElement;

use 5.6.1;
use strict;
use warnings;

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

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

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



use Carp qw(croak confess);

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

use base qw(
  UML::MetaModel::Foundation::Core::Element


);

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

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





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


=head2 __validate_type

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

Returns true if $value is a valid value of UML::MetaModel::Foundation::Core::ModelElement.

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

  no warnings;

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


=head2 __typecheck

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

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

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

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


=head2 isaModelElement

Returns true if receiver is a C<UML::MetaModel::Foundation::Core::ModelElement>.
Other receivers will return false.

=cut
sub isaModelElement { 1 }


=head2 isaFoundation__Core__ModelElement

Returns true if receiver is a C<UML::MetaModel::Foundation::Core::ModelElement>.
Other receivers will return false.
This is the fully qualified version of the C<isaModelElement> method.

=cut
sub isaFoundation__Core__ModelElement { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

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




  


  


  



# ASSOC: ownedElement

  

# ASSOC: constrainedElement

  

# ASSOC: source

  

# ASSOC: target

  

# ASSOC: supplier

  

# ASSOC: client

  

# ASSOC: resident

  

# ASSOC: defaultElement
# ASSOC: templateParameter

  

# ASSOC: template

  

# ASSOC: modelElement
# ASSOC: subject

  

# ASSOC: annotatedElement
# ASSOC: extendedElement

  

# ASSOC: 

  

# ASSOC: referenceValue

  

# ASSOC: importedElement
# ASSOC: constrainingElement
# ASSOC: constrainingElement
# ASSOC: context

  

# ASSOC: contents
# ASSOC: ownedElement
# ASSOC: templateParameter
# ASSOC: template
# ASSOC: importedElement

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


          

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

 
=head2 __intialize

Initialize all slots in this Classifier.
Does not initlaize slots in Generalizations.

See also: C<_initialize>.

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

  # Attributes

    # Attribute name
  if ( exists $self->{'name'} ) {
    my $x = $self->{'name'};
    $self->{'name'} = undef;
    $self->set_name($x);
  } else {
      }
  
    # Attribute visibility
  if ( exists $self->{'visibility'} ) {
    my $x = $self->{'visibility'};
    $self->{'visibility'} = undef;
    $self->set_visibility($x);
  } else {
      }
  
    # Attribute isSpecification
  if ( exists $self->{'isSpecification'} ) {
    my $x = $self->{'isSpecification'};
    $self->{'isSpecification'} = undef;
    $self->set_isSpecification($x);
  } else {
      }
  


  # Associations

  # AssociationEnd 
  #  ownedElement 0..*
  #  <--> 
  #  namespace 0..1 UML::MetaModel::Foundation::Core::Namespace.
    if ( defined $self->{'namespace'} ) {
    my $x = $self->{'namespace'};
    $self->{'namespace'} = undef;
    $self->set_namespace($x);
  }
  
  # AssociationEnd 
  #  constrainedElement 0..1
  #  <--> 
  #  constraint 0..* UML::MetaModel::Foundation::Core::Constraint.
    if ( defined $self->{'constraint'} && @{$self->{'constraint'}} ) {
    my $x = $self->{'constraint'};
    $self->{'constraint'} = [ ];
    $self->set_constraint(@$x);
  }
  
  # AssociationEnd 
  #  source 0..*
  #  <--> 
  #  sourceFlow 0..* UML::MetaModel::Foundation::Core::Flow.
    if ( defined $self->{'sourceFlow'} && @{$self->{'sourceFlow'}} ) {
    my $x = $self->{'sourceFlow'};
    $self->{'sourceFlow'} = [ ];
    $self->set_sourceFlow(@$x);
  }
  
  # AssociationEnd 
  #  target 0..*
  #  <--> 
  #  targetFlow 0..* UML::MetaModel::Foundation::Core::Flow.
    if ( defined $self->{'targetFlow'} && @{$self->{'targetFlow'}} ) {
    my $x = $self->{'targetFlow'};
    $self->{'targetFlow'} = [ ];
    $self->set_targetFlow(@$x);
  }
  
  # AssociationEnd 
  #  supplier 1..*
  #  <--> 
  #  supplierDependency 0..* UML::MetaModel::Foundation::Core::Dependency.
    if ( defined $self->{'supplierDependency'} && @{$self->{'supplierDependency'}} ) {
    my $x = $self->{'supplierDependency'};
    $self->{'supplierDependency'} = [ ];
    $self->set_supplierDependency(@$x);
  }
  
  # AssociationEnd 
  #  client 1..*
  #  <--> 
  #  clientDependency 0..* UML::MetaModel::Foundation::Core::Dependency.
    if ( defined $self->{'clientDependency'} && @{$self->{'clientDependency'}} ) {
    my $x = $self->{'clientDependency'};
    $self->{'clientDependency'} = [ ];
    $self->set_clientDependency(@$x);
  }
  
  # AssociationEnd 
  #  resident 0..*
  #  <--> 
  #  container_ModelElement 0..* UML::MetaModel::Foundation::Core::Component.
    if ( defined $self->{'container_ModelElement'} && @{$self->{'container_ModelElement'}} ) {
    my $x = $self->{'container_ModelElement'};
    $self->{'container_ModelElement'} = [ ];
    $self->set_container_ModelElement(@$x);
  }
  
  # AssociationEnd 
  #  templateParameter 0..*
  #  <--> 
  #  template 0..1 UML::MetaModel::Foundation::Core::ModelElement.
    if ( defined $self->{'template'} ) {
    my $x = $self->{'template'};
    $self->{'template'} = undef;
    $self->set_template($x);
  }
  
  # AssociationEnd 
  #  template 0..1
  #  <--> 
  #  templateParameter 0..* UML::MetaModel::Foundation::Core::ModelElement.
    if ( defined $self->{'templateParameter'} && @{$self->{'templateParameter'}} ) {
    my $x = $self->{'templateParameter'};
    $self->{'templateParameter'} = [ ];
    $self->set_templateParameter(@$x);
  }
  
  # AssociationEnd 
  #  subject 0..*
  #  <--> 
  #  presentation 0..* UML::MetaModel::Foundation::Core::PresentationElement.
    if ( defined $self->{'presentation'} && @{$self->{'presentation'}} ) {
    my $x = $self->{'presentation'};
    $self->{'presentation'} = [ ];
    $self->set_presentation(@$x);
  }
  
  # AssociationEnd 
  #  extendedElement 0..*
  #  <--> 
  #  stereotype 0..* UML::MetaModel::Foundation::Extension_Mechanisms::Stereotype.
    if ( defined $self->{'stereotype'} && @{$self->{'stereotype'}} ) {
    my $x = $self->{'stereotype'};
    $self->{'stereotype'} = [ ];
    $self->set_stereotype(@$x);
  }
  
  # AssociationEnd 
  #   1
  #  <--> 
  #  taggedValue 0..* UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue.
    if ( defined $self->{'taggedValue'} && @{$self->{'taggedValue'}} ) {
    my $x = $self->{'taggedValue'};
    $self->{'taggedValue'} = [ ];
    $self->set_taggedValue(@$x);
  }
  
  # AssociationEnd 
  #  referenceValue 0..*
  #  <--> 
  #  referenceTag 0..* UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue.
    if ( defined $self->{'referenceTag'} && @{$self->{'referenceTag'}} ) {
    my $x = $self->{'referenceTag'};
    $self->{'referenceTag'} = [ ];
    $self->set_referenceTag(@$x);
  }
  
  # AssociationEnd 
  #  context 0..1
  #  <--> 
  #  behavior 0..* UML::MetaModel::Behavioral_Elements::State_Machines::StateMachine.
    if ( defined $self->{'behavior'} && @{$self->{'behavior'}} ) {
    my $x = $self->{'behavior'};
    $self->{'behavior'} = [ ];
    $self->set_behavior(@$x);
  }
  

  $self;
}


my $__initialize_use;

=head2 _intialize

Initialize all slots in this Classifier and all Generalizations.

See also: C<__initialize>.

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

  # $DB::single = 1;

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

  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;

  $self;
}
      

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



#################################################################
# Attribute name
# type = UML::MetaModel::Foundation::Data_Types::Name
# multiplicity = 1

=head2 name

  my $val = $obj->name;

Returns the value of Attribute name.

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

  $self->{'name'};
}


=head2 set_name

  $obj->set_name($val);

Sets the value of Attribute name.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::Name>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Name')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.name");

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

  $self
}

#################################################################
# Attribute visibility
# type = UML::MetaModel::Foundation::Data_Types::VisibilityKind
# multiplicity = 1

=head2 visibility

  my $val = $obj->visibility;

Returns the value of Attribute visibility.

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

  $self->{'visibility'};
}


=head2 set_visibility

  $obj->set_visibility($val);

Sets the value of Attribute visibility.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::VisibilityKind>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::VisibilityKind')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.visibility");

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

  $self
}

#################################################################
# Attribute isSpecification
# type = UML::MetaModel::Foundation::Data_Types::Boolean
# multiplicity = 1

=head2 isSpecification

  my $val = $obj->isSpecification;

Returns the value of Attribute isSpecification.

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

  $self->{'isSpecification'};
}


=head2 set_isSpecification

  $obj->set_isSpecification($val);

Sets the value of Attribute isSpecification.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::Boolean>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Boolean')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.isSpecification");

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

  $self
}


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


#################################################################
# AssociationEnd ownedElement => namespace
# type = UML::MetaModel::Foundation::Core::Namespace
# multiplicity = 0..1

=head2 namespace

  my $val = $obj->namespace;

Returns the AssociationEnd value of type C<UML::MetaModel::Foundation::Core::Namespace>.

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


=head2 set_namespace

  $obj->set_namespace($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::Namespace')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.namespace");

    $self->{'namespace'} = $val;                 # Recursion lock
    # Remove and add associations with other ends.
        
    $old->remove_ownedElement($self) if $old;
    $val->add_ownedElement($self)    if $val;

    }
		  
  $self;
}


=head2 add_namespace

  $obj->add_namespace($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_namespace

  $obj->remove_namespace($val);

Removes the Association to C<$val>.
Returns C<$obj>.

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

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

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

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

  
  }
}


=head2 clear_namespace

  $obj->clear_namespace;

Clears the Association.
Returns C<$obj>.

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

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

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

  
  }

  $self;
}




#################################################################
# AssociationEnd constrainedElement => constraint
# type = UML::MetaModel::Foundation::Core::Constraint
# multiplicity = 0..*

=head2 constraint

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

Returns the AssociationEnd value.
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 constraint ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'constraint'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_constraint

  $obj->set_constraint(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Constraint>.
Returns C<$obj>.

=cut
sub set_constraint ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_constraint;
  $self->add_constraint(@val);
}


=head2 add_constraint

  $obj->add_constraint(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Constraint>.
Returns C<$obj>.

=cut
sub add_constraint ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'constraint'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::Constraint')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.constraint");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_constraint

  $obj->remove_constraint($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_constraint ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'constraint'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::Constraint')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.constraint");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_constrainedElement($self) if $old;
    $val->add_constrainedElement($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_constraint

  $obj->clear_constraint;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_constraint ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'constraint'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'constraint'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_constrainedElement($self) if $old;
    $val->add_constrainedElement($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd source => sourceFlow
# type = UML::MetaModel::Foundation::Core::Flow
# multiplicity = 0..*

=head2 sourceFlow

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

Returns the AssociationEnd value.
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 sourceFlow ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'sourceFlow'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_sourceFlow

  $obj->set_sourceFlow(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Flow>.
Returns C<$obj>.

=cut
sub set_sourceFlow ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_sourceFlow;
  $self->add_sourceFlow(@val);
}


=head2 add_sourceFlow

  $obj->add_sourceFlow(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Flow>.
Returns C<$obj>.

=cut
sub add_sourceFlow ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'sourceFlow'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::Flow')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.sourceFlow");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_sourceFlow

  $obj->remove_sourceFlow($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_sourceFlow ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'sourceFlow'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::Flow')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.sourceFlow");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_source($self) if $old;
    $val->add_source($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_sourceFlow

  $obj->clear_sourceFlow;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_sourceFlow ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'sourceFlow'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'sourceFlow'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_source($self) if $old;
    $val->add_source($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd target => targetFlow
# type = UML::MetaModel::Foundation::Core::Flow
# multiplicity = 0..*

=head2 targetFlow

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

Returns the AssociationEnd value.
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 targetFlow ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'targetFlow'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_targetFlow

  $obj->set_targetFlow(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Flow>.
Returns C<$obj>.

=cut
sub set_targetFlow ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_targetFlow;
  $self->add_targetFlow(@val);
}


=head2 add_targetFlow

  $obj->add_targetFlow(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Flow>.
Returns C<$obj>.

=cut
sub add_targetFlow ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'targetFlow'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::Flow')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.targetFlow");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_targetFlow

  $obj->remove_targetFlow($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_targetFlow ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'targetFlow'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::Flow')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.targetFlow");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_target($self) if $old;
    $val->add_target($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_targetFlow

  $obj->clear_targetFlow;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_targetFlow ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'targetFlow'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'targetFlow'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_target($self) if $old;
    $val->add_target($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd supplier => supplierDependency
# type = UML::MetaModel::Foundation::Core::Dependency
# multiplicity = 0..*

=head2 supplierDependency

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

Returns the AssociationEnd value.
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 supplierDependency ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'supplierDependency'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_supplierDependency

  $obj->set_supplierDependency(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Dependency>.
Returns C<$obj>.

=cut
sub set_supplierDependency ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_supplierDependency;
  $self->add_supplierDependency(@val);
}


=head2 add_supplierDependency

  $obj->add_supplierDependency(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Dependency>.
Returns C<$obj>.

=cut
sub add_supplierDependency ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'supplierDependency'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::Dependency')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.supplierDependency");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_supplierDependency

  $obj->remove_supplierDependency($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_supplierDependency ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'supplierDependency'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::Dependency')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.supplierDependency");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_supplier($self) if $old;
    $val->add_supplier($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_supplierDependency

  $obj->clear_supplierDependency;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_supplierDependency ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'supplierDependency'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'supplierDependency'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_supplier($self) if $old;
    $val->add_supplier($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd client => clientDependency
# type = UML::MetaModel::Foundation::Core::Dependency
# multiplicity = 0..*

=head2 clientDependency

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

Returns the AssociationEnd value.
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 clientDependency ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'clientDependency'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_clientDependency

  $obj->set_clientDependency(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Dependency>.
Returns C<$obj>.

=cut
sub set_clientDependency ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_clientDependency;
  $self->add_clientDependency(@val);
}


=head2 add_clientDependency

  $obj->add_clientDependency(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Dependency>.
Returns C<$obj>.

=cut
sub add_clientDependency ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'clientDependency'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::Dependency')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.clientDependency");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_clientDependency

  $obj->remove_clientDependency($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_clientDependency ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'clientDependency'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::Dependency')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.clientDependency");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_client($self) if $old;
    $val->add_client($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_clientDependency

  $obj->clear_clientDependency;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_clientDependency ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'clientDependency'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'clientDependency'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_client($self) if $old;
    $val->add_client($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd resident => container_ModelElement
# type = UML::MetaModel::Foundation::Core::Component
# multiplicity = 0..*

=head2 container_ModelElement

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

Returns the AssociationEnd value.
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 container_ModelElement ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'container_ModelElement'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_container_ModelElement

  $obj->set_container_ModelElement(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Component>.
Returns C<$obj>.

=cut
sub set_container_ModelElement ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_container_ModelElement;
  $self->add_container_ModelElement(@val);
}


=head2 add_container_ModelElement

  $obj->add_container_ModelElement(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::Component>.
Returns C<$obj>.

=cut
sub add_container_ModelElement ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'container_ModelElement'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::Component')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.container_ModelElement");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_container_ModelElement

  $obj->remove_container_ModelElement($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_container_ModelElement ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'container_ModelElement'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::Component')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.container_ModelElement");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_resident($self) if $old;
    $val->add_resident($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_container_ModelElement

  $obj->clear_container_ModelElement;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_container_ModelElement ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'container_ModelElement'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'container_ModelElement'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_resident($self) if $old;
    $val->add_resident($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd templateParameter => template
# type = UML::MetaModel::Foundation::Core::ModelElement
# multiplicity = 0..1

=head2 template

  my $val = $obj->template;

Returns the AssociationEnd value of type C<UML::MetaModel::Foundation::Core::ModelElement>.

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


=head2 set_template

  $obj->set_template($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::ModelElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.template");

    $self->{'template'} = $val;                 # Recursion lock
    # Remove and add associations with other ends.
        
    $old->remove_templateParameter($self) if $old;
    $val->add_templateParameter($self)    if $val;

    }
		  
  $self;
}


=head2 add_template

  $obj->add_template($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_template

  $obj->remove_template($val);

Removes the Association to C<$val>.
Returns C<$obj>.

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

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

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

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

  
  }
}


=head2 clear_template

  $obj->clear_template;

Clears the Association.
Returns C<$obj>.

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

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

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

  
  }

  $self;
}




#################################################################
# AssociationEnd template => templateParameter
# type = UML::MetaModel::Foundation::Core::ModelElement
# multiplicity = 0..*

=head2 templateParameter

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

Returns the AssociationEnd value.
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 templateParameter ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'templateParameter'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_templateParameter

  $obj->set_templateParameter(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::ModelElement>.
Returns C<$obj>.

=cut
sub set_templateParameter ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_templateParameter;
  $self->add_templateParameter(@val);
}


=head2 add_templateParameter

  $obj->add_templateParameter(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::ModelElement>.
Returns C<$obj>.

=cut
sub add_templateParameter ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'templateParameter'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::ModelElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.templateParameter");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_templateParameter

  $obj->remove_templateParameter($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_templateParameter ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'templateParameter'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::ModelElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.templateParameter");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_template($self) if $old;
    $val->add_template($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_templateParameter

  $obj->clear_templateParameter;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_templateParameter ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'templateParameter'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'templateParameter'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_template($self) if $old;
    $val->add_template($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd subject => presentation
# type = UML::MetaModel::Foundation::Core::PresentationElement
# multiplicity = 0..*

=head2 presentation

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

Returns the AssociationEnd value.
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 presentation ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'presentation'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_presentation

  $obj->set_presentation(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::PresentationElement>.
Returns C<$obj>.

=cut
sub set_presentation ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_presentation;
  $self->add_presentation(@val);
}


=head2 add_presentation

  $obj->add_presentation(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Core::PresentationElement>.
Returns C<$obj>.

=cut
sub add_presentation ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'presentation'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Core::PresentationElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.presentation");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_presentation

  $obj->remove_presentation($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_presentation ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'presentation'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Core::PresentationElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.presentation");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_subject($self) if $old;
    $val->add_subject($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_presentation

  $obj->clear_presentation;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_presentation ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'presentation'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'presentation'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_subject($self) if $old;
    $val->add_subject($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd extendedElement => stereotype
# type = UML::MetaModel::Foundation::Extension_Mechanisms::Stereotype
# multiplicity = 0..*

=head2 stereotype

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

Returns the AssociationEnd value.
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 stereotype ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'stereotype'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_stereotype

  $obj->set_stereotype(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Extension_Mechanisms::Stereotype>.
Returns C<$obj>.

=cut
sub set_stereotype ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_stereotype;
  $self->add_stereotype(@val);
}


=head2 add_stereotype

  $obj->add_stereotype(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Extension_Mechanisms::Stereotype>.
Returns C<$obj>.

=cut
sub add_stereotype ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'stereotype'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Extension_Mechanisms::Stereotype')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.stereotype");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_stereotype

  $obj->remove_stereotype($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_stereotype ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'stereotype'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Extension_Mechanisms::Stereotype')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.stereotype");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_extendedElement($self) if $old;
    $val->add_extendedElement($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_stereotype

  $obj->clear_stereotype;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_stereotype ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'stereotype'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'stereotype'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_extendedElement($self) if $old;
    $val->add_extendedElement($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd  => taggedValue
# type = UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue
# multiplicity = 0..*

=head2 taggedValue

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

Returns the AssociationEnd value.
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 taggedValue ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'taggedValue'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_taggedValue

  $obj->set_taggedValue(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue>.
Returns C<$obj>.

=cut
sub set_taggedValue ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_taggedValue;
  $self->add_taggedValue(@val);
}


=head2 add_taggedValue

  $obj->add_taggedValue(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue>.
Returns C<$obj>.

=cut
sub add_taggedValue ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'taggedValue'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.taggedValue");

    push(@{$x}, $val);               # Recursion lock

    # Remove and add associations with other ends.
        
  }
  
  $self;
}


=head2 remove_taggedValue

  $obj->remove_taggedValue($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_taggedValue ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'taggedValue'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.taggedValue");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


=head2 clear_taggedValue

  $obj->clear_taggedValue;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_taggedValue ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'taggedValue'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'taggedValue'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


#################################################################
# AssociationEnd referenceValue => referenceTag
# type = UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue
# multiplicity = 0..*

=head2 referenceTag

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

Returns the AssociationEnd value.
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 referenceTag ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'referenceTag'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_referenceTag

  $obj->set_referenceTag(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue>.
Returns C<$obj>.

=cut
sub set_referenceTag ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_referenceTag;
  $self->add_referenceTag(@val);
}


=head2 add_referenceTag

  $obj->add_referenceTag(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue>.
Returns C<$obj>.

=cut
sub add_referenceTag ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'referenceTag'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.referenceTag");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_referenceTag

  $obj->remove_referenceTag($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_referenceTag ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'referenceTag'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Foundation::Extension_Mechanisms::TaggedValue')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.referenceTag");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_referenceValue($self) if $old;
    $val->add_referenceValue($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_referenceTag

  $obj->clear_referenceTag;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_referenceTag ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'referenceTag'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'referenceTag'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_referenceValue($self) if $old;
    $val->add_referenceValue($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd context => behavior
# type = UML::MetaModel::Behavioral_Elements::State_Machines::StateMachine
# multiplicity = 0..*

=head2 behavior

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

Returns the AssociationEnd value.
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 behavior ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'behavior'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_behavior

  $obj->set_behavior(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Behavioral_Elements::State_Machines::StateMachine>.
Returns C<$obj>.

=cut
sub set_behavior ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_behavior;
  $self->add_behavior(@val);
}


=head2 add_behavior

  $obj->add_behavior(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<UML::MetaModel::Behavioral_Elements::State_Machines::StateMachine>.
Returns C<$obj>.

=cut
sub add_behavior ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'behavior'} ||= [ ];
  my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Behavioral_Elements::State_Machines::StateMachine')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.behavior");

    push(@{$x}, $val);               # Recursion lock

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

  
  }
  
  $self;
}


=head2 remove_behavior

  $obj->remove_behavior($val);

Removes the Association to C<$val>.
Returns C<$obj>.

=cut
sub remove_behavior ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'behavior'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::State_Machines::StateMachine')->__typecheck($val, "UML::MetaModel::Foundation::Core::ModelElement.behavior");

    @$x = grep($_ ne $old, @$x);       # Recursion lock
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_context($self) if $old;
    $val->add_context($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_behavior

  $obj->clear_behavior;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_behavior ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'behavior'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'behavior'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock

    # Remove associations with other ends.

        
    $old->remove_context($self) if $old;
    $val->add_context($self)    if $val;

  ;

  }
  
  $self;
}




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

1; # is true!

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

### Keep these comments at end of file: ks.perl@kurtstephens.com 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: ###

