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

package UML::MetaModel::Foundation::Core::AssociationEnd;

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::Foundation::Core::AssociationEnd->__validate_type($value);

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

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

  no warnings;

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


=head2 __typecheck

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

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

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

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


=head2 isaAssociationEnd

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

=cut
sub isaAssociationEnd { 1 }


=head2 isaFoundation__Core__AssociationEnd

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

=cut
sub isaFoundation__Core__AssociationEnd { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

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




  


  


  


  


  


  


  



# ASSOC: connection

  

# ASSOC: association

  

# ASSOC: specifiedEnd

  

# ASSOC: associationEnd

  

# ASSOC: base

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


                  

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

 
=head2 __intialize

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

See also: C<_initialize>.

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

  # Attributes

    # Attribute isNavigable
  if ( exists $self->{'isNavigable'} ) {
    my $x = $self->{'isNavigable'};
    $self->{'isNavigable'} = undef;
    $self->set_isNavigable($x);
  } else {
      }
  
    # Attribute ordering
  if ( exists $self->{'ordering'} ) {
    my $x = $self->{'ordering'};
    $self->{'ordering'} = undef;
    $self->set_ordering($x);
  } else {
      }
  
    # Attribute aggregation
  if ( exists $self->{'aggregation'} ) {
    my $x = $self->{'aggregation'};
    $self->{'aggregation'} = undef;
    $self->set_aggregation($x);
  } else {
      }
  
    # Attribute targetScope
  if ( exists $self->{'targetScope'} ) {
    my $x = $self->{'targetScope'};
    $self->{'targetScope'} = undef;
    $self->set_targetScope($x);
  } else {
      }
  
    # Attribute multiplicity
  if ( exists $self->{'multiplicity'} ) {
    my $x = $self->{'multiplicity'};
    $self->{'multiplicity'} = undef;
    $self->set_multiplicity($x);
  } else {
      }
  
    # Attribute changeability
  if ( exists $self->{'changeability'} ) {
    my $x = $self->{'changeability'};
    $self->{'changeability'} = undef;
    $self->set_changeability($x);
  } else {
      }
  
    # Attribute visibility
  if ( exists $self->{'visibility'} ) {
    my $x = $self->{'visibility'};
    $self->{'visibility'} = undef;
    $self->set_visibility($x);
  } else {
      }
  


  # Associations

  # AssociationEnd 
  #  connection 2..*
  #  <--> 
  #  _association 1 UML::MetaModel::Foundation::Core::Association.
    if ( defined $self->{'_association'} ) {
    my $x = $self->{'_association'};
    $self->{'_association'} = undef;
    $self->set__association($x);
  }
  
  # AssociationEnd 
  #  association 0..*
  #  <--> 
  #  participant 1 UML::MetaModel::Foundation::Core::Classifier.
    if ( defined $self->{'participant'} ) {
    my $x = $self->{'participant'};
    $self->{'participant'} = undef;
    $self->set_participant($x);
  }
  
  # AssociationEnd 
  #  specifiedEnd 0..*
  #  <--> 
  #  specification 0..* UML::MetaModel::Foundation::Core::Classifier.
    if ( defined $self->{'specification'} && @{$self->{'specification'}} ) {
    my $x = $self->{'specification'};
    $self->{'specification'} = [ ];
    $self->set_specification(@$x);
  }
  
  # AssociationEnd 
  #  associationEnd 0..1
  #  <--> 
  #  qualifier 0..* UML::MetaModel::Foundation::Core::Attribute.
    if ( defined $self->{'qualifier'} && @{$self->{'qualifier'}} ) {
    my $x = $self->{'qualifier'};
    $self->{'qualifier'} = [ ];
    $self->set_qualifier(@$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::Foundation::Core::AssociationEnd::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;

  $self;
}
      

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



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

=head2 isNavigable

  my $val = $obj->isNavigable;

Returns the value of Attribute isNavigable.

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

  $self->{'isNavigable'};
}


=head2 set_isNavigable

  $obj->set_isNavigable($val);

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

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

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

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

  $self
}

#################################################################
# Attribute ordering
# type = UML::MetaModel::Foundation::Data_Types::OrderingKind
# multiplicity = 1

=head2 ordering

  my $val = $obj->ordering;

Returns the value of Attribute ordering.

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

  $self->{'ordering'};
}


=head2 set_ordering

  $obj->set_ordering($val);

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

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::OrderingKind')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd.ordering");

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

  $self
}

#################################################################
# Attribute aggregation
# type = UML::MetaModel::Foundation::Data_Types::AggregationKind
# multiplicity = 1

