# -*- 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::Behavioral_Elements::Common_Behavior::Stimulus;

#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::Behavioral_Elements::Common_Behavior::Stimulus -- 

=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::ModelElement|UMMF::UML::MetaModel::Foundation::Core::ModelElement>




=head1 ATTRIBUTES

I<NO ATTRIBUTES>


=head1 ASSOCIATIONS


=head2 C<0..*> : C<stimulus_Instance> E<lt>---E<gt>  C<argument> : UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance 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::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<ordered>

=item isNavigable = C<1>

=item aggregation = C<aggregate>

=item visibility = C<public>

=item container_type = C<ARRAY>

=back


=head2 C<0..*> : C<stimulus_Link> E<lt>---E<gt>  C<communicationsLink> : UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link 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::Common_Behavior::Link|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link>

=item multiplicity = C<0..1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<0..*> : C<stimulus> E<lt>---E<gt>  C<dispatchAction> : UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure C<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::Common_Behavior::Procedure|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<1..*> : C<particpatingStimulus> E<lt>---E<gt>  C<interactionInstanceSet> : UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet 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::InteractionInstanceSet|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet>

=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<0..*> : C<conformingStimulus> E<lt>---E<gt>  C<playedRole> : UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message 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::Message|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message>

=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<public>

=item container_type = C<Set::Object>

=back


=head2 C<0..*> : C<stimulus_Instance> E<lt>---E<gt>  C<receiver> : UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance C<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::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<0..*> : C<stimulus_Instance> E<lt>---E<gt>  C<sender> : UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance C<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::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=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::ModelElement



);


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

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





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


=head2 C<__validate_type>

  UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus->__validate_type($value);

Returns true if C<$value> is a valid representation of L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus>.

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

  no warnings;

  UNIVERSAL::isa($x, 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus')  ;
}


=head2 C<__typecheck>

  UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus->__typecheck($value, $msg);

Calls C<confess()> with C<$msg> if C<<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus->__validate_type($value)>> is false.

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

  confess("typecheck: $msg: type '" . 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus' . ": value '$x'")
    unless __validate_type($self, $x);
}


=head2 C<isaStimulus>


Returns true if receiver is a L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus>.
Other receivers will return false.

=cut
sub isaStimulus { 1 }


=head2 C<isaBehavioral_Elements__Common_Behavior__Stimulus>


Returns true if receiver is a L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus>.
Other receivers will return false.
This is the fully qualified version of the C<isaStimulus> method.

=cut
sub isaBehavioral_Elements__Common_Behavior__Stimulus { 1 }


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

=head2 C<__model_name> 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Behavioral_Elements::Common_Behavior::Stimulus' }



