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

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


);

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

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





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


=head2 __validate_type

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

Returns true if $value is a valid value of UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.

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

  no warnings;

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


=head2 __typecheck

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

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

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

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


=head2 isaStimulus

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

=cut
sub isaStimulus { 1 }


=head2 isaBehavioral_Elements__Common_Behavior__Stimulus

Returns true if receiver is a C<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 __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' }





# ASSOC: 

  

# ASSOC: 

  

# ASSOC: 

  

# ASSOC: 

  

# ASSOC: 

  

# ASSOC: conformingStimulus

  

# ASSOC: particpatingStimulus

#################################################################
# 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..*
  #  <--> 
  #  argument 0..* UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance.
    if ( defined $self->{'argument'} && @{$self->{'argument'}} ) {
    my $x = $self->{'argument'};
    $self->{'argument'} = [ ];
    $self->set_argument(@$x);
  }
  
  # AssociationEnd 
  #   0..*
  #  <--> 
  #  receiver 1 UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance.
    if ( defined $self->{'receiver'} ) {
    my $x = $self->{'receiver'};
    $self->{'receiver'} = undef;
    $self->set_receiver($x);
  }
  
  # AssociationEnd 
  #   0..*
  #  <--> 
  #  sender 1 UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance.
    if ( defined $self->{'sender'} ) {
    my $x = $self->{'sender'};
    $self->{'sender'} = undef;
    $self->set_sender($x);
  }
  
  # AssociationEnd 
  #   0..*
  #  <--> 
  #  dispatchAction 1 UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure.
    if ( defined $self->{'dispatchAction'} ) {
    my $x = $self->{'dispatchAction'};
    $self->{'dispatchAction'} = undef;
    $self->set_dispatchAction($x);
  }
  
  # AssociationEnd 
  #   0..*
  #  <--> 
  #  communicationsLink 0..1 UML::MetaModel::Behavioral_Elements::Common_Behavior::Link.
    if ( defined $self->{'communicationsLink'} ) {
    my $x = $self->{'communicationsLink'};
    $self->{'communicationsLink'} = undef;
    $self->set_communicationsLink($x);
  }
  
  # AssociationEnd 
  #  conformingStimulus 0..*
  #  <--> 
  #  playedRole 0..* UML::MetaModel::Behavioral_Elements::Collaborations::Message.
    if ( defined $self->{'playedRole'} && @{$self->{'playedRole'}} ) {
    my $x = $self->{'playedRole'};
    $self->{'playedRole'} = [ ];
    $self->set_playedRole(@$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->__use('UML::MetaModel::Foundation::Core::ModelElement');
  }

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

  $self;
}
      

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




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


#################################################################
# AssociationEnd  => argument
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance
# multiplicity = 0..*

=head2 argument

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

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


=head2 set_argument

  $obj->set_argument(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<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 add_argument

  $obj->add_argument(@val);

Sets the AssociationEnd value.
Elements of C<@val> must of of type C<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 ) {
    next if grep($_ eq $val, @$x);   # Recursion lock
    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.argument");

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

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


=head2 remove_argument

  $obj->remove_argument($val);

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

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

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

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


=head2 clear_argument

  $obj->clear_argument;

Clears the Association.
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.

        ;

  }
  
  $self;
}


#################################################################
# AssociationEnd  => receiver
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance
# multiplicity = 1

=head2 receiver

  my $val = $obj->receiver;

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.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::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('UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.receiver");
      
    # confess("UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::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  => sender
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance
# multiplicity = 1

=head2 sender

  my $val = $obj->sender;

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.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::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('UML::MetaModel::Behavioral_Elements::Common_Behavior::Instance')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.sender");
      
    # confess("UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus::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  => dispatchAction
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure
# multiplicity = 1

=head2 dispatchAction

  my $val = $obj->dispatchAction;

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

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


=head2 set_dispatchAction

  $obj->set_dispatchAction($val);

Sets the AssociationEnd value.
C<$val> must of of type C<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

    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.dispatchAction");

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


=head2 add_dispatchAction

  $obj->add_dispatchAction($val);

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_dispatchAction

  $obj->remove_dispatchAction($val);

Removes the Association to 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.
        
  }
}


=head2 clear_dispatchAction

  $obj->clear_dispatchAction;

Clears the Association.
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.
        
  }

  $self;
}




#################################################################
# AssociationEnd  => communicationsLink
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Link
# multiplicity = 0..1

=head2 communicationsLink

  my $val = $obj->communicationsLink;

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

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


=head2 set_communicationsLink

  $obj->set_communicationsLink($val);

Sets the AssociationEnd value.
C<$val> must of of type C<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

    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Link')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Stimulus.communicationsLink");

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


=head2 add_communicationsLink

  $obj->add_communicationsLink($val);

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_communicationsLink

  $obj->remove_communicationsLink($val);

Removes the Association to 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.
        
  }
}


=head2 clear_communicationsLink

  $obj->clear_communicationsLink;

Clears the Association.
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.
        
  }

  $self;
}




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

=head2 playedRole

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

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


=head2 set_playedRole

  $obj->set_playedRole(@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_playedRole ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_playedRole;
  $self->add_playedRole(@val);
}


=head2 add_playedRole

  $obj->add_playedRole(@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_playedRole ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'playedRole'} ||= [ ];
  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::Common_Behavior::Stimulus.playedRole");

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

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

  
  }
  
  $self;
}


=head2 remove_playedRole

  $obj->remove_playedRole($val);

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

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

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

    # Remove associations with other ends.

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

  ;

  }
  
  $self;
}


=head2 clear_playedRole

  $obj->clear_playedRole;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_conformingStimulus($self) if $old;
    $val->add_conformingStimulus($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: ###

