UMMF::MOF_1_3::Model::ModelElement - UMMF::MOF_1_3::Model::ModelElement documentation


UMMF documentation Contained in the UMMF distribution.

Index


Code Index:

NAME

Top

UMMF::MOF_1_3::Model::ModelElement --

VERSION

Top

1.3

SYNOPSIS

Top

DESCRIPTION

Top

USAGE

Top

EXPORT

Top

METATYPE

Top

UMMF::UML_1_5::Foundation::Core::Class

SUPERCLASSES

Top

UMMF::MOF_1_3::__ObjectBase

ATTRIBUTES

Top

name : UMMF::MOF_1_3::Model::String

metatype = UMMF::UML_1_5::Foundation::Core::Attribute
type = UMMF::MOF_1_3::Model::String
visibility = private
multiplicity = 1
changeability = changeable
targetScope = instance
ordering = unordered
initialValue = UNSPECIFIED
container_type = Set::Object

annotation : UMMF::MOF_1_3::Model::String

metatype = UMMF::UML_1_5::Foundation::Core::Attribute
type = UMMF::MOF_1_3::Model::String
visibility = private
multiplicity = 1
changeability = changeable
targetScope = instance
ordering = unordered
initialValue = UNSPECIFIED
container_type = Set::Object

ASSOCIATIONS

Top

constrainedElement : THIS 1..* <---> constraint : UMMF::MOF_1_3::Model::Constraint 0..*

metatype = UMMF::UML_1_5::Foundation::Core::AssociationEnd
type = UMMF::MOF_1_3::Model::Constraint
multiplicity = 0..*
changeability = changeable
targetScope = instance
ordering =
isNavigable = 1
aggregation = none
visibility = public
container_type = Set::Object

containedElement : THIS 0..* <---> container : UMMF::MOF_1_3::Model::Namespace 0..1

metatype = UMMF::UML_1_5::Foundation::Core::AssociationEnd
type = UMMF::MOF_1_3::Model::Namespace
multiplicity = 0..1
changeability = changeable
targetScope = instance
ordering =
isNavigable = 1
aggregation = composite
visibility = public
container_type = Set::Object

provider : THIS 0..* <---> dependent : UMMF::MOF_1_3::Model::ModelElement 0..*

metatype = UMMF::UML_1_5::Foundation::Core::AssociationEnd
type = UMMF::MOF_1_3::Model::ModelElement
multiplicity = 0..*
changeability = changeable
targetScope = instance
ordering =
isNavigable = 1
aggregation = none
visibility = public
container_type = Set::Object

dependent : THIS 0..* <---> provider : UMMF::MOF_1_3::Model::ModelElement 0..*

metatype = UMMF::UML_1_5::Foundation::Core::AssociationEnd
type = UMMF::MOF_1_3::Model::ModelElement
multiplicity = 0..*
changeability = changeable
targetScope = instance
ordering =
isNavigable = 1
aggregation = none
visibility = public
container_type = Set::Object

modelElement : THIS 1..* <---> tag : UMMF::MOF_1_3::Model::Tag 0..*

metatype = UMMF::UML_1_5::Foundation::Core::AssociationEnd
type = UMMF::MOF_1_3::Model::Tag
multiplicity = 0..*
changeability = changeable
targetScope = instance
ordering = ordered
isNavigable = 1
aggregation = none
visibility = public
container_type = ARRAY

METHODS

Top

__validate_type

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

Returns true if $value is a valid representation of UMMF::MOF_1_3::Model::ModelElement.

__typecheck

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

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

isaModelElement

Returns true if receiver is a UMMF::MOF_1_3::Model::ModelElement. Other receivers will return false.

isaModel__ModelElement

Returns true if receiver is a UMMF::MOF_1_3::Model::ModelElement. Other receivers will return false. This is the fully qualified version of the isaModelElement method.

__model_name

  my $name = $obj_or_package->__model_name;

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

__isAbstract

  $package->__isAbstract;

