# -*- perl -*-
# DO NOT EDIT - This file is generated by UMMF; http://ummf.sourceforge.net 
# From template: $Id: Perl.txt,v 1.77 2006/05/14 01:40:03 kstephens Exp $

package UMMF::MOF_1_4_1::Model::ModelElement;

#use 5.6.1;
use strict;
use warnings;

#################################################################
# Version
#

our $VERSION = do { my @r = (q{1.4.1} =~ /\d+/g); sprintf "%d." . "%03d" x $#r, @r };


#################################################################
# Documentation
#

=head1 NAME

UMMF::MOF_1_4_1::Model::ModelElement -- 

=head1 VERSION

1.4.1

=head1 SYNOPSIS

=head1 DESCRIPTION 

=head1 USAGE

=head1 EXPORT

=head1 METATYPE

L<UMMF::UML_1_5::Foundation::Core::Class|UMMF::UML_1_5::Foundation::Core::Class>

=head1 SUPERCLASSES

L<UMMF::MOF_1_4_1::__ObjectBase|UMMF::MOF_1_4_1::__ObjectBase>




=head1 ATTRIBUTES


=head2 C<name> : UMMF::MOF_1_4_1::Model::String 


=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::Attribute|UMMF::UML_1_5::Foundation::Core::Attribute>

=item type = L<UMMF::MOF_1_4_1::Model::String|UMMF::MOF_1_4_1::Model::String>

=item visibility = C<private>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<unordered>

=item initialValue = I<UNSPECIFIED>

=item container_type = C<Set::Object>

=back


=head2 C<annotation> : UMMF::MOF_1_4_1::Model::String 


=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::Attribute|UMMF::UML_1_5::Foundation::Core::Attribute>

=item type = L<UMMF::MOF_1_4_1::Model::String|UMMF::MOF_1_4_1::Model::String>

=item visibility = C<private>

=item multiplicity = C<1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<unordered>

=item initialValue = I<UNSPECIFIED>

=item container_type = C<Set::Object>

=back



=head1 ASSOCIATIONS


=head2 C<constrainedElement> : I<THIS> C<1..*> E<lt>---E<gt>  C<constraint> : UMMF::MOF_1_4_1::Model::Constraint C<0..*>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::MOF_1_4_1::Model::Constraint|UMMF::MOF_1_4_1::Model::Constraint>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<containedElement> : I<THIS> C<0..*> E<lt>---E<gt>  C<container> : UMMF::MOF_1_4_1::Model::Namespace C<0..1>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::MOF_1_4_1::Model::Namespace|UMMF::MOF_1_4_1::Model::Namespace>

=item multiplicity = C<0..1>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<composite>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<provider> : I<THIS> C<0..*> E<lt>---E<gt>  C<dependent> : UMMF::MOF_1_4_1::Model::ModelElement C<0..*>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<dependent> : I<THIS> C<0..*> E<lt>---E<gt>  C<provider> : UMMF::MOF_1_4_1::Model::ModelElement C<0..*>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<Set::Object>

=back


=head2 C<modelElement> : I<THIS> C<1..*> E<lt>---E<gt>  C<tag> : UMMF::MOF_1_4_1::Model::Tag C<0..*>



=over 4

=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>

=item type = L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>

=item multiplicity = C<0..*>

=item changeability = C<changeable>

=item targetScope = C<instance>

=item ordering = C<ordered>

=item isNavigable = C<1>

=item aggregation = C<none>

=item visibility = C<public>

=item container_type = C<ARRAY>

=back



=head1 METHODS

=cut



#################################################################
# Dependencies
#





use Carp qw(croak confess);
use Set::Object 1.05;
use Class::Multimethods 1.70;
use Data::Dumper;
use Scalar::Util qw(weaken);
use UMMF::MOF_1_4_1::__ObjectBase qw(:__ummf_array);


#################################################################
# Generalizations
#

use base qw(


  UMMF::MOF_1_4_1::__ObjectBase

);


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

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





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


=head2 C<__validate_type>

  UMMF::MOF_1_4_1::Model::ModelElement->__validate_type($value);

Returns true if C<$value> is a valid representation of L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.

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

  no warnings;

  UNIVERSAL::isa($x, 'UMMF::MOF_1_4_1::Model::ModelElement')  ;
}


