UMMF::MOF_1_3::Model::Tag - UMMF::MOF_1_3::Model::Tag documentation


UMMF documentation Contained in the UMMF distribution.

Index


Code Index:

NAME

Top

UMMF::MOF_1_3::Model::Tag --

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

ATTRIBUTES

Top

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

values : UMMF::MOF_1_3::Model::String [0..*]

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

ASSOCIATIONS

Top

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

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

METHODS

Top

__validate_type

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

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

__typecheck

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

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

isaTag

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

isaModel__Tag

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

__model_name

  my $name = $obj_or_package->__model_name;

Returns the UML Model name ('Model::Tag') 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.

tagId

  my $val = $obj->tagId;

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

set_tagId

  $obj->set_tagId($val);

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

count_tagId

  $obj->count_tagId;

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

values

  my $array_ref = $obj->values;
  my @val = $obj->values;

Returns the UMMF::MOF_1_3::Model::String values of Attribute values. In list context it returns the list of values. In scalar context it returns a reference to the list of values.

set_values

  $obj->set_values(@val);

Sets the values of Attribute values. The elements of @val must be of type UMMF::MOF_1_3::Model::String. Returns $obj.

add_values

  $obj->add_values(@val);

Adds the values of Attribute values. The elements of @val must be of type UMMF::MOF_1_3::Model::String. Returns $obj.

remove_values

  $obj->remove_values(@val);

Removes values from Attribute values. The elements of @val must be of type UMMF::MOF_1_3::Model::String. Returns $obj.

clear_values

  $obj->clear_values;

Removes all values from Attribute values. Returns $obj.

count_values

  $obj->count_values;

Returns the number of elements in values.

modelElement

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

Returns the AssociationEnd modelElement 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_modelElement

  $obj->set_modelElement(@val);

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

add_modelElement

  $obj->add_modelElement(@val);

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

remove_modelElement

  $obj->remove_modelElement(@val);

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

clear_modelElement

  $obj->clear_modelElement;

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

count_modelElement

  $obj->count_modelElement;

Returns the number of elements associated with modelElement.

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::Tag;

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



);


#################################################################
# 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::Tag')  ;
}


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

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


sub isaTag { 1 }


sub isaModel__Tag { 1 }


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

sub __model_name { 'Model::Tag' }



sub __isAbstract { 0; }


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

  $__tangram_schema ||=
  {
   'classes' =>
   [
     'UMMF::MOF_1_3::Model::Tag' =>
     {
       'table' => 'Model__Tag',
       'abstract' => 0,
       'slots' => 
       { 
	 # Attributes
	 	       'tagId'
       => {
	 'type_impl' => 'ref',
         'class' => 'UMMF::MOF_1_3::Model::String',

                                             'col' => 'tagId', 

                                                                                                                   }
      ,
         	       'values'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::MOF_1_3::Model::String',

                           'table' => 'Model__RefersTo', 

                                                      'item' => 'values', 

                  'coll' => 'referent',

                                                                               }
      ,
         
	 # Associations
	 	 	       'modelElement'
       => {
	 'type_impl' => 'set',
         'class' => 'UMMF::MOF_1_3::Model::ModelElement',

                           'table' => 'Model__AttachesTo', 

                                                      'item' => 'modelElement', 

                  'coll' => 'tag',

                                                                               }
      ,
                         },
       'bases' => [  'UMMF::MOF_1_3::Model::ModelElement',  ],
       '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 tagId
  if ( exists $self->{'tagId'} ) {
    my $x = $self->{'tagId'};
    $self->{'tagId'} = undef;
        $self->set_tagId($x);
      } else {
      }
  
    # Attribute values
  if ( exists $self->{'values'} ) {
    my $x = $self->{'values'};
    $self->{'values'} = undef;
        $self->set_values(ref($x) ? @$x : $x);
      } else {
      }
  


  # Associations

  # AssociationEnd 
  #  tag 0..*
  #  <--> 
  #  modelElement 1..* UMMF::MOF_1_3::Model::ModelElement.
    if ( defined $self->{'modelElement'} ) {
    my $x = $self->{'modelElement'};
        $self->{'modelElement'} = Set::Object->new();
        $self->set_modelElement(@$x);
  }
  

  $self;
}


my $__initialize_use;

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

  # $DB::single = 1;

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

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

  $self;
}
      

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

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

  $self;
}




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



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

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



#################################################################
# Attribute values
# type = UMMF::MOF_1_3::Model::String
# multiplicity = 0..*
# ordering = unordered
# ownerScope = instance
# initialValue = 

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

  ;

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

  ;

  wantarray ? @$val : $val;
}




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

  ;

  for my $val ( @val ) { 
    ;
  }
  
  $self->{'values'} = \@val;
  
  ;

  $self;
}


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

  ;

  for my $val ( @val ) { 
    ;
  }

  my $x = $self->{'values'} ||= [ ]; 
  push(@$x, @val);
  
  ;

  $self;
}


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

  ;

  for my $val ( @val ) { 
    ;
  }

  my $x = $self->{'values'} ||= [ ];
  __ummf_array_delete_each($x, \@val);

  ;

  $self;
}


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

  ;

  $self->{'values'} = [ ];

  ;
	      
  $self;
}


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

  ;

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

  ;

  $val ? scalar @$val : 0;
}




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


#################################################################
# AssociationEnd tag <---> modelElement
# type = UMMF::MOF_1_3::Model::ModelElement
# multiplicity = 1..*
# ordering = 

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

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

  # confess("Container for modelElement $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_modelElement ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_modelElement;
  $self->add_modelElement(@val);
}


sub add_modelElement ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'modelElement'} ||= 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::Tag.modelElement");

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

    }
  
  $self;
}


sub remove_modelElement ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'modelElement'} ||= 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::Tag.modelElement");

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

    # Remove associations with other ends.

        
    $old->remove_tag($self) if $old;
    $val->add_tag($self)    if $val;

  ;

  }
  
  $self;
}


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

        
    $old->remove_tag($self) if $old;
    $val->add_tag($self)    if $val;

  ;

  }
  
  $self;
}


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

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

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







# End of Class Tag


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

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