Returns 1.

__tangram_schema

  my $tangram_schema $obj_or_package->__tangram_schema

Returns a HASH ref that describes this Classifier for Tangram.

See UMMF::Export::Perl::Tangram

___initialize

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

See also: __initialize.

__initialize

Initialize all slots in this Classifier and all its Generalizations.

See also: ___initialize.

__create

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

See also: ___create.

name

  my $val = $obj->name;

Returns the UMMF::MOF_1_3::Model::String value of Attribute name.

set_name

  $obj->set_name($val);

Sets the value of Attribute name. $val must be of type UMMF::MOF_1_3::Model::String or undef. Returns $obj.

count_name

  $obj->count_name;

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

annotation

  my $val = $obj->annotation;

Returns the UMMF::MOF_1_3::Model::String value of Attribute annotation.

set_annotation

  $obj->set_annotation($val);

Sets the value of Attribute annotation. $val must be of type UMMF::MOF_1_3::Model::String or undef. Returns $obj.

count_annotation

  $obj->count_annotation;

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

constraint

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

Returns the AssociationEnd constraint values of type UMMF::MOF_1_3::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.

set_constraint

  $obj->set_constraint(@val);

Sets the AssociationEnd constraint value. Elements of @val must of type UMMF::MOF_1_3::Model::Constraint. Returns $obj.

add_constraint

  $obj->add_constraint(@val);

Adds AssociationEnd constraint values. Elements of @val must of type UMMF::MOF_1_3::Model::Constraint. Returns $obj.

remove_constraint

  $obj->remove_constraint(@val);

Removes the AssociationEnd constraint values @val. Elements of @val must of type UMMF::MOF_1_3::Model::Constraint. Returns $obj.

clear_constraint

  $obj->clear_constraint;

Clears the AssociationEnd constraint links to UMMF::MOF_1_3::Model::Constraint. Returns $obj.

count_constraint

  $obj->count_constraint;

Returns the number of elements associated with constraint.

container

  my $val = $obj->container;

Returns the AssociationEnd container value of type UMMF::MOF_1_3::Model::Namespace.

set_container

  $obj->set_container($val);

Sets the AssociationEnd container value. $val must of type UMMF::MOF_1_3::Model::Namespace. Returns $obj.

add_container

  $obj->add_container($val);

Adds the AssociationEnd container value. $val must of type UMMF::MOF_1_3::Model::Namespace. Throws exception if a value already exists. Returns $obj.

remove_container

  $obj->remove_container($val);

Removes the AssociationEnd container value $val. Returns $obj.

clear_container

  $obj->clear_container;

Clears the AssociationEnd container links to UMMF::MOF_1_3::Model::Namespace. Returns $obj.

count_container

  $obj->count_container;

Returns the number of elements of type UMMF::MOF_1_3::Model::Namespace associated with container.

dependent

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

Returns the AssociationEnd dependent values of type UMMF::MOF_1_3::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.

set_dependent

  $obj->set_dependent(@val);

Sets the AssociationEnd dependent value. Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

add_dependent

  $obj->add_dependent(@val);

Adds AssociationEnd dependent values. Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

remove_dependent

  $obj->remove_dependent(@val);

Removes the AssociationEnd dependent values @val. Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

clear_dependent

  $obj->clear_dependent;

Clears the AssociationEnd dependent links to UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

count_dependent

  $obj->count_dependent;

Returns the number of elements associated with dependent.

provider

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

Returns the AssociationEnd provider values of type UMMF::MOF_1_3::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.

set_provider

  $obj->set_provider(@val);

Sets the AssociationEnd provider value. Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

add_provider

  $obj->add_provider(@val);

Adds AssociationEnd provider values. Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

remove_provider

  $obj->remove_provider(@val);

Removes the AssociationEnd provider values @val. Elements of @val must of type UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

clear_provider

  $obj->clear_provider;

Clears the AssociationEnd provider links to UMMF::MOF_1_3::Model::ModelElement. Returns $obj.

