UMMF::UML_1_5::Foundation::Core::GeneralizableElement - UMMF::UML_1_5::Foundation::Core::GeneralizableElement documentation


UMMF documentation Contained in the UMMF distribution.

Index


Code Index:

NAME

Top

UMMF::UML_1_5::Foundation::Core::GeneralizableElement --

VERSION

Top

1.5

SYNOPSIS

Top

DESCRIPTION

Top

USAGE

Top

EXPORT

Top

METATYPE

Top

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

SUPERCLASSES

Top

UMMF::UML_1_5::Foundation::Core::ModelElement

ATTRIBUTES

Top

isRoot : UMMF::UML_1_5::Foundation::Data_Types::Boolean

metatype = UMMF::UML_1_5::Foundation::Core::Attribute
type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
visibility = private
multiplicity = 1
changeability = changeable
targetScope = instance
ordering = unordered
initialValue = <"false">
container_type = Set::Object

isLeaf : UMMF::UML_1_5::Foundation::Data_Types::Boolean

metatype = UMMF::UML_1_5::Foundation::Core::Attribute
type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
visibility = private
multiplicity = 1
changeability = changeable
targetScope = instance
ordering = unordered
initialValue = <"false">
container_type = Set::Object

isAbstract : UMMF::UML_1_5::Foundation::Data_Types::Boolean

metatype = UMMF::UML_1_5::Foundation::Core::Attribute
type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
visibility = private
multiplicity = 1
changeability = changeable
targetScope = instance
ordering = unordered
initialValue = <"false">
container_type = Set::Object

ASSOCIATIONS

Top

child : THIS 1 <---> generalization : UMMF::UML_1_5::Foundation::Core::Generalization 0..*

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

parent : THIS 1 <---> specialization : UMMF::UML_1_5::Foundation::Core::Generalization 0..*

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

METHODS

Top

__validate_type

  UMMF::UML_1_5::Foundation::Core::GeneralizableElement->__validate_type($value);

Returns true if $value is a valid representation of UMMF::UML_1_5::Foundation::Core::GeneralizableElement.

__typecheck

  UMMF::UML_1_5::Foundation::Core::GeneralizableElement->__typecheck($value, $msg);

Calls confess() with $msg if <UMMF::UML_1_5::Foundation::Core::GeneralizableElement-__validate_type($value)>> is false.

isaGeneralizableElement

Returns true if receiver is a UMMF::UML_1_5::Foundation::Core::GeneralizableElement. Other receivers will return false.

isaFoundation__Core__GeneralizableElement

Returns true if receiver is a UMMF::UML_1_5::Foundation::Core::GeneralizableElement. Other receivers will return false. This is the fully qualified version of the isaGeneralizableElement method.

__model_name

  my $name = $obj_or_package->__model_name;

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

isRoot

  my $val = $obj->isRoot;

Returns the UMMF::UML_1_5::Foundation::Data_Types::Boolean value of Attribute isRoot.

set_isRoot

  $obj->set_isRoot($val);

Sets the value of Attribute isRoot. $val must be of type UMMF::UML_1_5::Foundation::Data_Types::Boolean or undef. Returns $obj.

count_isRoot

  $obj->count_isRoot;

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

isLeaf

  my $val = $obj->isLeaf;

Returns the UMMF::UML_1_5::Foundation::Data_Types::Boolean value of Attribute isLeaf.

set_isLeaf

  $obj->set_isLeaf($val);

Sets the value of Attribute isLeaf. $val must be of type UMMF::UML_1_5::Foundation::Data_Types::Boolean or undef. Returns $obj.

count_isLeaf

  $obj->count_isLeaf;

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

isAbstract

  my $val = $obj->isAbstract;

Returns the UMMF::UML_1_5::Foundation::Data_Types::Boolean value of Attribute isAbstract.

set_isAbstract

  $obj->set_isAbstract($val);

Sets the value of Attribute isAbstract. $val must be of type UMMF::UML_1_5::Foundation::Data_Types::Boolean or undef. Returns $obj.

count_isAbstract

  $obj->count_isAbstract;

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

generalization

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

Returns the AssociationEnd generalization values of type UMMF::UML_1_5::Foundation::Core::Generalization. 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_generalization

  $obj->set_generalization(@val);

Sets the AssociationEnd generalization value. Elements of @val must of type UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

add_generalization

  $obj->add_generalization(@val);

