# -*- perl -*-
# DO NOT EDIT - This file is generated by UMMF; http://ummf.sourceforge.net 
# From template: $Id: Perl.txt,v 1.77 2006/05/14 01:40:03 kstephens Exp $

package UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData;

#use 5.6.1;
use strict;
use warnings;

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

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


#################################################################
# Documentation
#

=head1 NAME

UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData -- 

=head1 VERSION

1.5

=head1 SYNOPSIS

=head1 DESCRIPTION 

=head1 USAGE

=head1 EXPORT

=head1 METATYPE

L<UMMF::UML_1_5::Foundation::Core::Class|UMMF::UML_1_5::Foundation::Core::Class>

=head1 SUPERCLASSES

L<UMMF::UML_1_5::Foundation::Core::Element|UMMF::UML_1_5::Foundation::Core::Element>




=head1 ATTRIBUTES

I<NO ATTRIBUTES>


=head1 ASSOCIATIONS


=head2 C<> : I<THIS> C<0..*> ----E<gt>  C<end> : UMMF::UML_1_5::Foundation::Core::AssociationEnd C<1>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=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<endData> : I<THIS> C<2..*> E<lt>----  C<> : UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkAction C<1>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkAction|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkAction>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<0>

=item aggregation = C<composite>

=item visibility = C<private>

=item container_type = C<Set::Object>

=back


=head2 C<> : I<THIS> C<1> ----E<gt>  C<qualifier> : UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue C<0..*>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>

=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



=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_1_5::__ObjectBase qw(:__ummf_array);


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

use base qw(
  UMMF::UML_1_5::Foundation::Core::Element



);


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

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





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


=head2 C<__validate_type>

  UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData->__validate_type($value);

Returns true if C<$value> is a valid representation of L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData>.

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

  no warnings;

  UNIVERSAL::isa($x, 'UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData')  ;
}


=head2 C<__typecheck>

  UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData->__typecheck($value, $msg);

Calls C<confess()> with C<$msg> if C<<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData->__validate_type($value)>> is false.

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

  confess("typecheck: $msg: type '" . 'UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData' . ": value '$x'")
    unless __validate_type($self, $x);
}


=head2 C<isaLinkEndData>


Returns true if receiver is a L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData>.
Other receivers will return false.

=cut
sub isaLinkEndData { 1 }


=head2 C<isaBehavioral_Elements__Actions__Read_Write_Actions__Association_Actions__LinkEndData>


Returns true if receiver is a L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData>.
Other receivers will return false.
This is the fully qualified version of the C<isaLinkEndData> method.

=cut
sub isaBehavioral_Elements__Actions__Read_Write_Actions__Association_Actions__LinkEndData { 1 }


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

=head2 C<__model_name> 

  my $name = $obj_or_package->__model_name;

Returns the UML Model name (C<'Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData'>) for an object or package of
this Classifier.

=cut
sub __model_name { 'Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData' }



=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::Export::Perl::Tangram|UMMF::Export::Perl::Tangram>

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

  $__tangram_schema ||=
  {
   'classes' =>
   [
     'UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData' =>
     {
       'table' => 'Behavioral_Elements__Actions__Read_Write_Actions__Association_Actions__LinkEndData',
       'abstract' => 0,
       'slots' => 
       { 
	 # Attributes
	 
	 # Associations
	 	 	       'end'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::UML_1_5::Foundation::Core::AssociationEnd',

                                             'col' => 'end', 

                                                                                                                   }
      ,
                  	 	                     	 	       'qualifier'
       => {
	 'type_impl' => 'iset',
         'class' => 'UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue',

                           'table' => 'Behavioral_Elements__Actions__Read_Write_Actions__Association_Actions__LinkEndData__qualifier', 

                                                               'coll' => 'linkEndData',

                                             'aggreg' => '1', 

                                           }
      ,
                         },
       'bases' => [  'UMMF::UML_1_5::Foundation::Core::Element',  ],
       '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 
  #   0..*
  #  <--> 
  #  end 1 UMMF::UML_1_5::Foundation::Core::AssociationEnd.
    if ( defined $self->{'end'} ) {
    my $x = $self->{'end'};
    $self->{'end'} = undef;
    $self->set_end($x);
  }
  
  # AssociationEnd 
  #   1
  #  <--> 
  #  qualifier 0..* UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue.
    if ( defined $self->{'qualifier'} ) {
    my $x = $self->{'qualifier'};
        $self->{'qualifier'} = Set::Object->new();
        $self->set_qualifier(@$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_1_5::Foundation::Core::Element');
  }

  $self->UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData::___initialize;
  $self->UMMF::UML_1_5::Foundation::Core::Element::___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_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData::___create(@args);
  $self->UMMF::UML_1_5::Foundation::Core::Element::___create();

  $self;
}




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




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


=for html <hr/>

=cut

#################################################################
# AssociationEnd  <---> end
# type = UMMF::UML_1_5::Foundation::Core::AssociationEnd
# multiplicity = 1
# ordering = 

=head2 C<end>

  my $val = $obj->end;

Returns the AssociationEnd C<end> value of type L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>.

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


=head2 C<set_end>

  $obj->set_end($val);

Sets the AssociationEnd C<end> value.
C<$val> must of type L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>.
Returns C<$obj>.

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

    if ( defined $val ) { $self->__use('UMMF::UML_1_5::Foundation::Core::AssociationEnd')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData.end") }

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

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


=head2 C<add_end>

  $obj->add_end($val);

Adds the AssociationEnd C<end> value.
C<$val> must of type L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>.
Throws exception if a value already exists.
Returns C<$obj>.

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

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

  my $old;
  if ( ($old = $self->{'end'}) ne $val ) { # Recursion lock
    $self->__use('UMMF::UML_1_5::Foundation::Core::AssociationEnd')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData.end");
      
    # confess("UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData::end: too many")
    # if defined $self->{'end'};

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 C<remove_end>

  $obj->remove_end($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 C<clear_end>

  $obj->clear_end;

Clears the AssociationEnd C<end> links to L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
          }

  $self;
}


=head2 C<count_end>

  $obj->count_end;

Returns the number of elements of type L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd> associated with C<end>.

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

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

  defined $x ? 1 : 0;
}




=for html <hr/>

=cut

#################################################################
# AssociationEnd  <---> qualifier
# type = UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue
# multiplicity = 0..*
# ordering = 

=head2 C<qualifier>

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

Returns the AssociationEnd C<qualifier> values of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>.
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'};

  # confess("Container for qualifier $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_qualifier>

  $obj->set_qualifier(@val);

Sets the AssociationEnd C<qualifier> value.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>.
Returns C<$obj>.

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


=head2 C<add_qualifier>

  $obj->add_qualifier(@val);

Adds AssociationEnd C<qualifier> values.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>.
Returns C<$obj>.

=cut
sub add_qualifier ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'qualifier'} ||= 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_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData.qualifier");

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


=head2 C<remove_qualifier>

  $obj->remove_qualifier(@val);

Removes the AssociationEnd C<qualifier> values C<@val>.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>.
Returns C<$obj>.

=cut
sub remove_qualifier ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'qualifier'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::LinkEndData.qualifier");

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

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


=head2 C<clear_qualifier>

  $obj->clear_qualifier;

Clears the AssociationEnd C<qualifier> links to L<UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue|UMMF::UML_1_5::Behavioral_Elements::Actions::Read_Write_Actions::Association_Actions::QualifierValue>.
Returns C<$obj>.

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

        ;

  }
  
  $self;
}


=head2 C<count_qualifier>

  $obj->count_qualifier;

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

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

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

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







# End of Class LinkEndData


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

