# -*- 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::Behavioral_Elements::Collaborations::Message;

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::Behavioral_Elements::Collaborations::Action


);

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

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





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


=head2 __validate_type

  UML::MetaModel::Behavioral_Elements::Collaborations::Message->__validate_type($value);

Returns true if $value is a valid value of UML::MetaModel::Behavioral_Elements::Collaborations::Message.

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

  no warnings;

  UNIVERSAL::isa($x, 'UML::MetaModel::Behavioral_Elements::Collaborations::Message')  ;
}


=head2 __typecheck

  UML::MetaModel::Behavioral_Elements::Collaborations::Message->__typecheck($value, $msg);

Calls C<confess()> with C<$msg> if C<UML::MetaModel::Behavioral_Elements::Collaborations::Message-E<GT>__validate_type($value)> is false.

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

  confess("typecheck: $msg: type 'UML::MetaModel::Behavioral_Elements::Collaborations::Message': value '$x'")
    unless __validate_type($self, $x);
}


=head2 isaMessage

Returns true if receiver is a C<UML::MetaModel::Behavioral_Elements::Collaborations::Message>.
Other receivers will return false.

=cut
sub isaMessage { 1 }


=head2 isaBehavioral_Elements__Collaborations__Message

Returns true if receiver is a C<UML::MetaModel::Behavioral_Elements::Collaborations::Message>.
Other receivers will return false.
This is the fully qualified version of the C<isaMessage> method.

=cut
sub isaBehavioral_Elements__Collaborations__Message { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

Returns the UML Model name (C<'Behavioral_Elements::Collaborations::Message'>) for an object or package of
this Classifier.

=cut
sub __model_name { 'Behavioral_Elements::Collaborations::Message' }





# ASSOC: 

  

# ASSOC: predecessor

  

# ASSOC: sucessor

  

# ASSOC: 

  

# ASSOC: 

  

# ASSOC: playedRole

  

# ASSOC: message

  


#################################################################
# 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



  # Associations

  # AssociationEnd 
  #   0..*
  #  <--> 
  #  communicationConnection 0..1 UML::MetaModel::Behavioral_Elements::Collaborations::AssociationRole.
    if ( defined $self->{'communicationConnection'} ) {
    my $x = $self->{'communicationConnection'};
    $self->{'communicationConnection'} = undef;
    $self->set_communicationConnection($x);
  }
  
  # AssociationEnd 
  #  predecessor 0..*
  #  <--> 
  #  sucessor 0..* UML::MetaModel::Behavioral_Elements::Collaborations::Message.
    if ( defined $self->{'sucessor'} && @{$self->{'sucessor'}} ) {
    my $x = $self->{'sucessor'};
    $self->{'sucessor'} = [ ];
    $self->set_sucessor(@$x);
  }
  
  # AssociationEnd 
  #  sucessor 0..*
  #  <--> 
  #  predecessor 0..* UML::MetaModel::Behavioral_Elements::Collaborations::Message.
    if ( defined $self->{'predecessor'} && @{$self->{'predecessor'}} ) {
    my $x = $self->{'predecessor'};
    $self->{'predecessor'} = [ ];
    $self->set_predecessor(@$x);
  }
  
  # AssociationEnd 
  #   0..*
  #  <--> 
  #  sender 1 UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole.
    if ( defined $self->{'sender'} ) {
    my $x = $self->{'sender'};
    $self->{'sender'} = undef;
    $self->set_sender($x);
  }
  
  # AssociationEnd 
  #   0..*
  #  <--> 
  #  receiver 1 UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole.
    if ( defined $self->{'receiver'} ) {
    my $x = $self->{'receiver'};
    $self->{'receiver'} = undef;
    $self->set_receiver($x);
  }
  
  # AssociationEnd 
  #  playedRole 0..*
  #  <--> 
  #  conformingStimulus 0..* UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.
    if ( defined $self->{'conformingStimulus'} && @{$self->{'conformingStimulus'}} ) {
    my $x = $self->{'conformingStimulus'};
    $self->{'conformingStimulus'} = [ ];
    $self->set_conformingStimulus(@$x);
  }
  
  # AssociationEnd 
  #  message 1..*
  #  <--> 
  #  interaction 1 UML::MetaModel::Behavioral_Elements::Collaborations::Interaction.
    if ( defined $self->{'interaction'} ) {
    my $x = $self->{'interaction'};
    $self->{'interaction'} = undef;
    $self->set_interaction($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::Behavioral_Elements::Collaborations::Action');
  }

  $self->UML::MetaModel::Behavioral_Elements::Collaborations::Message::__initialize;
  $self->UML::MetaModel::Behavioral_Elements::Collaborations::Action::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd  => communicationConnection
# type = UML::MetaModel::Behavioral_Elements::Collaborations::AssociationRole
# multiplicity = 0..1

=head2 communicationConnection

  my $val = $obj->communicationConnection;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Collaborations::AssociationRole>.

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


=head2 set_communicationConnection

  $obj->set_communicationConnection($val);

Sets the AssociationEnd value.
C<$val> must of of type C<UML::MetaModel::Behavioral_Elements::Collaborations::AssociationRole>.
Returns C<$obj>.

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::AssociationRole')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.communicationConnection");

    $self->{'communicationConnection'} = $val;                 # Recursion lock
    # Remove and add associations with other ends.
          }
		  
  $self;
}