=head2 C<__typecheck>

  UMMF::MOF_1_4_1::Model::ModelElement->__typecheck($value, $msg);

Calls C<confess()> with C<$msg> if C<<UMMF::MOF_1_4_1::Model::ModelElement->__validate_type($value)>> is false.

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

  confess("typecheck: $msg: type '" . 'UMMF::MOF_1_4_1::Model::ModelElement' . ": value '$x'")
    unless __validate_type($self, $x);
}


=head2 C<isaModelElement>


Returns true if receiver is a L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Other receivers will return false.

=cut
sub isaModelElement { 1 }


=head2 C<isaModel__ModelElement>


Returns true if receiver is a L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Other receivers will return false.
This is the fully qualified version of the C<isaModelElement> method.

=cut
sub isaModel__ModelElement { 1 }


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

=head2 C<__model_name> 

  my $name = $obj_or_package->__model_name;

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

=cut
sub __model_name { 'Model::ModelElement' }



=head2 C<__isAbstract>

  $package->__isAbstract;

Returns C<1>.

=cut
sub __isAbstract { 1; }


my $__tangram_schema;
=head2 C<__tangram_schema>

  my $tangram_schema $obj_or_package->__tangram_schema

Returns a HASH ref that describes this Classifier for Tangram.

See L<UMMF::Export::Perl::Tangram|UMMF::Export::Perl::Tangram>

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

  $__tangram_schema ||=
  {
   'classes' =>
   [
     'UMMF::MOF_1_4_1::Model::ModelElement' =>
     {
       'table' => 'Model__ModelElement',
       'abstract' => 1,
       'slots' => 
       { 
	 # Attributes
	 	       'name'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::MOF_1_4_1::Model::String',

                                             'col' => 'name', 

                                                                                                                   }
      ,
         	       'annotation'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::MOF_1_4_1::Model::String',

                                             'col' => 'annotation', 

                                                                                                                   }
      ,
         
	 # Associations
	 	 	       'constraint'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::MOF_1_4_1::Model::Constraint',

                           'table' => 'Model__Constrains', 

                                                      'item' => 'constraint', 

                  'coll' => 'constrainedElement',

                                                                               }
      ,
                  	 	       'container'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::MOF_1_4_1::Model::Namespace',

                  'null' => '1', 

                                    'col' => 'container', 

                                                                                                                   }
      ,
                  	 	       'dependent'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::MOF_1_4_1::Model::ModelElement',

                           'table' => 'Model__ModelElement__DependsOn', 

                                                      'item' => 'dependent', 

                  'coll' => 'provider',

                                                                               }
      ,
                  	 	       'provider'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::MOF_1_4_1::Model::ModelElement',

                           'table' => 'Model__ModelElement__DependsOn', 

                                                      'item' => 'provider', 

                  'coll' => 'dependent',

                                                                               }
      ,
                  	 	       'tag'
       => {
	 'type_impl' => 'array',
         'class' => 'UMMF::MOF_1_4_1::Model::Tag',

                           'table' => 'Model__AttachesTo', 

                                                      'item' => 'tag', 

                  'coll' => 'modelElement',

                  'slot' => 'tag_i', 

                                                                      }
      ,
                         },
       'bases' => [  ],
       'sql' => {

       },
     },
   ],

   'sql' =>
   {
    # Note Tangram::Ref::get_exporter() has
    # "UPDATE $table SET $self->{col} = $refid WHERE id = $id",
    # The id_col is hard-coded, 
    # Thus id_col will not work.
    #'id_col' => '__sid',
    #'class_col' => '__stype',
   },
     # 'set_id' => sub { }
     # 'get_id' => sub { }

      
  };
}


#################################################################
# Class Attributes
#


        

#################################################################
# Class Associations
#


    