=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::Behavioral_Elements::Common_Behavior::Stimulus' =>
     {
       'table' => 'Behavioral_Elements__Common_Behavior__Stimulus',
       'abstract' => 0,
       'slots' => 
       { 
	 # Attributes
	 
	 # Associations
	 	 	       'argument'
       => {
	 'type_impl' => 'array',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance',

                           'table' => 'Behavioral_Elements__Common_Behavior__Stimulus_Argument', 

                                                      'item' => 'argument', 

                  'coll' => 'stimulus_Instance',

                  'slot' => 'argument_i', 

                                                                      }
      ,
                  	 	       'communicationsLink'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link',

                  'null' => '1', 

                                    'col' => 'communicationsLink', 

                                                                                                                   }
      ,
                  	 	       'dispatchAction'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure',

                                             'col' => 'dispatchAction', 

                                                                                                                   }
      ,
                  	 	       'interactionInstanceSet'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet',

                           'table' => 'Behavioral_Elements__InteractionInstanceSet_ParticpatingStimulus', 

                                                      'item' => 'interactionInstanceSet', 

                  'coll' => 'particpatingStimulus',

                                                                               }
      ,
                  	 	       'playedRole'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message',

                           'table' => 'Behavioral_Elements__PlayedRole_ConformingStimulus', 

                                                      'item' => 'playedRole', 

                  'coll' => 'conformingStimulus',

                                                                               }
      ,
                  	 	       'receiver'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance',

                                             'col' => 'receiver', 

                                                                                                                   }
      ,
                  	 	       'sender'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance',

                                             'col' => 'sender', 

                                                                                                                   }
      ,
                         },
       'bases' => [  'UMMF::UML::MetaModel::Foundation::Core::ModelElement',  ],
       '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



  # Associations

  # AssociationEnd 
  #  stimulus_Instance 0..*
  #  <--> 
  #  argument 0..* UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance.
    if ( defined $self->{'argument'} ) {
    my $x = $self->{'argument'};
        $self->{'argument'} = [ ];
        $self->set_argument(@$x);
  }
  
  # AssociationEnd 
  #  stimulus_Link 0..*
  #  <--> 
  #  communicationsLink 0..1 UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link.
    if ( defined $self->{'communicationsLink'} ) {
    my $x = $self->{'communicationsLink'};
    $self->{'communicationsLink'} = undef;
    $self->set_communicationsLink($x);
  }
  
  # AssociationEnd 
  #  stimulus 0..*
  #  <--> 
  #  dispatchAction 1 UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure.
    if ( defined $self->{'dispatchAction'} ) {
    my $x = $self->{'dispatchAction'};
    $self->{'dispatchAction'} = undef;
    $self->set_dispatchAction($x);
  }
  
  # AssociationEnd 
  #  particpatingStimulus 1..*
  #  <--> 
  #  interactionInstanceSet 0..* UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet.
    if ( defined $self->{'interactionInstanceSet'} ) {
    my $x = $self->{'interactionInstanceSet'};
        $self->{'interactionInstanceSet'} = Set::Object->new();
        $self->set_interactionInstanceSet(@$x);
  }
  
  # AssociationEnd 
  #  conformingStimulus 0..*
  #  <--> 
  #  playedRole 0..* UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message.
    if ( defined $self->{'playedRole'} ) {
    my $x = $self->{'playedRole'};
        $self->{'playedRole'} = Set::Object->new();
        $self->set_playedRole(@$x);
  }
  
  # AssociationEnd 
  #  stimulus_Instance 0..*
  #  <--> 
  #  receiver 1 UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance.
    if ( defined $self->{'receiver'} ) {
    my $x = $self->{'receiver'};
    $self->{'receiver'} = undef;
    $self->set_receiver($x);
  }
  
  # AssociationEnd 
  #  stimulus_Instance 0..*
  #  <--> 
  #  sender 1 UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance.
    if ( defined $self->{'sender'} ) {
    my $x = $self->{'sender'};
    $self->{'sender'} = undef;
    $self->set_sender($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->UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::___initialize;
  $self->UMMF::UML::MetaModel::Foundation::Core::Element::___initialize;
  $self->UMMF::UML::MetaModel::Foundation::Core::ModelElement::___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::Behavioral_Elements::Common_Behavior::Stimulus::___create(@args);
  $self->UMMF::UML::MetaModel::Foundation::Core::Element::___create();
  $self->UMMF::UML::MetaModel::Foundation::Core::ModelElement::___create();

  $self;
}




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




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


=for html <hr/>

=cut

#################################################################
# AssociationEnd stimulus_Instance <---> argument
# type = UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance
# multiplicity = 0..*
# ordering = ordered

=head2 C<argument>

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

Returns the AssociationEnd C<argument> values of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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 argument ($)
{
  my ($self) = @_;

    my $x = $self->{'argument'} ||= [ ];

  wantarray ? @{$x} : $x;
  
}


=head2 C<index_argument>

  my $x = $obj->index_argument($i);
  my @x = $obj->index_argument($i, $count);

In scalar context, returns the value of AssociationEnd C<argument> at index C<$i>.
In array context, returns the values between index C<$i> and C<$i + $count - 1>, inclusive.

=cut
sub index_argument ($$@)
{
  my ($self, $i, $count) = @_;

  ;

  my $val = $self->{'argument'} ||= [ ];

  ;

  wantarray ? $val->[$i .. (defined $count ? $i + $count - 1 : $i)]
            : $val->[$i];
}


=head2 C<index_of_argument>

  my $index = $obj->index_of_argument($val);

Returns the index of C<$val> in AssociationEnd C<argument>.
Return C<undef> if C<$val> is not in C<argument>.

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

  ;

  my $val = $self->{'argument'} ||= [ ];

  ;

  __ummf_array_index($val, $x);
}


=head2 C<set_argument>

  $obj->set_argument(@val);

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

=cut
sub set_argument ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_argument;
  $self->add_argument(@val);
}


=head2 C<set_index_argument>

  $obj->set_index_argument($i, $val);

Sets the value of AssociationEnd C<argument> at index C<$i>.
Returns self.

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

  ;

  my $x = $self->{'argument'} ||= [ ];

  no warnings;
  my $old;
  if ( ($old = $x->[$i]) ne $val) {
    # Recursion lock
        $x->[$i] = $val
    ;

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

  
    ;
  }

  $self;
}


=head2 C<add_argument>

  $obj->add_argument(@val);

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

=cut
sub add_argument ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'argument'} ||= [ ];
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if grep($_ eq $val, @$x);
        $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.argument");

    # Recursion lock
        push(@{$x}, $val);
        
    # Remove and add associations with other ends.
        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

    }
  
  $self;
}


=head2 C<add_index_argument>

  $obj->add_index_argument($i, @val);