=head2 add_communicationConnection

  $obj->add_communicationConnection($val);

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

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

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

  my $old;
  if ( ($old = $self->{'communicationConnection'}) ne $val ) { # Recursion lock
    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::AssociationRole')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.communicationConnection");
      
    # confess("UML::MetaModel::Behavioral_Elements::Collaborations::Message::communicationConnection: too many")
    # if defined $self->{'communicationConnection'};

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_communicationConnection

  $obj->remove_communicationConnection($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_communicationConnection

  $obj->clear_communicationConnection;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd predecessor => sucessor
# type = UML::MetaModel::Behavioral_Elements::Collaborations::Message
# multiplicity = 0..*

=head2 sucessor

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

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 sucessor ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'sucessor'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_sucessor

  $obj->set_sucessor(@val);

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

=cut
sub set_sucessor ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_sucessor;
  $self->add_sucessor(@val);
}


=head2 add_sucessor

  $obj->add_sucessor(@val);

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

=cut
sub add_sucessor ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'sucessor'} ||= [ ];
  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::Collaborations::Message')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.sucessor");

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

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

  
  }
  
  $self;
}


=head2 remove_sucessor

  $obj->remove_sucessor($val);

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

=cut
sub remove_sucessor ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'sucessor'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::Message')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.sucessor");

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

    # Remove associations with other ends.

        
    $old->remove_predecessor($self) if $old;
    $val->add_predecessor($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_sucessor

  $obj->clear_sucessor;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_predecessor($self) if $old;
    $val->add_predecessor($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd sucessor => predecessor
# type = UML::MetaModel::Behavioral_Elements::Collaborations::Message
# multiplicity = 0..*

=head2 predecessor

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

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 predecessor ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'predecessor'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_predecessor

  $obj->set_predecessor(@val);

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

=cut
sub set_predecessor ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_predecessor;
  $self->add_predecessor(@val);
}


=head2 add_predecessor

  $obj->add_predecessor(@val);

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

=cut
sub add_predecessor ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'predecessor'} ||= [ ];
  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::Collaborations::Message')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.predecessor");

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

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

  
  }
  
  $self;
}


=head2 remove_predecessor

  $obj->remove_predecessor($val);

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

=cut
sub remove_predecessor ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'predecessor'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::Message')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.predecessor");

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

    # Remove associations with other ends.

        
    $old->remove_sucessor($self) if $old;
    $val->add_sucessor($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_predecessor

  $obj->clear_predecessor;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_sucessor($self) if $old;
    $val->add_sucessor($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd  => sender
# type = UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole
# multiplicity = 1

=head2 sender

  my $val = $obj->sender;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole>.

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


=head2 set_sender

  $obj->set_sender($val);

Sets the AssociationEnd value.
C<$val> must of of type C<UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole>.
Returns C<$obj>.

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.sender");

    $self->{'sender'} = $val;                 # Recursion lock
    # Remove and add associations with other ends.
          }
		  
  $self;
}


