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

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


);

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

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





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


=head2 __validate_type

  UML::MetaModel::Model_Management::Package->__validate_type($value);

Returns true if $value is a valid value of UML::MetaModel::Model_Management::Package.

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

  no warnings;

  UNIVERSAL::isa($x, 'UML::MetaModel::Model_Management::Package')  ;
}


=head2 __typecheck

  UML::MetaModel::Model_Management::Package->__typecheck($value, $msg);

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

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

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


=head2 isaPackage

Returns true if receiver is a C<UML::MetaModel::Model_Management::Package>.
Other receivers will return false.

=cut
sub isaPackage { 1 }


=head2 isaModel_Management__Package

Returns true if receiver is a C<UML::MetaModel::Model_Management::Package>.
Other receivers will return false.
This is the fully qualified version of the C<isaPackage> method.

=cut
sub isaModel_Management__Package { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Model_Management::Package' }





# ASSOC: 

  

# 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 
  #   0..*
  #  <--> 
  #  importedElement 0..* UML::MetaModel::Foundation::Core::ModelElement.
    if ( defined $self->{'importedElement'} && @{$self->{'importedElement'}} ) {
    my $x = $self->{'importedElement'};
    $self->{'importedElement'} = [ ];
    $self->set_importedElement(@$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::Namespace');
  }

  $self->UML::MetaModel::Model_Management::Package::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::Namespace::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd  => importedElement
# type = UML::MetaModel::Foundation::Core::ModelElement
# multiplicity = 0..*

=head2 importedElement

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

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


=head2 set_importedElement

  $obj->set_importedElement(@val);

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

=cut
sub set_importedElement ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_importedElement;
  $self->add_importedElement(@val);
}


=head2 add_importedElement

  $obj->add_importedElement(@val);

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

=cut
sub add_importedElement ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'importedElement'} ||= [ ];
  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::ModelElement')->__typecheck($val, "UML::MetaModel::Model_Management::Package.importedElement");

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

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


=head2 remove_importedElement

  $obj->remove_importedElement($val);

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

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

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

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


=head2 clear_importedElement

  $obj->clear_importedElement;

Clears the Association.
Returns C<$obj>.

=cut
sub clear_importedElement ($) 
{
  my ($self) = @_;
  
  my $x = $self->{'importedElement'} ||= [ ];
  my $val; # Place holder for other MACRO.
  
  $self->{'importedElement'} = [ ];  # 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: ###