=head2 aggregation

  my $val = $obj->aggregation;

Returns the value of Attribute aggregation.

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

  $self->{'aggregation'};
}


=head2 set_aggregation

  $obj->set_aggregation($val);

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

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::AggregationKind')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd.aggregation");

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

  $self
}

#################################################################
# Attribute targetScope
# type = UML::MetaModel::Foundation::Data_Types::ScopeKind
# multiplicity = 1

=head2 targetScope

  my $val = $obj->targetScope;

Returns the value of Attribute targetScope.

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

  $self->{'targetScope'};
}


=head2 set_targetScope

  $obj->set_targetScope($val);

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

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::ScopeKind')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd.targetScope");

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

  $self
}

#################################################################
# Attribute multiplicity
# type = UML::MetaModel::Foundation::Data_Types::Multiplicity
# multiplicity = 1

=head2 multiplicity

  my $val = $obj->multiplicity;

Returns the value of Attribute multiplicity.

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

  $self->{'multiplicity'};
}


=head2 set_multiplicity

  $obj->set_multiplicity($val);

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

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Multiplicity')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd.multiplicity");

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

  $self
}

#################################################################
# Attribute changeability
# type = UML::MetaModel::Foundation::Data_Types::ChangeableKind
# multiplicity = 1

=head2 changeability

  my $val = $obj->changeability;

Returns the value of Attribute changeability.

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

  $self->{'changeability'};
}


=head2 set_changeability

  $obj->set_changeability($val);

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

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::ChangeableKind')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd.changeability");

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

  $self
}

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

=head2 visibility

  my $val = $obj->visibility;

Returns the value of Attribute visibility.

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

  $self->{'visibility'};
}


=head2 set_visibility

  $obj->set_visibility($val);

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

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

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

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

  $self
}


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


#################################################################
# AssociationEnd connection => _association
# type = UML::MetaModel::Foundation::Core::Association
# multiplicity = 1

=head2 _association

  my $val = $obj->_association;

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

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


=head2 set__association

  $obj->set__association($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::Association')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd._association");

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

    }
		  
  $self;
}


=head2 add__association

  $obj->add__association($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove__association

  $obj->remove__association($val);

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

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

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

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

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

  
  }
}


=head2 clear__association

  $obj->clear__association;

Clears the Association.
Returns C<$obj>.

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

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

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

  
  }

  $self;
}




#################################################################
# AssociationEnd association => participant
# type = UML::MetaModel::Foundation::Core::Classifier
# multiplicity = 1

=head2 participant

  my $val = $obj->participant;

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

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


=head2 set_participant

  $obj->set_participant($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::Classifier')->__typecheck($val, "UML::MetaModel::Foundation::Core::AssociationEnd.participant");

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

    }
		  
  $self;
}


=head2 add_participant

  $obj->add_participant($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_participant

  $obj->remove_participant($val);

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

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

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

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

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

  
  }
}


=head2 clear_participant

  $obj->clear_participant;

Clears the Association.
Returns C<$obj>.

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

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

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

  
  }

  $self;
}




#################################################################
# AssociationEnd specifiedEnd => specification
# type = UML::MetaModel::Foundation::Core::Classifier
# multiplicity = 0..*

=head2 specification

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

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


=head2 set_specification

  $obj->set_specification(@val);

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

=cut
sub set_specification ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_specification;
  $self->add_specification(@val);
}


=head2 add_specification

  $obj->add_specification(@val);

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

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

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

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

  
  }
  
  $self;
}


=head2 remove_specification

  $obj->remove_specification($val);

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

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

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

    # Remove associations with other ends.

        
    $old->remove_specifiedEnd($self) if $old;
    $val->add_specifiedEnd($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_specification

  $obj->clear_specification;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_specifiedEnd($self) if $old;
    $val->add_specifiedEnd($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd associationEnd => qualifier
# type = UML::MetaModel::Foundation::Core::Attribute
# multiplicity = 0..*

=head2 qualifier

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

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


=head2 set_qualifier

  $obj->set_qualifier(@val);

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

=cut
sub set_qualifier ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_qualifier;
  $self->add_qualifier(@val);
}


=head2 add_qualifier

  $obj->add_qualifier(@val);

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

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

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

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

  
  }
  
  $self;
}


=head2 remove_qualifier

  $obj->remove_qualifier($val);

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

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

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

    # Remove associations with other ends.

        
    $old->remove_associationEnd($self) if $old;
    $val->add_associationEnd($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_qualifier

  $obj->clear_qualifier;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

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

