UMMF::MOF_1_4_1::Model::AssociationEnd - UMMF::MOF_1_4_1::Model::AssociationEnd documentation


UMMF documentation Contained in the UMMF distribution.

Index


Code Index:

NAME

Top

UMMF::MOF_1_4_1::Model::AssociationEnd --

VERSION

Top

1.4.1

SYNOPSIS

Top

DESCRIPTION

Top

USAGE

Top

EXPORT

Top

METATYPE

Top

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

SUPERCLASSES

Top

UMMF::MOF_1_4_1::Model::TypedElement

ATTRIBUTES

Top

isNavigable : UMMF::MOF_1_4_1::Model::Boolean

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

aggregation : UMMF::MOF_1_4_1::Model::AggregationKind

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

multiplicity : UMMF::MOF_1_4_1::Model::MultiplicityType

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

isChangeable : UMMF::MOF_1_4_1::Model::Boolean

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

ASSOCIATIONS

Top

referencedEnd : THIS 1 <---> referent : UMMF::MOF_1_4_1::Model::Reference 0..*

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

exposedEnd : THIS 1 <---> referrer : UMMF::MOF_1_4_1::Model::Reference 0..*

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

METHODS

Top

__validate_type

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

Returns true if $value is a valid representation of UMMF::MOF_1_4_1::Model::AssociationEnd.

__typecheck

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

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

isaAssociationEnd

Returns true if receiver is a UMMF::MOF_1_4_1::Model::AssociationEnd. Other receivers will return false.

isaModel__AssociationEnd

Returns true if receiver is a UMMF::MOF_1_4_1::Model::AssociationEnd. Other receivers will return false. This is the fully qualified version of the isaAssociationEnd method.

__model_name

  my $name = $obj_or_package->__model_name;

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

__isAbstract

  $package->__isAbstract;

Returns 0.

__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.

isNavigable

  my $val = $obj->isNavigable;

Returns the UMMF::MOF_1_4_1::Model::Boolean value of Attribute isNavigable.

set_isNavigable

  $obj->set_isNavigable($val);

Sets the value of Attribute isNavigable. $val must be of type UMMF::MOF_1_4_1::Model::Boolean or undef. Returns $obj.

count_isNavigable

  $obj->count_isNavigable;

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

aggregation

  my $val = $obj->aggregation;

Returns the UMMF::MOF_1_4_1::Model::AggregationKind value of Attribute aggregation.

set_aggregation

  $obj->set_aggregation($val);

Sets the value of Attribute aggregation. $val must be of type UMMF::MOF_1_4_1::Model::AggregationKind or undef. Returns $obj.

count_aggregation

  $obj->count_aggregation;

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

multiplicity

  my $val = $obj->multiplicity;

Returns the UMMF::MOF_1_4_1::Model::MultiplicityType value of Attribute multiplicity.

set_multiplicity

  $obj->set_multiplicity($val);

Sets the value of Attribute multiplicity. $val must be of type UMMF::MOF_1_4_1::Model::MultiplicityType or undef. Returns $obj.

count_multiplicity

  $obj->count_multiplicity;

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

isChangeable

  my $val = $obj->isChangeable;

Returns the UMMF::MOF_1_4_1::Model::Boolean value of Attribute isChangeable.

set_isChangeable

  $obj->set_isChangeable($val);

Sets the value of Attribute isChangeable. $val must be of type UMMF::MOF_1_4_1::Model::Boolean or undef. Returns $obj.

count_isChangeable

  $obj->count_isChangeable;

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

referent

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

Returns the AssociationEnd referent values of type UMMF::MOF_1_4_1::Model::Reference. 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_referent

  $obj->set_referent(@val);

Sets the AssociationEnd referent value. Elements of @val must of type UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

add_referent

  $obj->add_referent(@val);

Adds AssociationEnd referent values. Elements of @val must of type UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

remove_referent

  $obj->remove_referent(@val);