#################################################################
# Initialization
#


=head2 C<___initialize>

Initialize all Attributes and AssociationEnds in a instance of this Classifier.
Does B<not> initalize slots in its Generalizations.

See also: C<__initialize>.

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

  # Attributes

    # Attribute name
  if ( exists $self->{'name'} ) {
    my $x = $self->{'name'};
    $self->{'name'} = undef;
        $self->set_name($x);
      } else {
      }
  
    # Attribute annotation
  if ( exists $self->{'annotation'} ) {
    my $x = $self->{'annotation'};
    $self->{'annotation'} = undef;
        $self->set_annotation($x);
      } else {
      }
  


  # Associations

  # AssociationEnd 
  #  constrainedElement 1..*
  #  <--> 
  #  constraint 0..* UMMF::MOF_1_4_1::Model::Constraint.
    if ( defined $self->{'constraint'} ) {
    my $x = $self->{'constraint'};
        $self->{'constraint'} = Set::Object->new();
        $self->set_constraint(@$x);
  }
  
  # AssociationEnd 
  #  containedElement 0..*
  #  <--> 
  #  container 0..1 UMMF::MOF_1_4_1::Model::Namespace.
    if ( defined $self->{'container'} ) {
    my $x = $self->{'container'};
    $self->{'container'} = undef;
    $self->set_container($x);
  }
  
  # AssociationEnd 
  #  provider 0..*
  #  <--> 
  #  dependent 0..* UMMF::MOF_1_4_1::Model::ModelElement.
    if ( defined $self->{'dependent'} ) {
    my $x = $self->{'dependent'};
        $self->{'dependent'} = Set::Object->new();
        $self->set_dependent(@$x);
  }
  
  # AssociationEnd 
  #  dependent 0..*
  #  <--> 
  #  provider 0..* UMMF::MOF_1_4_1::Model::ModelElement.
    if ( defined $self->{'provider'} ) {
    my $x = $self->{'provider'};
        $self->{'provider'} = Set::Object->new();
        $self->set_provider(@$x);
  }
  
  # AssociationEnd 
  #  modelElement 1..*
  #  <--> 
  #  tag 0..* UMMF::MOF_1_4_1::Model::Tag.
    if ( defined $self->{'tag'} ) {
    my $x = $self->{'tag'};
        $self->{'tag'} = [ ];
        $self->set_tag(@$x);
  }
  

  $self;
}


my $__initialize_use;

=head2 C<__initialize>

Initialize all slots in this Classifier and all its Generalizations.

See also: C<___initialize>.

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

  # $DB::single = 1;

  unless ( ! $__initialize_use ) {
    $__initialize_use = 1;
  }

  $self->UMMF::MOF_1_4_1::Model::ModelElement::___initialize;

  $self;
}
      

=head2 C<__create>

Calls all <<create>> Methods for this Classifier and all Generalizations.

See also: C<___create>.

=cut
sub __create
{
  my ($self, @args) = @_;

  # $DB::single = 1;
  $self->UMMF::MOF_1_4_1::Model::ModelElement::___create(@args);

  $self;
}




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



=for html <hr/>

=cut

#################################################################
# Attribute name
# type = UMMF::MOF_1_4_1::Model::String
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = 

=head2 C<name>

  my $val = $obj->name;

Returns the L<UMMF::MOF_1_4_1::Model::String|UMMF::MOF_1_4_1::Model::String> value of Attribute C<name>.

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

  ;

  my $val = $self->{'name'};

  ;

  $val;
}


=head2 C<set_name>

  $obj->set_name($val);

Sets the value of Attribute C<name>.
C<$val> must be of type L<UMMF::MOF_1_4_1::Model::String|UMMF::MOF_1_4_1::Model::String> or C<undef>.
Returns C<$obj>.

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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


=head2 C<count_name>

  $obj->count_name;

Returns the number of elements (0 or 1) in C<name>.

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

  ;

  my $val = $self->{'name'};

  ;

  defined $val ? 1 : 0;
}



=for html <hr/>

=cut

