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

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::State_Machines::Transition->__validate_type($value);

Returns true if $value is a valid value of UML::MetaModel::Behavioral_Elements::State_Machines::Transition.

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

  no warnings;

  UNIVERSAL::isa($x, 'UML::MetaModel::Behavioral_Elements::State_Machines::Transition')  ;
}


=head2 __typecheck

  UML::MetaModel::Behavioral_Elements::State_Machines::Transition->__typecheck($value, $msg);

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

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

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


=head2 isaTransition

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

=cut
sub isaTransition { 1 }


=head2 isaBehavioral_Elements__State_Machines__Transition

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

=cut
sub isaBehavioral_Elements__State_Machines__Transition { 1 }


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

=head2 __model_name 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Behavioral_Elements::State_Machines::Transition' }





# ASSOC: transitions
# ASSOC: 

  

# ASSOC: internalTransition
# ASSOC: 

  

# ASSOC: 

  

# ASSOC: outgoing

  

# ASSOC: incoming

  


#################################################################
# 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 
  #   1
  #  <--> 
  #  guard 0..1 UML::MetaModel::Behavioral_Elements::State_Machines::Guard.
    if ( defined $self->{'guard'} ) {
    my $x = $self->{'guard'};
    $self->{'guard'} = undef;
    $self->set_guard($x);
  }
  
  # AssociationEnd 
  #   0..1
  #  <--> 
  #  effect 0..1 UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure.
    if ( defined $self->{'effect'} ) {
    my $x = $self->{'effect'};
    $self->{'effect'} = undef;
    $self->set_effect($x);
  }
  
  # AssociationEnd 
  #   0
  #  <--> 
  #  trigger 0..1 UML::MetaModel::Behavioral_Elements::State_Machines::Event.
    if ( defined $self->{'trigger'} ) {
    my $x = $self->{'trigger'};
    $self->{'trigger'} = undef;
    $self->set_trigger($x);
  }
  
  # AssociationEnd 
  #  outgoing 0..*
  #  <--> 
  #  source 1 UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex.
    if ( defined $self->{'source'} ) {
    my $x = $self->{'source'};
    $self->{'source'} = undef;
    $self->set_source($x);
  }
  
  # AssociationEnd 
  #  incoming 0..*
  #  <--> 
  #  target 1 UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex.
    if ( defined $self->{'target'} ) {
    my $x = $self->{'target'};
    $self->{'target'} = undef;
    $self->set_target($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::State_Machines::Transition::__initialize;
  $self->UML::MetaModel::Foundation::Core::Element::__initialize;
  $self->UML::MetaModel::Foundation::Core::ModelElement::__initialize;

  $self;
}
      

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




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


#################################################################
# AssociationEnd  => guard
# type = UML::MetaModel::Behavioral_Elements::State_Machines::Guard
# multiplicity = 0..1

=head2 guard

  my $val = $obj->guard;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::State_Machines::Guard>.

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


=head2 set_guard

  $obj->set_guard($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::State_Machines::Guard')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::State_Machines::Transition.guard");

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


=head2 add_guard

  $obj->add_guard($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_guard

  $obj->remove_guard($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_guard

  $obj->clear_guard;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd  => effect
# type = UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure
# multiplicity = 0..1

=head2 effect

  my $val = $obj->effect;

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

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


=head2 set_effect

  $obj->set_effect($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::Common_Behavior::Procedure')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::State_Machines::Transition.effect");

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


=head2 add_effect

  $obj->add_effect($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_effect

  $obj->remove_effect($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_effect

  $obj->clear_effect;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd  => trigger
# type = UML::MetaModel::Behavioral_Elements::State_Machines::Event
# multiplicity = 0..1

=head2 trigger

  my $val = $obj->trigger;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::State_Machines::Event>.

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


=head2 set_trigger

  $obj->set_trigger($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::State_Machines::Event')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::State_Machines::Transition.trigger");

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


=head2 add_trigger

  $obj->add_trigger($val);

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

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

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

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}


=head2 remove_trigger

  $obj->remove_trigger($val);

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

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

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

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

    # Remove and add associations with other ends.
        
  }
}


=head2 clear_trigger

  $obj->clear_trigger;

Clears the Association.
Returns C<$obj>.

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

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

    # Remove and add associations with other ends.
        
  }

  $self;
}




#################################################################
# AssociationEnd outgoing => source
# type = UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex
# multiplicity = 1

=head2 source

  my $val = $obj->source;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex>.

=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::State_Machines::StateVertex>.
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::State_Machines::StateVertex')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::State_Machines::Transition.source");

    $self->{'source'} = $val;                 # Recursion lock
    # Remove and add associations with other ends.
        
    $old->remove_outgoing($self) if $old;
    $val->add_outgoing($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::State_Machines::StateVertex>.
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::State_Machines::StateVertex')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::State_Machines::Transition.source");
      
    # confess("UML::MetaModel::Behavioral_Elements::State_Machines::Transition::source: too many")
    # if defined $self->{'source'};

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

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

  
  }

  $self;
}




#################################################################
# AssociationEnd incoming => target
# type = UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex
# multiplicity = 1

=head2 target

  my $val = $obj->target;

Returns the AssociationEnd value of type C<UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex>.

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


=head2 set_target

  $obj->set_target($val);

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

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

    $self->__use('UML::MetaModel::Behavioral_Elements::State_Machines::StateVertex')->__typecheck($val, "UML::MetaModel::Behavioral_Elements::State_Machines::Transition.target");

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

    }
		  
  $self;
}


=head2 add_target

  $obj->add_target($val);

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

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

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

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

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

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

  
  }

  $self;
}


=head2 remove_target

  $obj->remove_target($val);

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

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

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

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

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

  
  }
}


=head2 clear_target

  $obj->clear_target;

Clears the Association.
Returns C<$obj>.

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

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

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

