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

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


);

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

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





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


=head2 __validate_type

  UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception->__validate_type($value);

Returns true if $value is a valid value of UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception.

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

  no warnings;

  UNIVERSAL::isa($x, 'UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception')  ;
}


=head2 __typecheck

  UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception->__typecheck($value, $msg);

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

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

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


=head2 isaReception

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

=cut
sub isaReception { 1 }


=head2 isaBehavioral_Elements__Common_Behavior__Reception

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

=cut
sub isaBehavioral_Elements__Common_Behavior__Reception { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Behavioral_Elements::Common_Behavior::Reception' }




  


  


  


  



# ASSOC: reception

  


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

    # Attribute specification
  if ( exists $self->{'specification'} ) {
    my $x = $self->{'specification'};
    $self->{'specification'} = undef;
    $self->set_specification($x);
  } else {
      }
  
    # Attribute isRoot
  if ( exists $self->{'isRoot'} ) {
    my $x = $self->{'isRoot'};
    $self->{'isRoot'} = undef;
    $self->set_isRoot($x);
  } else {
      }
  
    # Attribute isLeaf
  if ( exists $self->{'isLeaf'} ) {
    my $x = $self->{'isLeaf'};
    $self->{'isLeaf'} = undef;
    $self->set_isLeaf($x);
  } else {
      }
  
    # Attribute isAbstract
  if ( exists $self->{'isAbstract'} ) {
    my $x = $self->{'isAbstract'};
    $self->{'isAbstract'} = undef;
    $self->set_isAbstract($x);
  } else {
      }
  


  # Associations

  # AssociationEnd 
  #  reception 0..*
  #  <--> 
  #  signal 1 UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal.
    if ( defined $self->{'signal'} ) {
    my $x = $self->{'signal'};
    $self->{'signal'} = undef;
    $self->set_signal($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::Feature');
    $self->__use('UML::MetaModel::Foundation::Core::BehavioralFeature');
  }

  $self->UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::Feature::__initialize;
  $self->UML::MetaModel::Foundation::Core::BehavioralFeature::__initialize;

  $self;
}
      

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



#################################################################
# Attribute specification
# type = UML::MetaModel::Foundation::Data_Types::String
# multiplicity = 1

=head2 specification

  my $val = $obj->specification;

Returns the value of Attribute specification.

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

  $self->{'specification'};
}


=head2 set_specification

  $obj->set_specification($val);

Sets the value of Attribute specification.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::String>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::String')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception.specification");

  $self->{'specification'} = $val;

  $self
}

#################################################################
# Attribute isRoot
# type = UML::MetaModel::Foundation::Data_Types::Boolean
# multiplicity = 1

=head2 isRoot

  my $val = $obj->isRoot;

Returns the value of Attribute isRoot.

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

  $self->{'isRoot'};
}


=head2 set_isRoot

  $obj->set_isRoot($val);

Sets the value of Attribute isRoot.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::Boolean>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Boolean')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception.isRoot");

  $self->{'isRoot'} = $val;

  $self
}

#################################################################
# Attribute isLeaf
# type = UML::MetaModel::Foundation::Data_Types::Boolean
# multiplicity = 1

=head2 isLeaf

  my $val = $obj->isLeaf;

Returns the value of Attribute isLeaf.

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

  $self->{'isLeaf'};
}


=head2 set_isLeaf

  $obj->set_isLeaf($val);

Sets the value of Attribute isLeaf.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::Boolean>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Boolean')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception.isLeaf");

  $self->{'isLeaf'} = $val;

  $self
}

#################################################################
# Attribute isAbstract
# type = UML::MetaModel::Foundation::Data_Types::Boolean
# multiplicity = 1

=head2 isAbstract

  my $val = $obj->isAbstract;

Returns the value of Attribute isAbstract.

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

  $self->{'isAbstract'};
}


=head2 set_isAbstract

  $obj->set_isAbstract($val);

Sets the value of Attribute isAbstract.
C<$val> must be of type C<UML::MetaModel::Foundation::Data_Types::Boolean>.
Returns C<$obj>.

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Boolean')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception.isAbstract");

  $self->{'isAbstract'} = $val;

  $self
}


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


#################################################################
# AssociationEnd reception => signal
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal
# multiplicity = 1

=head2 signal

  my $val = $obj->signal;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal>.

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


=head2 set_signal

  $obj->set_signal($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Common_Behavior::Reception.signal");

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

    }
		  
  $self;
}


=head2 add_signal

  $obj->add_signal($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_signal

  $obj->remove_signal($val);

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

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

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

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

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

  
  }
}


=head2 clear_signal

  $obj->clear_signal;

Clears the Association.
Returns C<$obj>.

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

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

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