#################################################################
# Attribute annotation
# type = UMMF::MOF_1_4_1::Model::String
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = 

=head2 C<annotation>

  my $val = $obj->annotation;

Returns the L<UMMF::MOF_1_4_1::Model::String|UMMF::MOF_1_4_1::Model::String> value of Attribute C<annotation>.

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

  ;

  my $val = $self->{'annotation'};

  ;

  $val;
}


=head2 C<set_annotation>

  $obj->set_annotation($val);

Sets the value of Attribute C<annotation>.
C<$val> must be of type L<UMMF::MOF_1_4_1::Model::String|UMMF::MOF_1_4_1::Model::String> or C<undef>.
Returns C<$obj>.

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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


=head2 C<count_annotation>

  $obj->count_annotation;

Returns the number of elements (0 or 1) in C<annotation>.

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

  ;

  my $val = $self->{'annotation'};

  ;

  defined $val ? 1 : 0;
}




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


=for html <hr/>

=cut

#################################################################
# AssociationEnd constrainedElement <---> constraint
# type = UMMF::MOF_1_4_1::Model::Constraint
# multiplicity = 0..*
# ordering = 

=head2 C<constraint>

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

Returns the AssociationEnd C<constraint> values of type L<UMMF::MOF_1_4_1::Model::Constraint|UMMF::MOF_1_4_1::Model::Constraint>.
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 constraint ($)
{
  my ($self) = @_;

    my $x = $self->{'constraint'};

  # confess("Container for constraint $x is not a blessed ref: " . Data::Dumper->new([ $self ], [qw($self)])->Maxdepth(2)->Dump()) if $x && ref($x) !~ /::/;
 
  wantarray ? ($x ? $x->members() : ()) : [ $x ? $x->members() : () ];
  
}


=head2 C<set_constraint>

  $obj->set_constraint(@val);

Sets the AssociationEnd C<constraint> value.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Constraint|UMMF::MOF_1_4_1::Model::Constraint>.
Returns C<$obj>.

=cut
sub set_constraint ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_constraint;
  $self->add_constraint(@val);
}


=head2 C<add_constraint>

  $obj->add_constraint(@val);

Adds AssociationEnd C<constraint> values.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Constraint|UMMF::MOF_1_4_1::Model::Constraint>.
Returns C<$obj>.

=cut
sub add_constraint ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'constraint'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::MOF_1_4_1::Model::Constraint')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.constraint");

    # Recursion lock
        $x->insert($val);
    # weaken?
    
    # Remove and add associations with other ends.
        
    $old->remove_constrainedElement($self) if $old;
    $val->add_constrainedElement($self)    if $val;

    }
  
  $self;
}


=head2 C<remove_constraint>

  $obj->remove_constraint(@val);

Removes the AssociationEnd C<constraint> values C<@val>.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Constraint|UMMF::MOF_1_4_1::Model::Constraint>.
Returns C<$obj>.

=cut
sub remove_constraint ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'constraint'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::MOF_1_4_1::Model::Constraint')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.constraint");

    # Recursion lock
        $x->remove($old);
    
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_constrainedElement($self) if $old;
    $val->add_constrainedElement($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_constraint>

  $obj->clear_constraint;

Clears the AssociationEnd C<constraint> links to L<UMMF::MOF_1_4_1::Model::Constraint|UMMF::MOF_1_4_1::Model::Constraint>.
Returns C<$obj>.

=cut
sub clear_constraint ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'constraint'} ||= Set::Object->new();
  
  my $val; # Place holder for other MACRO.
  
    $self->{'constraint'} = Set::Object->new(); # Recursion lock
  for my $old ( $x->members() ) {     # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_constrainedElement($self) if $old;
    $val->add_constrainedElement($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_constraint>

  $obj->count_constraint;

Returns the number of elements associated with C<constraint>.

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

  my $x = $self->{'constraint'};

    defined $x ? $x->size : 0;
  }




=for html <hr/>

=cut

#################################################################
# AssociationEnd containedElement <---> container
# type = UMMF::MOF_1_4_1::Model::Namespace
# multiplicity = 0..1
# ordering = 

=head2 C<container>

  my $val = $obj->container;

Returns the AssociationEnd C<container> value of type L<UMMF::MOF_1_4_1::Model::Namespace|UMMF::MOF_1_4_1::Model::Namespace>.

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


=head2 C<set_container>

  $obj->set_container($val);

Sets the AssociationEnd C<container> value.
C<$val> must of type L<UMMF::MOF_1_4_1::Model::Namespace|UMMF::MOF_1_4_1::Model::Namespace>.
Returns C<$obj>.

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

    if ( defined $val ) { $self->__use('UMMF::MOF_1_4_1::Model::Namespace')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.container") }

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

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

    }
		  
  $self;
}