Adds AssociationEnd C<argument> values at index C<$i>.
Elements of C<@val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
Returns C<$obj>.

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

  
    my $x = $self->{'argument'} ||= [ ];
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if grep($_ eq $val, @$x);
        $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.argument");

    # Recursion lock
        splice(@{$x}, $i, 0, $val); # Recursion lock
        ++ $i;
    
    # Remove and add associations with other ends.
        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

    }
  
  
  $self;
}


=head2 C<remove_argument>

  $obj->remove_argument(@val);

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

=cut
sub remove_argument ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'argument'} ||= [ ];
  
  for my $old ( @val ) {
    # Recursion lock
        my $i; # index of $old in @$x.
    next unless defined($i = __ummf_array_index($x, $old));
    
    my $val = $old;
      
    $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.argument");

    # Recursion lock
        splice(@$x, $i, 1);     
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_argument>

  $obj->clear_argument;

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

=cut
sub clear_argument ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'argument'} ||= [ ];
  
  my $val; # Place holder for other MACRO.
  
    $self->{'argument'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_argument>

  $obj->count_argument;

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

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

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

    defined $x ? scalar @$x : 0;
  }




=for html <hr/>

=cut

#################################################################
# AssociationEnd stimulus_Link <---> communicationsLink
# type = UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link
# multiplicity = 0..1
# ordering = 

=head2 C<communicationsLink>

  my $val = $obj->communicationsLink;

Returns the AssociationEnd C<communicationsLink> value of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link>.

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


=head2 C<set_communicationsLink>

  $obj->set_communicationsLink($val);

Sets the AssociationEnd C<communicationsLink> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link>.
Returns C<$obj>.

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

    if ( defined $val ) { $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.communicationsLink") }

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

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

    }
		  
  $self;
}


=head2 C<add_communicationsLink>

  $obj->add_communicationsLink($val);

Adds the AssociationEnd C<communicationsLink> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link>.
Throws exception if a value already exists.
Returns C<$obj>.

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

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

  my $old;
  if ( ($old = $self->{'communicationsLink'}) ne $val ) { # Recursion lock
    $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.communicationsLink");
      
    # confess("UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::communicationsLink: too many")
    # if defined $self->{'communicationsLink'};

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

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

  
  }

  $self;
}


=head2 C<remove_communicationsLink>

  $obj->remove_communicationsLink($val);

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

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

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

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

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

  
  }
}


=head2 C<clear_communicationsLink>

  $obj->clear_communicationsLink;

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

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

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

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

    }

  $self;
}


=head2 C<count_communicationsLink>

  $obj->count_communicationsLink;

Returns the number of elements of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Link> associated with C<communicationsLink>.

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

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

  defined $x ? 1 : 0;
}




=for html <hr/>

=cut

#################################################################
# AssociationEnd stimulus <---> dispatchAction
# type = UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure
# multiplicity = 1
# ordering = 

=head2 C<dispatchAction>

  my $val = $obj->dispatchAction;

Returns the AssociationEnd C<dispatchAction> value of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure>.

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


=head2 C<set_dispatchAction>

  $obj->set_dispatchAction($val);

Sets the AssociationEnd C<dispatchAction> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure>.
Returns C<$obj>.

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

    if ( defined $val ) { $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.dispatchAction") }

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

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

    }
		  
  $self;
}


=head2 C<add_dispatchAction>

  $obj->add_dispatchAction($val);

Adds the AssociationEnd C<dispatchAction> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure>.
Throws exception if a value already exists.
Returns C<$obj>.

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

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

  my $old;
  if ( ($old = $self->{'dispatchAction'}) ne $val ) { # Recursion lock
    $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.dispatchAction");
      
    # confess("UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::dispatchAction: too many")
    # if defined $self->{'dispatchAction'};

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

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

  
  }

  $self;
}


=head2 C<remove_dispatchAction>

  $obj->remove_dispatchAction($val);

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

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

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

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

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

  
  }
}


=head2 C<clear_dispatchAction>

  $obj->clear_dispatchAction;

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

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

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

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

    }

  $self;
}


=head2 C<count_dispatchAction>

  $obj->count_dispatchAction;

Returns the number of elements of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure> associated with C<dispatchAction>.

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

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

  defined $x ? 1 : 0;
}




=for html <hr/>

=cut

#################################################################
# AssociationEnd particpatingStimulus <---> interactionInstanceSet
# type = UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet
# multiplicity = 0..*
# ordering = 

=head2 C<interactionInstanceSet>

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

Returns the AssociationEnd C<interactionInstanceSet> values of type L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::InteractionInstanceSet>.
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 interactionInstanceSet ($)
{
  my ($self) = @_;

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

  # confess("Container for interactionInstanceSet $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_interactionInstanceSet>

  $obj->set_interactionInstanceSet(@val);

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

=cut
sub set_interactionInstanceSet ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_interactionInstanceSet;
  $self->add_interactionInstanceSet(@val);
}