count_provider

  $obj->count_provider;

Returns the number of elements associated with provider.

tag

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

Returns the AssociationEnd tag values of type UMMF::MOF_1_3::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.

index_tag

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

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

index_of_tag

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

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

set_tag

  $obj->set_tag(@val);

Sets the AssociationEnd tag value. Elements of @val must of type UMMF::MOF_1_3::Model::Tag. Returns $obj.

set_index_tag

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

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

add_tag

  $obj->add_tag(@val);

Adds AssociationEnd tag values. Elements of @val must of type UMMF::MOF_1_3::Model::Tag. Returns $obj.

add_index_tag

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

Adds AssociationEnd tag values at index $i. Elements of @val must of type UMMF::MOF_1_3::Model::Tag. Returns $obj.

remove_tag

  $obj->remove_tag(@val);

Removes the AssociationEnd tag values @val. Elements of @val must of type UMMF::MOF_1_3::Model::Tag. Returns $obj.

clear_tag

  $obj->clear_tag;

Clears the AssociationEnd tag links to UMMF::MOF_1_3::Model::Tag. Returns $obj.

count_tag

  $obj->count_tag;

Returns the number of elements associated with tag.

END OF DOCUMENT


UMMF documentation Contained in the UMMF distribution.
# -*- 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_3::Model::ModelElement;

#use 5.6.1;
use strict;
use warnings;

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

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


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



#################################################################
# 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_3::__ObjectBase qw(:__ummf_array);


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

use base qw(


  UMMF::MOF_1_3::__ObjectBase

);


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

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





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


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

  no warnings;

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


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

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


sub isaModelElement { 1 }


sub isaModel__ModelElement { 1 }


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

sub __model_name { 'Model::ModelElement' }



sub __isAbstract { 1; }


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

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

                                             'col' => 'name', 

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

                                             'col' => 'annotation', 

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

                           'table' => 'Model__Constrains', 

                                                      'item' => 'constraint', 

                  'coll' => 'constrainedElement',

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

                  'null' => '1', 

                                    'col' => 'container', 

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

                           'table' => 'Model__ModelElement__DependsOn', 

                                                      'item' => 'dependent', 

                  'coll' => 'provider',

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

                           'table' => 'Model__ModelElement__DependsOn', 

                                                      'item' => 'provider', 

                  'coll' => 'dependent',

                                                                               }
      ,
                  	 	       'tag'
       => {
	 'type_impl' => 'array',
         'class' => 'UMMF::MOF_1_3::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
#


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_3::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_3::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_3::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_3::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_3::Model::Tag.
    if ( defined $self->{'tag'} ) {
    my $x = $self->{'tag'};
        $self->{'tag'} = [ ];
        $self->set_tag(@$x);
  }
  

  $self;
}


my $__initialize_use;

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

  # $DB::single = 1;

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

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

  $self;
}
      

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

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

  $self;
}




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



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

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



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

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}




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


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

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() : () ];
  
}


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


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_3::Model::Constraint')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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_3::Model::Constraint')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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;
}


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

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

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




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

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


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_3::Model::Namespace')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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_3::Model::Namespace')->__typecheck($val, "UMMF::MOF_1_3::Model::ModelElement.container");
      
    # confess("UMMF::MOF_1_3::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;
}


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;

  
  }
}


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;
}


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

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

  defined $x ? 1 : 0;
}




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

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() : () ];
  
}


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


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_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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;
}


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

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

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




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

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() : () ];
  
}


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


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_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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_3::Model::ModelElement')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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;
}


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

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

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




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

sub tag ($)
{
  my ($self) = @_;

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

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


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

  ;

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

  ;

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


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

  ;

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

  ;

  __ummf_array_index($val, $x);
}


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


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;
}


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_3::Model::Tag')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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_3::Model::Tag')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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_3::Model::Tag')->__typecheck($val, "UMMF::MOF_1_3::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;
}


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;
}


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

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

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







# End of Class ModelElement


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

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