=head2 add_sender

  $obj->add_sender($val);

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

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

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

  my $old;
  if ( ($old = $self->{'sender'}) ne $val ) { # Recursion lock
    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.sender");
      
    # confess("UML::MetaModel::Behavioral_Elements::Collaborations::Message::sender: too many")
    # if defined $self->{'sender'};

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_sender

  $obj->remove_sender($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_sender

  $obj->clear_sender;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd  => receiver
# type = UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole
# multiplicity = 1

=head2 receiver

  my $val = $obj->receiver;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole>.

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


=head2 set_receiver

  $obj->set_receiver($val);

Sets the AssociationEnd value.
C<$val> must of of type C<UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole>.
Returns C<$obj>.

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.receiver");

    $self->{'receiver'} = $val;                 # Recursion lock
    # Remove and add associations with other ends.
          }
		  
  $self;
}


=head2 add_receiver

  $obj->add_receiver($val);

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

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

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

  my $old;
  if ( ($old = $self->{'receiver'}) ne $val ) { # Recursion lock
    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::ClassifierRole')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.receiver");
      
    # confess("UML::MetaModel::Behavioral_Elements::Collaborations::Message::receiver: too many")
    # if defined $self->{'receiver'};

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_receiver

  $obj->remove_receiver($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_receiver

  $obj->clear_receiver;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd playedRole => conformingStimulus
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus
# multiplicity = 0..*

=head2 conformingStimulus

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

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 conformingStimulus ($)
{
  my ($self) = @_;
		  
  my $x = $self->{'conformingStimulus'} ||= [ ];
  wantarray ? @{$x} : $x;
}


=head2 set_conformingStimulus

  $obj->set_conformingStimulus(@val);

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

=cut
sub set_conformingStimulus ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_conformingStimulus;
  $self->add_conformingStimulus(@val);
}


=head2 add_conformingStimulus

  $obj->add_conformingStimulus(@val);

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

=cut
sub add_conformingStimulus ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'conformingStimulus'} ||= [ ];
  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::Common_Behavior::Stimulus')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.conformingStimulus");

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

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

  
  }
  
  $self;
}


=head2 remove_conformingStimulus

  $obj->remove_conformingStimulus($val);

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

=cut
sub remove_conformingStimulus ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'conformingStimulus'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.conformingStimulus");

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

    # Remove associations with other ends.

        
    $old->remove_playedRole($self) if $old;
    $val->add_playedRole($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_conformingStimulus

  $obj->clear_conformingStimulus;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_playedRole($self) if $old;
    $val->add_playedRole($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd message => interaction
# type = UML::MetaModel::Behavioral_Elements::Collaborations::Interaction
# multiplicity = 1

=head2 interaction

  my $val = $obj->interaction;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Collaborations::Interaction>.

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


=head2 set_interaction

  $obj->set_interaction($val);

Sets the AssociationEnd value.
C<$val> must of of type C<UML::MetaModel::Behavioral_Elements::Collaborations::Interaction>.
Returns C<$obj>.

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::Interaction')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.interaction");

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

    }
		  
  $self;
}


=head2 add_interaction

  $obj->add_interaction($val);

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

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

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

  my $old;
  if ( ($old = $self->{'interaction'}) ne $val ) { # Recursion lock
    $self->__use('UML::MetaModel::Behavioral_Elements::Collaborations::Interaction')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Collaborations::Message.interaction");
      
    # confess("UML::MetaModel::Behavioral_Elements::Collaborations::Message::interaction: too many")
    # if defined $self->{'interaction'};

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

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

  
  }

  $self;
}


=head2 remove_interaction

  $obj->remove_interaction($val);

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

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

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

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

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

  
  }
}


=head2 clear_interaction

  $obj->clear_interaction;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
    $old->remove_message($self) if $old;
    $val->add_message($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: ###