Adds AssociationEnd generalization values. Elements of @val must of type UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

remove_generalization

  $obj->remove_generalization(@val);

Removes the AssociationEnd generalization values @val. Elements of @val must of type UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

clear_generalization

  $obj->clear_generalization;

Clears the AssociationEnd generalization links to UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

count_generalization

  $obj->count_generalization;

Returns the number of elements associated with generalization.

specialization

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

Returns the AssociationEnd specialization values of type UMMF::UML_1_5::Foundation::Core::Generalization. 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_specialization

  $obj->set_specialization(@val);

Sets the AssociationEnd specialization value. Elements of @val must of type UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

add_specialization

  $obj->add_specialization(@val);

Adds AssociationEnd specialization values. Elements of @val must of type UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

remove_specialization

  $obj->remove_specialization(@val);

Removes the AssociationEnd specialization values @val. Elements of @val must of type UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

clear_specialization

  $obj->clear_specialization;

Clears the AssociationEnd specialization links to UMMF::UML_1_5::Foundation::Core::Generalization. Returns $obj.

count_specialization

  $obj->count_specialization;

Returns the number of elements associated with specialization.

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::UML_1_5::Foundation::Core::GeneralizableElement;

#use 5.6.1;
use strict;
use warnings;

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

our $VERSION = do { my @r = (q{1.5} =~ /\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::UML_1_5::__ObjectBase qw(:__ummf_array);


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

use base qw(
  UMMF::UML_1_5::Foundation::Core::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::UML_1_5::Foundation::Core::GeneralizableElement')  ;
}


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

  confess("typecheck: $msg: type '" . 'UMMF::UML_1_5::Foundation::Core::GeneralizableElement' . ": value '$x'")
    unless __validate_type($self, $x);
}


sub isaGeneralizableElement { 1 }


sub isaFoundation__Core__GeneralizableElement { 1 }


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

sub __model_name { 'Foundation::Core::GeneralizableElement' }



sub __isAbstract { 1; }


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

  $__tangram_schema ||=
  {
   'classes' =>
   [
     'UMMF::UML_1_5::Foundation::Core::GeneralizableElement' =>
     {
       'table' => 'Foundation__Core__GeneralizableElement',
       'abstract' => 1,
       'slots' => 
       { 
	 # Attributes
	 	       'isRoot'
       => {
	 'type_impl' => 'string',
                                             'col' => 'isRoot', 

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

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

                                                                                                                   }
      ,
         
	 # Associations
	 	 	       'generalization'
       => {
	 'type_impl' => 'iset',
         'class' => 'UMMF::UML_1_5::Foundation::Core::Generalization',

                           'table' => 'Foundation__Core__GeneralizableElement__generalization', 

                                                               'coll' => 'child',

                                                                               }
      ,
                  	 	       'specialization'
       => {
	 'type_impl' => 'iset',
         'class' => 'UMMF::UML_1_5::Foundation::Core::Generalization',

                           'table' => 'Foundation__Core__GeneralizableElement__specialization', 

                                                               'coll' => 'parent',

                                                                               }
      ,
                         },
       'bases' => [  'UMMF::UML_1_5::Foundation::Core::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 isRoot
  if ( exists $self->{'isRoot'} ) {
    my $x = $self->{'isRoot'};
    $self->{'isRoot'} = undef;
        $self->set_isRoot($x);
      } else {
        $self->{'isRoot'} = "false";
      }
  
    # Attribute isLeaf
  if ( exists $self->{'isLeaf'} ) {
    my $x = $self->{'isLeaf'};
    $self->{'isLeaf'} = undef;
        $self->set_isLeaf($x);
      } else {
        $self->{'isLeaf'} = "false";
      }
  
    # Attribute isAbstract
  if ( exists $self->{'isAbstract'} ) {
    my $x = $self->{'isAbstract'};
    $self->{'isAbstract'} = undef;
        $self->set_isAbstract($x);
      } else {
        $self->{'isAbstract'} = "false";
      }
  


  # Associations

  # AssociationEnd 
  #  child 1
  #  <--> 
  #  generalization 0..* UMMF::UML_1_5::Foundation::Core::Generalization.
    if ( defined $self->{'generalization'} ) {
    my $x = $self->{'generalization'};
        $self->{'generalization'} = Set::Object->new();
        $self->set_generalization(@$x);
  }
  
  # AssociationEnd 
  #  parent 1
  #  <--> 
  #  specialization 0..* UMMF::UML_1_5::Foundation::Core::Generalization.
    if ( defined $self->{'specialization'} ) {
    my $x = $self->{'specialization'};
        $self->{'specialization'} = Set::Object->new();
        $self->set_specialization(@$x);
  }
  

  $self;
}


my $__initialize_use;

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

  # $DB::single = 1;

  unless ( ! $__initialize_use ) {
    $__initialize_use = 1;
    $self->__use('UMMF::UML_1_5::Foundation::Core::Element');
    $self->__use('UMMF::UML_1_5::Foundation::Core::ModelElement');
  }

  $self->UMMF::UML_1_5::Foundation::Core::GeneralizableElement::___initialize;
  $self->UMMF::UML_1_5::Foundation::Core::Element::___initialize;
  $self->UMMF::UML_1_5::Foundation::Core::ModelElement::___initialize;

  $self;
}
      

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

  # $DB::single = 1;
  $self->UMMF::UML_1_5::Foundation::Core::GeneralizableElement::___create(@args);
  $self->UMMF::UML_1_5::Foundation::Core::Element::___create();
  $self->UMMF::UML_1_5::Foundation::Core::ModelElement::___create();

  $self;
}




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



#################################################################
# Attribute isRoot
# type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = "false"

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



#################################################################
# Attribute isLeaf
# type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = "false"

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}



#################################################################
# Attribute isAbstract
# type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue = "false"

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

  ;

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

  ;

  $val;
}


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

  ;

  if ( defined $val ) {
    ;
  }

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

  ;

  $self;
}


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

  ;

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

  ;

  defined $val ? 1 : 0;
}




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


