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

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


);

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

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





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


=head2 __validate_type

  UML::MetaModel::Behavioral_Elements::Actions::DataFlow->__validate_type($value);

Returns true if $value is a valid value of UML::MetaModel::Behavioral_Elements::Actions::DataFlow.

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

  no warnings;

  UNIVERSAL::isa($x, 'UML::MetaModel::Behavioral_Elements::Actions::DataFlow')  ;
}


=head2 __typecheck

  UML::MetaModel::Behavioral_Elements::Actions::DataFlow->__typecheck($value, $msg);

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

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

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


=head2 isaDataFlow

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

=cut
sub isaDataFlow { 1 }


=head2 isaBehavioral_Elements__Actions__DataFlow

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

=cut
sub isaBehavioral_Elements__Actions__DataFlow { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Behavioral_Elements::Actions::DataFlow' }





# ASSOC: flow

  

# ASSOC: flow

  


#################################################################
# 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 
  #  flow 0..*
  #  <--> 
  #  source 1 UML::MetaModel::Behavioral_Elements::Actions::OutputPin.
    if ( defined $self->{'source'} ) {
    my $x = $self->{'source'};
    $self->{'source'} = undef;
    $self->set_source($x);
  }
  
  # AssociationEnd 
  #  flow 1
  #  <--> 
  #  destination 1 UML::MetaModel::Behavioral_Elements::Actions::InputPin.
    if ( defined $self->{'destination'} ) {
    my $x = $self->{'destination'};
    $self->{'destination'} = undef;
    $self->set_destination($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->UML::MetaModel::Behavioral_Elements::Actions::DataFlow::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd flow => source
# type = UML::MetaModel::Behavioral_Elements::Actions::OutputPin
# multiplicity = 1

=head2 source

  my $val = $obj->source;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Actions::OutputPin>.

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


=head2 set_source

  $obj->set_source($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Actions::OutputPin')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Actions::DataFlow.source");

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

    }
		  
  $self;
}


=head2 add_source

  $obj->add_source($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_source

  $obj->remove_source($val);

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

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

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

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

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

  
  }
}


=head2 clear_source

  $obj->clear_source;

Clears the Association.
Returns C<$obj>.

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

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

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

  
  }

  $self;
}




#################################################################
# AssociationEnd flow => destination
# type = UML::MetaModel::Behavioral_Elements::Actions::InputPin
# multiplicity = 1

=head2 destination

  my $val = $obj->destination;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::Actions::InputPin>.

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


=head2 set_destination

  $obj->set_destination($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Actions::InputPin')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::Actions::DataFlow.destination");

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

    }
		  
  $self;
}


=head2 add_destination

  $obj->add_destination($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_destination

  $obj->remove_destination($val);

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

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

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

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

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

  
  }
}


=head2 clear_destination

  $obj->clear_destination;

Clears the Association.
Returns C<$obj>.

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

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

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