=head2 C<add_interactionInstanceSet>

  $obj->add_interactionInstanceSet(@val);

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

=cut
sub add_interactionInstanceSet ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'interactionInstanceSet'} ||= 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::InteractionInstanceSet')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.interactionInstanceSet");

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

    }
  
  $self;
}


=head2 C<remove_interactionInstanceSet>

  $obj->remove_interactionInstanceSet(@val);

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

=cut
sub remove_interactionInstanceSet ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'interactionInstanceSet'} ||= 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::InteractionInstanceSet')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.interactionInstanceSet");

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

    # Remove associations with other ends.

        
    $old->remove_particpatingStimulus($self) if $old;
    $val->add_particpatingStimulus($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_interactionInstanceSet>

  $obj->clear_interactionInstanceSet;

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

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

        
    $old->remove_particpatingStimulus($self) if $old;
    $val->add_particpatingStimulus($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_interactionInstanceSet>

  $obj->count_interactionInstanceSet;

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

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

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

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




=for html <hr/>

=cut

#################################################################
# AssociationEnd conformingStimulus <---> playedRole
# type = UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message
# multiplicity = 0..*
# ordering = 

=head2 C<playedRole>

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

Returns the AssociationEnd C<playedRole> values of type L<UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message|UMMF::UML::MetaModel::Behavioral_Elements::Collaborations::Message>.
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 playedRole ($)
{
  my ($self) = @_;

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

  # confess("Container for playedRole $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_playedRole>

  $obj->set_playedRole(@val);

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

=cut
sub set_playedRole ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_playedRole;
  $self->add_playedRole(@val);
}


=head2 C<add_playedRole>

  $obj->add_playedRole(@val);

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

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

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

    }
  
  $self;
}


=head2 C<remove_playedRole>

  $obj->remove_playedRole(@val);

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

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

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

    # Remove associations with other ends.

        
    $old->remove_conformingStimulus($self) if $old;
    $val->add_conformingStimulus($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_playedRole>

  $obj->clear_playedRole;

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

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

        
    $old->remove_conformingStimulus($self) if $old;
    $val->add_conformingStimulus($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_playedRole>

  $obj->count_playedRole;

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

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

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

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




=for html <hr/>

=cut

#################################################################
# AssociationEnd stimulus_Instance <---> receiver
# type = UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance
# multiplicity = 1
# ordering = 

=head2 C<receiver>

  my $val = $obj->receiver;

Returns the AssociationEnd C<receiver> value of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.

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


=head2 C<set_receiver>

  $obj->set_receiver($val);

Sets the AssociationEnd C<receiver> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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

    if ( defined $val ) { $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.receiver") }

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

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

    }
		  
  $self;
}


=head2 C<add_receiver>

  $obj->add_receiver($val);

Adds the AssociationEnd C<receiver> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.receiver");
      
    # confess("UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::receiver: too many")
    # if defined $self->{'receiver'};

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

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

  
  }

  $self;
}


=head2 C<remove_receiver>

  $obj->remove_receiver($val);

Removes the AssociationEnd C<receiver> value 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.
        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

  
  }
}


=head2 C<clear_receiver>

  $obj->clear_receiver;

Clears the AssociationEnd C<receiver> links to L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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.
        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

    }

  $self;
}


=head2 C<count_receiver>

  $obj->count_receiver;

Returns the number of elements of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance> associated with C<receiver>.

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

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

  defined $x ? 1 : 0;
}




=for html <hr/>

=cut

#################################################################
# AssociationEnd stimulus_Instance <---> sender
# type = UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance
# multiplicity = 1
# ordering = 

=head2 C<sender>

  my $val = $obj->sender;

Returns the AssociationEnd C<sender> value of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.

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


=head2 C<set_sender>

  $obj->set_sender($val);

Sets the AssociationEnd C<sender> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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

    if ( defined $val ) { $self->__use('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.sender") }

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

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

    }
		  
  $self;
}


=head2 C<add_sender>

  $obj->add_sender($val);

Adds the AssociationEnd C<sender> value.
C<$val> must of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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('UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.sender");
      
    # confess("UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::sender: too many")
    # if defined $self->{'sender'};

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

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

  
  }

  $self;
}


=head2 C<remove_sender>

  $obj->remove_sender($val);

Removes the AssociationEnd C<sender> value 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.
        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

  
  }
}


=head2 C<clear_sender>

  $obj->clear_sender;

Clears the AssociationEnd C<sender> links to L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance>.
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.
        
    $old->remove_stimulus_Instance($self) if $old;
    $val->add_stimulus_Instance($self)    if $val;

    }

  $self;
}


=head2 C<count_sender>

  $obj->count_sender;

Returns the number of elements of type L<UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance|UMMF::UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance> associated with C<sender>.

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

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

  defined $x ? 1 : 0;
}







# End of Class Stimulus


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