=head2 C<add_container>

  $obj->add_container($val);

Adds the AssociationEnd C<container> value.
C<$val> must of type L<UMMF::MOF_1_4_1::Model::Namespace|UMMF::MOF_1_4_1::Model::Namespace>.
Throws exception if a value already exists.
Returns C<$obj>.

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

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

  my $old;
  if ( ($old = $self->{'container'}) ne $val ) { # Recursion lock
    $self->__use('UMMF::MOF_1_4_1::Model::Namespace')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.container");
      
    # confess("UMMF::MOF_1_4_1::Model::ModelElement::container: too many")
    # if defined $self->{'container'};

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

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

  
  }

  $self;
}


=head2 C<remove_container>

  $obj->remove_container($val);

Removes the AssociationEnd C<container> value C<$val>.
Returns C<$obj>.

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

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

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

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

  
  }
}


=head2 C<clear_container>

  $obj->clear_container;

Clears the AssociationEnd C<container> links to L<UMMF::MOF_1_4_1::Model::Namespace|UMMF::MOF_1_4_1::Model::Namespace>.
Returns C<$obj>.

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

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

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

    }

  $self;
}


=head2 C<count_container>

  $obj->count_container;

Returns the number of elements of type L<UMMF::MOF_1_4_1::Model::Namespace|UMMF::MOF_1_4_1::Model::Namespace> associated with C<container>.

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

  my $x = $self->{'container'};

  defined $x ? 1 : 0;
}




=for html <hr/>

=cut

#################################################################
# AssociationEnd provider <---> dependent
# type = UMMF::MOF_1_4_1::Model::ModelElement
# multiplicity = 0..*
# ordering = 

=head2 C<dependent>

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

Returns the AssociationEnd C<dependent> values of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
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 dependent ($)
{
  my ($self) = @_;

    my $x = $self->{'dependent'};

  # confess("Container for dependent $x is not a blessed ref: " . Data::Dumper->new([ $self ], [qw($self)])->Maxdepth(2)->Dump()) if $x && ref($x) !~ /::/;
 
  wantarray ? ($x ? $x->members() : ()) : [ $x ? $x->members() : () ];
  
}


=head2 C<set_dependent>

  $obj->set_dependent(@val);

Sets the AssociationEnd C<dependent> value.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub set_dependent ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_dependent;
  $self->add_dependent(@val);
}


=head2 C<add_dependent>

  $obj->add_dependent(@val);

Adds AssociationEnd C<dependent> values.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub add_dependent ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'dependent'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::MOF_1_4_1::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.dependent");

    # Recursion lock
        $x->insert($val);
    # weaken?
    
    # Remove and add associations with other ends.
        
    $old->remove_provider($self) if $old;
    $val->add_provider($self)    if $val;

    }
  
  $self;
}


=head2 C<remove_dependent>

  $obj->remove_dependent(@val);