Removes the AssociationEnd referent values @val. Elements of @val must of type UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

clear_referent

  $obj->clear_referent;

Clears the AssociationEnd referent links to UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

count_referent

  $obj->count_referent;

Returns the number of elements associated with referent.

referrer

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

Returns the AssociationEnd referrer values of type UMMF::MOF_1_4_1::Model::Reference. 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_referrer

  $obj->set_referrer(@val);

Sets the AssociationEnd referrer value. Elements of @val must of type UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

add_referrer

  $obj->add_referrer(@val);

Adds AssociationEnd referrer values. Elements of @val must of type UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

remove_referrer

  $obj->remove_referrer(@val);

Removes the AssociationEnd referrer values @val. Elements of @val must of type UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

clear_referrer

  $obj->clear_referrer;

Clears the AssociationEnd referrer links to UMMF::MOF_1_4_1::Model::Reference. Returns $obj.

count_referrer

  $obj->count_referrer;

Returns the number of elements associated with referrer.

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_4_1::Model::AssociationEnd;

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



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



);


#################################################################
# 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_4_1::Model::AssociationEnd')  ;
}


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

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


sub isaAssociationEnd { 1 }


sub isaModel__AssociationEnd { 1 }


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

sub __model_name { 'Model::AssociationEnd' }



sub __isAbstract { 0; }


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

  $__tangram_schema ||=
  {
   'classes' =>
   [
     'UMMF::MOF_1_4_1::Model::AssociationEnd' =>
     {
       'table' => 'Model__AssociationEnd',
       'abstract' => 0,
       'slots' => 
       { 
	 # Attributes
	 	       'isNavigable'
       => {
	 'type_impl' => 'string',
                                             'col' => 'isNavigable', 

                                                                                                                   }
      ,
         	       'aggregation'
       => {
	 'type_impl' => 'string',
                                             'col' => 'aggregation', 

                                                                                                                   }
      ,
         	       'multiplicity'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::MOF_1_4_1::Model::MultiplicityType',

                                             'col' => 'multiplicity', 

                                                                                                                   }
      ,
         	       'isChangeable'
       => {
	 'type_impl' => 'string',
                                             'col' => 'isChangeable', 

                                                                                                                   }
      ,
         
	 # Associations
	 	 	       'referent'
       => {
	 'type_impl' => 'iset',
         'class' => 'UMMF::MOF_1_4_1::Model::Reference',

                           'table' => 'Model__AssociationEnd__referent', 

                                                               'coll' => 'referencedEnd',

                                                                               }
      ,
                  	 	       'referrer'
       => {
	 'type_impl' => 'iset',
         'class' => 'UMMF::MOF_1_4_1::Model::Reference',

                           'table' => 'Model__AssociationEnd__referrer', 

                                                               'coll' => 'exposedEnd',

                                                                               }
      ,
                         },
       'bases' => [  'UMMF::MOF_1_4_1::Model::TypedElement',  ],
       '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 isNavigable
  if ( exists $self->{'isNavigable'} ) {
    my $x = $self->{'isNavigable'};
    $self->{'isNavigable'} = undef;
        $self->set_isNavigable($x);
      } else {
      }
  
    # Attribute aggregation
  if ( exists $self->{'aggregation'} ) {
    my $x = $self->{'aggregation'};
    $self->{'aggregation'} = undef;
        $self->set_aggregation($x);
      } else {
      }
  
    # Attribute multiplicity
  if ( exists $self->{'multiplicity'} ) {
    my $x = $self->{'multiplicity'};
    $self->{'multiplicity'} = undef;
        $self->set_multiplicity($x);
      } else {
      }
  
    # Attribute isChangeable
  if ( exists $self->{'isChangeable'} ) {
    my $x = $self->{'isChangeable'};
    $self->{'isChangeable'} = undef;
        $self->set_isChangeable($x);
      } else {
      }
  


  # Associations

  # AssociationEnd 
  #  referencedEnd 1
  #  <--> 
  #  referent 0..* UMMF::MOF_1_4_1::Model::Reference.
    if ( defined $self->{'referent'} ) {
    my $x = $self->{'referent'};
        $self->{'referent'} = Set::Object->new();
        $self->set_referent(@$x);
  }
  
  # AssociationEnd 
  #  exposedEnd 1
  #  <--> 
  #  referrer 0..* UMMF::MOF_1_4_1::Model::Reference.
    if ( defined $self->{'referrer'} ) {
    my $x = $self->{'referrer'};
        $self->{'referrer'} = Set::Object->new();
        $self->set_referrer(@$x);
  }
  

  $self;
}


my $__initialize_use;

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

  # $DB::single = 1;

  unless ( ! $__initialize_use ) {
    $__initialize_use = 1;
    $self->__use('UMMF::MOF_1_4_1::Model::ModelElement');
    $self->__use('UMMF::MOF_1_4_1::Model::TypedElement');
  }

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

  $self;
}
      

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

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

  $self;
}




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



