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

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


);

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

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





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


=head2 __validate_type

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

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

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

  no warnings;

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


=head2 __typecheck

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

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

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

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


=head2 isaUseCase

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

=cut
sub isaUseCase { 1 }


=head2 isaBehavioral_Elements__Use_Cases__UseCase

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

=cut
sub isaBehavioral_Elements__Use_Cases__UseCase { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

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





# ASSOC: addition
# ASSOC: base

  

# ASSOC: extension

  

# ASSOC: base
# ASSOC: 

  


#################################################################
# 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 
  #  base 1
  #  <--> 
  #  include 0..* UML::MetaModel::Behavioral_Elements::Use_Cases::Include.
    if ( defined $self->{'include'} && @{$self->{'include'}} ) {
    my $x = $self->{'include'};
    $self->{'include'} = [ ];
    $self->set_include(@$x);
  }
  
  # AssociationEnd 
  #  extension 1
  #  <--> 
  #  extended 0..* UML::MetaModel::Behavioral_Elements::Use_Cases::Extend.
    if ( defined $self->{'extended'} && @{$self->{'extended'}} ) {
    my $x = $self->{'extended'};
    $self->{'extended'} = [ ];
    $self->set_extended(@$x);
  }
  
  # AssociationEnd 
  #   1
  #  <--> 
  #  extensionPoint 0..* UML::MetaModel::Behavioral_Elements::Use_Cases::ExtensionPoint.
    if ( defined $self->{'extensionPoint'} && @{$self->{'extensionPoint'}} ) {
    my $x = $self->{'extensionPoint'};
    $self->{'extensionPoint'} = [ ];
    $self->set_extensionPoint(@$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::Namespace');
    $self->__use('UML::MetaModel::Foundation::Core::Element');
    $self->__use('UML::MetaModel::Foundation::Core::ModelElement');
    $self->__use('UML::MetaModel::Foundation::Core::GeneralizableElement');
    $self->__use('UML::MetaModel::Foundation::Core::Classifier');
  }

  $self->UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase::__initialize;
  $self->UML::MetaModel::Foundation::Core::Namespace::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::GeneralizableElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::Classifier::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd base => include
# type = UML::MetaModel::Behavioral_Elements::Use_Cases::Include
# multiplicity = 0..*

=head2 include

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

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


=head2 set_include

  $obj->set_include(@val);

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

=cut
sub set_include ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_include;
  $self->add_include(@val);
}


=head2 add_include

  $obj->add_include(@val);

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

=cut
sub add_include ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'include'} ||= [ ];
  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::Use_Cases::Include')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.include");

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

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

  
  }
  
  $self;
}


=head2 remove_include

  $obj->remove_include($val);

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

=cut
sub remove_include ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'include'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Use_Cases::Include')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.include");

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

    # Remove associations with other ends.

        
    $old->remove_base($self) if $old;
    $val->add_base($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_include

  $obj->clear_include;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_base($self) if $old;
    $val->add_base($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd extension => extended
# type = UML::MetaModel::Behavioral_Elements::Use_Cases::Extend
# multiplicity = 0..*

=head2 extended

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

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


=head2 set_extended

  $obj->set_extended(@val);

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

=cut
sub set_extended ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_extended;
  $self->add_extended(@val);
}


=head2 add_extended

  $obj->add_extended(@val);

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

=cut
sub add_extended ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'extended'} ||= [ ];
  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::Use_Cases::Extend')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.extended");

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

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

  
  }
  
  $self;
}


=head2 remove_extended

  $obj->remove_extended($val);

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

=cut
sub remove_extended ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'extended'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Use_Cases::Extend')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.extended");

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

    # Remove associations with other ends.

        
    $old->remove_extension($self) if $old;
    $val->add_extension($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_extended

  $obj->clear_extended;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_extension($self) if $old;
    $val->add_extension($self)    if $val;

  ;

  }
  
  $self;
}


#################################################################
# AssociationEnd  => extensionPoint
# type = UML::MetaModel::Behavioral_Elements::Use_Cases::ExtensionPoint
# multiplicity = 0..*

=head2 extensionPoint

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

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


=head2 set_extensionPoint

  $obj->set_extensionPoint(@val);

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

=cut
sub set_extensionPoint ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_extensionPoint;
  $self->add_extensionPoint(@val);
}


=head2 add_extensionPoint

  $obj->add_extensionPoint(@val);

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

=cut
sub add_extensionPoint ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'extensionPoint'} ||= [ ];
  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::Use_Cases::ExtensionPoint')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.extensionPoint");

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

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


=head2 remove_extensionPoint

  $obj->remove_extensionPoint($val);

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

=cut
sub remove_extensionPoint ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'extensionPoint'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Use_Cases::ExtensionPoint')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Use_Cases::UseCase.extensionPoint");

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

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


=head2 clear_extensionPoint

  $obj->clear_extensionPoint;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        ;

  }
  
  $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: ###