Removes the AssociationEnd C<dependent> values C<@val>.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub remove_dependent ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'dependent'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::MOF_1_4_1::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.dependent");

    # Recursion lock
        $x->remove($old);
    
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_provider($self) if $old;
    $val->add_provider($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_dependent>

  $obj->clear_dependent;

Clears the AssociationEnd C<dependent> links to L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub clear_dependent ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'dependent'} ||= Set::Object->new();
  
  my $val; # Place holder for other MACRO.
  
    $self->{'dependent'} = Set::Object->new(); # Recursion lock
  for my $old ( $x->members() ) {     # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_provider($self) if $old;
    $val->add_provider($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_dependent>

  $obj->count_dependent;

Returns the number of elements associated with C<dependent>.

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

  my $x = $self->{'dependent'};

    defined $x ? $x->size : 0;
  }




=for html <hr/>

=cut

#################################################################
# AssociationEnd dependent <---> provider
# type = UMMF::MOF_1_4_1::Model::ModelElement
# multiplicity = 0..*
# ordering = 

=head2 C<provider>

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

Returns the AssociationEnd C<provider> values of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
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 provider ($)
{
  my ($self) = @_;

    my $x = $self->{'provider'};

  # confess("Container for provider $x is not a blessed ref: " . Data::Dumper->new([ $self ], [qw($self)])->Maxdepth(2)->Dump()) if $x && ref($x) !~ /::/;
 
  wantarray ? ($x ? $x->members() : ()) : [ $x ? $x->members() : () ];
  
}


=head2 C<set_provider>

  $obj->set_provider(@val);

Sets the AssociationEnd C<provider> value.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub set_provider ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_provider;
  $self->add_provider(@val);
}


=head2 C<add_provider>

  $obj->add_provider(@val);

Adds AssociationEnd C<provider> values.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub add_provider ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'provider'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::MOF_1_4_1::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.provider");

    # Recursion lock
        $x->insert($val);
    # weaken?
    
    # Remove and add associations with other ends.
        
    $old->remove_dependent($self) if $old;
    $val->add_dependent($self)    if $val;

    }
  
  $self;
}


=head2 C<remove_provider>

  $obj->remove_provider(@val);

Removes the AssociationEnd C<provider> values C<@val>.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub remove_provider ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'provider'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::MOF_1_4_1::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.provider");

    # Recursion lock
        $x->remove($old);
    
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_dependent($self) if $old;
    $val->add_dependent($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_provider>

  $obj->clear_provider;

Clears the AssociationEnd C<provider> links to L<UMMF::MOF_1_4_1::Model::ModelElement|UMMF::MOF_1_4_1::Model::ModelElement>.
Returns C<$obj>.

=cut
sub clear_provider ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'provider'} ||= Set::Object->new();
  
  my $val; # Place holder for other MACRO.
  
    $self->{'provider'} = Set::Object->new(); # Recursion lock
  for my $old ( $x->members() ) {     # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_dependent($self) if $old;
    $val->add_dependent($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_provider>

  $obj->count_provider;

Returns the number of elements associated with C<provider>.

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

  my $x = $self->{'provider'};

    defined $x ? $x->size : 0;
  }




=for html <hr/>

=cut

#################################################################
# AssociationEnd modelElement <---> tag
# type = UMMF::MOF_1_4_1::Model::Tag
# multiplicity = 0..*
# ordering = ordered

=head2 C<tag>

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

Returns the AssociationEnd C<tag> values of type L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>.
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 tag ($)
{
  my ($self) = @_;

    my $x = $self->{'tag'} ||= [ ];

  wantarray ? @{$x} : $x;
  
}


=head2 C<index_tag>

  my $x = $obj->index_tag($i);
  my @x = $obj->index_tag($i, $count);

In scalar context, returns the value of AssociationEnd C<tag> at index C<$i>.
In array context, returns the values between index C<$i> and C<$i + $count - 1>, inclusive.

=cut
sub index_tag ($$@)
{
  my ($self, $i, $count) = @_;

  ;

  my $val = $self->{'tag'} ||= [ ];

  ;

  wantarray ? $val->[$i .. (defined $count ? $i + $count - 1 : $i)]
            : $val->[$i];
}


=head2 C<index_of_tag>

  my $index = $obj->index_of_tag($val);

Returns the index of C<$val> in AssociationEnd C<tag>.
Return C<undef> if C<$val> is not in C<tag>.

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

  ;

  my $val = $self->{'tag'} ||= [ ];

  ;

  __ummf_array_index($val, $x);
}