#################################################################
# Attribute isNavigable
# type = UMMF::MOF_1_4_1::Model::Boolean
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = 

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



#################################################################
# Attribute aggregation
# type = UMMF::MOF_1_4_1::Model::AggregationKind
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = 

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    $self->__use('UMMF::MOF_1_4_1::Model::AggregationKind')->__typecheck($val, "UMMF::MOF_1_4_1::Model::AssociationEnd.aggregation");
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



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

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    $self->__use('UMMF::MOF_1_4_1::Model::MultiplicityType')->__typecheck($val, "UMMF::MOF_1_4_1::Model::AssociationEnd.multiplicity");
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



#################################################################
# Attribute isChangeable
# type = UMMF::MOF_1_4_1::Model::Boolean
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = 

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}




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


#################################################################
# AssociationEnd referencedEnd <---> referent
# type = UMMF::MOF_1_4_1::Model::Reference
# multiplicity = 0..*
# ordering = 

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

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

  # confess("Container for referent $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_referent ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_referent;
  $self->add_referent(@val);
}


sub add_referent ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'referent'} ||= 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::Reference')->__typecheck($val, "UMMF::MOF_1_4_1::Model::AssociationEnd.referent");

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

    }
  
  $self;
}


sub remove_referent ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'referent'} ||= 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::Reference')->__typecheck($val, "UMMF::MOF_1_4_1::Model::AssociationEnd.referent");

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

    # Remove associations with other ends.

        
    $old->remove_referencedEnd($self) if $old;
    $val->add_referencedEnd($self)    if $val;

  ;

  }
  
  $self;
}


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

        
    $old->remove_referencedEnd($self) if $old;
    $val->add_referencedEnd($self)    if $val;

  ;

  }
  
  $self;
}


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

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

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




#################################################################
# AssociationEnd exposedEnd <---> referrer
# type = UMMF::MOF_1_4_1::Model::Reference
# multiplicity = 0..*
# ordering = 

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

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

  # confess("Container for referrer $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_referrer ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_referrer;
  $self->add_referrer(@val);
}


sub add_referrer ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'referrer'} ||= 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::Reference')->__typecheck($val, "UMMF::MOF_1_4_1::Model::AssociationEnd.referrer");

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

    }
  
  $self;
}


sub remove_referrer ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'referrer'} ||= 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::Reference')->__typecheck($val, "UMMF::MOF_1_4_1::Model::AssociationEnd.referrer");

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

    # Remove associations with other ends.

        
    $old->remove_exposedEnd($self) if $old;
    $val->add_exposedEnd($self)    if $val;

  ;

  }
  
  $self;
}


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

        
    $old->remove_exposedEnd($self) if $old;
    $val->add_exposedEnd($self)    if $val;

  ;

  }
  
  $self;
}


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

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

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







# End of Class AssociationEnd


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

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