# -*- 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::Use_Cases::Include;

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


);

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

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





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


=head2 __validate_type

  UML::MetaModel::Behavioral_Elements::Use_Cases::Include->__validate_type($value);

Returns true if $value is a valid value of UML::MetaModel::Behavioral_Elements::Use_Cases::Include.

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

  no warnings;

  UNIVERSAL::isa($x, 'UML::MetaModel::Behavioral_Elements::Use_Cases::Include')  ;
}


=head2 __typecheck

  UML::MetaModel::Behavioral_Elements::Use_Cases::Include->__typecheck($value, $msg);

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

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

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


=head2 isaInclude

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

=cut
sub isaInclude { 1 }


=head2 isaBehavioral_Elements__Use_Cases__Include

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

=cut
sub isaBehavioral_Elements__Use_Cases__Include { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Behavioral_Elements::Use_Cases::Include' }





# ASSOC: 

  

# ASSOC: include

  


#################################################################
# 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..*
  #  <--> 
  #  addition 1 UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.
    if ( defined $self->{'addition'} ) {
    my $x = $self->{'addition'};
    $self->{'addition'} = undef;
    $self->set_addition($x);
  }
  
  # AssociationEnd 
  #  include 0..*
  #  <--> 
  #  base 1 UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.
    if ( defined $self->{'base'} ) {
    my $x = $self->{'base'};
    $self->{'base'} = undef;
    $self->set_base($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->__use('UML::MetaModel::Foundation::Core::Relationship');
  }

  $self->UML::MetaModel::Behavioral_Elements::Use_Cases::Include::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::Relationship::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd  => addition
# type = UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase
# multiplicity = 1

=head2 addition

  my $val = $obj->addition;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase>.

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


=head2 set_addition

  $obj->set_addition($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::Include.addition");

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


=head2 add_addition

  $obj->add_addition($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_addition

  $obj->remove_addition($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_addition

  $obj->clear_addition;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd include => base
# type = UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase
# multiplicity = 1

=head2 base

  my $val = $obj->base;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase>.

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


=head2 set_base

  $obj->set_base($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::Include.base");

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

    }
		  
  $self;
}


=head2 add_base

  $obj->add_base($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_base

  $obj->remove_base($val);

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

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

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

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

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

  
  }
}


=head2 clear_base

  $obj->clear_base;

Clears the Association.
Returns C<$obj>.

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

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

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

