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

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


);

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

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





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


=head2 __validate_type

  UML::MetaModel::Foundation::Core::TemplateParameter->__validate_type($value);

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

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

  no warnings;

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


=head2 __typecheck

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

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

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

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


=head2 isaTemplateParameter

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

=cut
sub isaTemplateParameter { 1 }


=head2 isaFoundation__Core__TemplateParameter

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

=cut
sub isaFoundation__Core__TemplateParameter { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

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





# ASSOC: 

  

# 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..*
  #  <--> 
  #  defaultElement 0..1 UML::MetaModel::Foundation::Core::ModelElement.
    if ( defined $self->{'defaultElement'} ) {
    my $x = $self->{'defaultElement'};
    $self->{'defaultElement'} = undef;
    $self->set_defaultElement($x);
  }
  
  # AssociationEnd 
  #   1
  #  <--> 
  #  templateParameter 1 UML::MetaModel::Foundation::Core::ModelElement.
    if ( defined $self->{'templateParameter'} ) {
    my $x = $self->{'templateParameter'};
    $self->{'templateParameter'} = undef;
    $self->set_templateParameter($x);
  }
  
  # AssociationEnd 
  #   1
  #  <--> 
  #  template 1 UML::MetaModel::Foundation::Core::ModelElement.
    if ( defined $self->{'template'} ) {
    my $x = $self->{'template'};
    $self->{'template'} = undef;
    $self->set_template($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->UML::MetaModel::Foundation::Core::TemplateParameter::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd  => defaultElement
# type = UML::MetaModel::Foundation::Core::ModelElement
# multiplicity = 0..1

=head2 defaultElement

  my $val = $obj->defaultElement;

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

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


=head2 set_defaultElement

  $obj->set_defaultElement($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::ModelElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::TemplateParameter.defaultElement");

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


=head2 add_defaultElement

  $obj->add_defaultElement($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_defaultElement

  $obj->remove_defaultElement($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_defaultElement

  $obj->clear_defaultElement;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd  => templateParameter
# type = UML::MetaModel::Foundation::Core::ModelElement
# multiplicity = 1

=head2 templateParameter

  my $val = $obj->templateParameter;

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

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


=head2 set_templateParameter

  $obj->set_templateParameter($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::ModelElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::TemplateParameter.templateParameter");

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


=head2 add_templateParameter

  $obj->add_templateParameter($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_templateParameter

  $obj->remove_templateParameter($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_templateParameter

  $obj->clear_templateParameter;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd  => template
# type = UML::MetaModel::Foundation::Core::ModelElement
# multiplicity = 1

=head2 template

  my $val = $obj->template;

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

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


=head2 set_template

  $obj->set_template($val);

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

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

    $self->__use('UML::MetaModel::Foundation::Core::ModelElement')->__typecheck($val, "UML::MetaModel::Foundation::Core::TemplateParameter.template");

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


=head2 add_template

  $obj->add_template($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_template

  $obj->remove_template($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_template

  $obj->clear_template;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add 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: ###

