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

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


);

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

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





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


=head2 __validate_type

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

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

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

  no warnings;

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


=head2 __typecheck

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

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

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

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


=head2 isaBehavioralFeature

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

=cut
sub isaBehavioralFeature { 1 }


=head2 isaFoundation__Core__BehavioralFeature

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

=cut
sub isaFoundation__Core__BehavioralFeature { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

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




  



# ASSOC: 

  

# ASSOC: context

  


#################################################################
# 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 isQuery
  if ( exists $self->{'isQuery'} ) {
    my $x = $self->{'isQuery'};
    $self->{'isQuery'} = undef;
    $self->set_isQuery($x);
  } else {
      }
  


  # Associations

  # AssociationEnd 
  #   0..1
  #  <--> 
  #  parameter 0..* UML::MetaModel::Foundation::Core::Parameter.
    if ( defined $self->{'parameter'} && @{$self->{'parameter'}} ) {
    my $x = $self->{'parameter'};
    $self->{'parameter'} = [ ];
    $self->set_parameter(@$x);
  }
  
  # AssociationEnd 
  #  context 0..*
  #  <--> 
  #  raisedSignal 0..* UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal.
    if ( defined $self->{'raisedSignal'} && @{$self->{'raisedSignal'}} ) {
    my $x = $self->{'raisedSignal'};
    $self->{'raisedSignal'} = [ ];
    $self->set_raisedSignal(@$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->UML::MetaModel::Foundation::Core::BehavioralFeature::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;
  $self->UML::MetaModel::Foundation::Core::Feature::__initialize;

  $self;
}
      

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



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

=head2 isQuery

  my $val = $obj->isQuery;

Returns the value of Attribute isQuery.

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

  $self->{'isQuery'};
}


=head2 set_isQuery

  $obj->set_isQuery($val);

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

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

  $self->__use('UML::MetaModel::Foundation::Data_Types::Boolean')->__typecheck($val, "UML::MetaModel::Foundation::Core::BehavioralFeature.isQuery");

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

  $self
}


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


#################################################################
# AssociationEnd  => parameter
# type = UML::MetaModel::Foundation::Core::Parameter
# multiplicity = 0..*

=head2 parameter

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

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


=head2 set_parameter

  $obj->set_parameter(@val);

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

=cut
sub set_parameter ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_parameter;
  $self->add_parameter(@val);
}


=head2 add_parameter

  $obj->add_parameter(@val);

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

=cut
sub add_parameter ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'parameter'} ||= [ ];
  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::Parameter')->__typecheck($val, "UML::MetaModel::Foundation::Core::BehavioralFeature.parameter");

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

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


=head2 remove_parameter

  $obj->remove_parameter($val);

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

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

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

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


=head2 clear_parameter

  $obj->clear_parameter;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        ;

  }
  
  $self;
}


#################################################################
# AssociationEnd context => raisedSignal
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal
# multiplicity = 0..*

=head2 raisedSignal

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

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


=head2 set_raisedSignal

  $obj->set_raisedSignal(@val);

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

=cut
sub set_raisedSignal ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_raisedSignal;
  $self->add_raisedSignal(@val);
}


=head2 add_raisedSignal

  $obj->add_raisedSignal(@val);

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

=cut
sub add_raisedSignal ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'raisedSignal'} ||= [ ];
  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::Common_Behavior::Signal')->__typecheck($val, "UML::MetaModel::Foundation::Core::BehavioralFeature.raisedSignal");

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

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

  
  }
  
  $self;
}


=head2 remove_raisedSignal

  $obj->remove_raisedSignal($val);

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

=cut
sub remove_raisedSignal ($@)
{
  my ($self, @val) = @_;
  
  my $x = $self->{'raisedSignal'} ||= [ ];
  
  for my $old ( @val ) {
    next unless grep($_ eq $old, @$x); # Recursion lock
    my $val = $old;
      
    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Signal')->__typecheck($val, "UML::MetaModel::Foundation::Core::BehavioralFeature.raisedSignal");

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

    # Remove associations with other ends.

        
    $old->remove_context($self) if $old;
    $val->add_context($self)    if $val;

  ;

  }
  
  $self;
}


=head2 clear_raisedSignal

  $obj->clear_raisedSignal;

Clears the Association.
Returns C<$obj>.

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

    # Remove associations with other ends.

        
    $old->remove_context($self) if $old;
    $val->add_context($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: ###