#################################################################
# AssociationEnd child <---> generalization
# type = UMMF::UML_1_5::Foundation::Core::Generalization
# multiplicity = 0..*
# ordering = 

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

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

  # confess("Container for generalization $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_generalization ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_generalization;
  $self->add_generalization(@val);
}


sub add_generalization ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'generalization'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::UML_1_5::Foundation::Core::Generalization')->__typecheck($val, "UMMF::UML_1_5::Foundation::Core::GeneralizableElement.generalization");

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

    }
  
  $self;
}


sub remove_generalization ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'generalization'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::UML_1_5::Foundation::Core::Generalization')->__typecheck($val, "UMMF::UML_1_5::Foundation::Core::GeneralizableElement.generalization");

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

    # Remove associations with other ends.

        
    $old->remove_child($self) if $old;
    $val->add_child($self)    if $val;

  ;

  }
  
  $self;
}


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

        
    $old->remove_child($self) if $old;
    $val->add_child($self)    if $val;

  ;

  }
  
  $self;
}


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

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

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




#################################################################
# AssociationEnd parent <---> specialization
# type = UMMF::UML_1_5::Foundation::Core::Generalization
# multiplicity = 0..*
# ordering = 

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

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

  # confess("Container for specialization $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_specialization ($@)
{
  my ($self, @val) = @_;
  
  $self->clear_specialization;
  $self->add_specialization(@val);
}


sub add_specialization ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'specialization'} ||= Set::Object->new();
    my $old; # Place holder for other MACRO.
  
  for my $val ( @val ) {
    # Recursion lock
        next if $x->includes($val);
        $self->__use('UMMF::UML_1_5::Foundation::Core::Generalization')->__typecheck($val, "UMMF::UML_1_5::Foundation::Core::GeneralizableElement.specialization");

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

    }
  
  $self;
}


sub remove_specialization ($@)
{
  my ($self, @val) = @_;
  
    my $x = $self->{'specialization'} ||= Set::Object->new();
  
  for my $old ( @val ) {
    # Recursion lock
        next unless $x->includes($old);
    
    my $val = $old;
      
    $self->__use('UMMF::UML_1_5::Foundation::Core::Generalization')->__typecheck($val, "UMMF::UML_1_5::Foundation::Core::GeneralizableElement.specialization");

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

    # Remove associations with other ends.

        
    $old->remove_parent($self) if $old;
    $val->add_parent($self)    if $val;

  ;

  }
  
  $self;
}


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

        
    $old->remove_parent($self) if $old;
    $val->add_parent($self)    if $val;

  ;

  }
  
  $self;
}


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

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

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







# End of Class GeneralizableElement


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

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