=head2 C<set_tag>

  $obj->set_tag(@val);

Sets the AssociationEnd C<tag> value.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>.
Returns C<$obj>.

=cut
sub set_tag ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_tag;
  $self->add_tag(@val);
}


=head2 C<set_index_tag>

  $obj->set_index_tag($i, $val);

Sets the value of AssociationEnd C<tag> at index C<$i>.
Returns self.

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

  ;

  my $x = $self->{'tag'} ||= [ ];

  no warnings;
  my $old;
  if ( ($old = $x->[$i]) ne $val) {
    # Recursion lock
        $x->[$i] = $val
    ;

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

  
    ;
  }

  $self;
}


=head2 C<add_tag>

  $obj->add_tag(@val);

Adds AssociationEnd C<tag> values.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>.
Returns C<$obj>.

=cut
sub add_tag ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'tag'} ||= [ ];
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if grep($_ eq $val, @$x);
        $self->__use('UMMF::MOF_1_4_1::Model::Tag')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.tag");

    # Recursion lock
        push(@{$x}, $val);
        
    # Remove and add associations with other ends.
        
    $old->remove_modelElement($self) if $old;
    $val->add_modelElement($self)    if $val;

    }
  
  $self;
}


=head2 C<add_index_tag>

  $obj->add_index_tag($i, @val);

Adds AssociationEnd C<tag> values at index C<$i>.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>.
Returns C<$obj>.

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

  
    my $x = $self->{'tag'} ||= [ ];
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if grep($_ eq $val, @$x);
        $self->__use('UMMF::MOF_1_4_1::Model::Tag')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.tag");

    # Recursion lock
        splice(@{$x}, $i, 0, $val); # Recursion lock
        ++ $i;
    
    # Remove and add associations with other ends.
        
    $old->remove_modelElement($self) if $old;
    $val->add_modelElement($self)    if $val;

    }
  
  
  $self;
}


=head2 C<remove_tag>

  $obj->remove_tag(@val);

Removes the AssociationEnd C<tag> values C<@val>.
Elements of C<@val> must of type L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>.
Returns C<$obj>.

=cut
sub remove_tag ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'tag'} ||= [ ];
  
  for my $old ( @val ) {
    # Recursion lock
        my $i; # index of $old in @$x.
    next unless defined($i = __ummf_array_index($x, $old));
    
    my $val = $old;
      
    $self->__use('UMMF::MOF_1_4_1::Model::Tag')->__typecheck($val, "UMMF::MOF_1_4_1::Model::ModelElement.tag");

    # Recursion lock
        splice(@$x, $i, 1);     
    $val = undef;

    # Remove associations with other ends.

        
    $old->remove_modelElement($self) if $old;
    $val->add_modelElement($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<clear_tag>

  $obj->clear_tag;

Clears the AssociationEnd C<tag> links to L<UMMF::MOF_1_4_1::Model::Tag|UMMF::MOF_1_4_1::Model::Tag>.
Returns C<$obj>.

=cut
sub clear_tag ($) 
{
  my ($self) = @_;
  
    my $x = $self->{'tag'} ||= [ ];
  
  my $val; # Place holder for other MACRO.
  
    $self->{'tag'} = [ ];  # Recursion lock
  for my $old ( @$x ) { # Recursion lock
  
    # Remove associations with other ends.

        
    $old->remove_modelElement($self) if $old;
    $val->add_modelElement($self)    if $val;

  ;

  }
  
  $self;
}


=head2 C<count_tag>

  $obj->count_tag;

Returns the number of elements associated with C<tag>.

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

  my $x = $self->{'tag'};

    defined $x ? scalar @$x : 0;
  }







# End of Class ModelElement


=pod

=for html <hr/>

I<END OF DOCUMENT>

=cut

############################################################################

1; # is true!

############################################################################

### Keep these comments at end of file: kstephens@users.sourceforge.net 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: ###

