# -*- 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::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction;
#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
#
=head1 NAME
UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction --
=head1 VERSION
1.5
=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::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction|UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction>
=head1 ATTRIBUTES
=head2 C<isUnordered> : UMMF::UML_1_5::Foundation::Data_Types::Boolean
=over 4
=item metatype = L<UMMF::UML_1_5::Foundation::Core::Attribute|UMMF::UML_1_5::Foundation::Core::Attribute>
=item type = L<UMMF::UML_1_5::Foundation::Data_Types::Boolean|UMMF::UML_1_5::Foundation::Data_Types::Boolean>
=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<> : I<THIS> C<0..1> ----E<gt> C<loopVariable> : UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin 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::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>
=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
=head2 C<> : I<THIS> C<0..1> ----E<gt> C<subinput> : UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin C<1..*>
=over 4
=item metatype = L<UMMF::UML_1_5::Foundation::Core::AssociationEnd|UMMF::UML_1_5::Foundation::Core::AssociationEnd>
=item type = L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>
=item multiplicity = C<1..*>
=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<> : I<THIS> C<0..1> ----E<gt> C<suboutput> : UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin 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::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>
=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::UML_1_5::__ObjectBase qw(:__ummf_array);
#################################################################
# Generalizations
#
use base qw(
UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction
);
#################################################################
# Exports
#
our @EXPORT_OK = qw(
);
our %EXPORT_TAGS = ( 'all' => \@EXPORT_OK );
#################################################################
# Validation
#
=head2 C<__validate_type>
UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction->__validate_type($value);
Returns true if C<$value> is a valid representation of L<UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction|UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction>.
=cut
sub __validate_type($$)
{
my ($self, $x) = @_;
no warnings;
UNIVERSAL::isa($x, 'UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction') ;
}
=head2 C<__typecheck>
UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction->__typecheck($value, $msg);
Calls C<confess()> with C<$msg> if C<<UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction->__validate_type($value)>> is false.
=cut
sub __typecheck
{
my ($self, $x, $msg) = @_;
confess("typecheck: $msg: type '" . 'UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction' . ": value '$x'")
unless __validate_type($self, $x);
}
=head2 C<isaIterateAction>
Returns true if receiver is a L<UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction|UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction>.
Other receivers will return false.
=cut
sub isaIterateAction { 1 }
=head2 C<isaBehavioral_Elements__Actions__Collection_Actions__Iterate__IterateAction>
Returns true if receiver is a L<UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction|UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction>.
Other receivers will return false.
This is the fully qualified version of the C<isaIterateAction> method.
=cut
sub isaBehavioral_Elements__Actions__Collection_Actions__Iterate__IterateAction { 1 }
#################################################################
# Introspection
#
=head2 C<__model_name>
my $name = $obj_or_package->__model_name;
Returns the UML Model name (C<'Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction'>) for an object or package of
this Classifier.
=cut
sub __model_name { 'Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction' }
=head2 C<__isAbstract>
$package->__isAbstract;
Returns C<0>.
=cut
sub __isAbstract { 0; }
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::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction' =>
{
'table' => 'Behavioral_Elements__Actions__Collection_Actions__Iterate__IterateAction',
'abstract' => 0,
'slots' =>
{
# Attributes
'isUnordered'
=> {
'type_impl' => 'string',
'col' => 'isUnordered',
}
,
# Associations
'loopVariable'
=> {
'type_impl' => 'iarray',
'class' => 'UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin',
'table' => 'Behavioral_Elements__Actions__Collection_Actions__Iterate__IterateAction__loopVariable',
'coll' => 'iterateAction',
'slot' => 'iterateAction_i',
'aggreg' => '1',
}
,
'subinput'
=> {
'type_impl' => 'iset',
'class' => 'UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin',
'table' => 'Behavioral_Elements__Actions__Collection_Actions__Iterate__IterateAction__subinput',
'coll' => 'iterateAction',
}
,
'suboutput'
=> {
'type_impl' => 'iarray',
'class' => 'UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin',
'table' => 'Behavioral_Elements__Actions__Collection_Actions__Iterate__IterateAction__suboutput',
'coll' => 'iterateAction',
'slot' => 'iterateAction_i',
}
,
},
'bases' => [ 'UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction', ],
'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 isUnordered
if ( exists $self->{'isUnordered'} ) {
my $x = $self->{'isUnordered'};
$self->{'isUnordered'} = undef;
$self->set_isUnordered($x);
} else {
}
# Associations
# AssociationEnd
# 0..1
# <-->
# loopVariable 0..* UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin.
if ( defined $self->{'loopVariable'} ) {
my $x = $self->{'loopVariable'};
$self->{'loopVariable'} = [ ];
$self->set_loopVariable(@$x);
}
# AssociationEnd
# 0..1
# <-->
# subinput 1..* UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin.
if ( defined $self->{'subinput'} ) {
my $x = $self->{'subinput'};
$self->{'subinput'} = Set::Object->new();
$self->set_subinput(@$x);
}
# AssociationEnd
# 0..1
# <-->
# suboutput 0..* UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin.
if ( defined $self->{'suboutput'} ) {
my $x = $self->{'suboutput'};
$self->{'suboutput'} = [ ];
$self->set_suboutput(@$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->__use('UMMF::UML_1_5::Foundation::Core::Element');
$self->__use('UMMF::UML_1_5::Foundation::Core::ModelElement');
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::Action');
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction');
}
$self->UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction::___initialize;
$self->UMMF::UML_1_5::Foundation::Core::Element::___initialize;
$self->UMMF::UML_1_5::Foundation::Core::ModelElement::___initialize;
$self->UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::Action::___initialize;
$self->UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction::___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::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction::___create(@args);
$self->UMMF::UML_1_5::Foundation::Core::Element::___create();
$self->UMMF::UML_1_5::Foundation::Core::ModelElement::___create();
$self->UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::Action::___create();
$self->UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::CollectionAction::___create();
$self;
}
#################################################################
# Attributes
#
=for html <hr/>
=cut
#################################################################
# Attribute isUnordered
# type = UMMF::UML_1_5::Foundation::Data_Types::Boolean
# multiplicity = 1
# ordering = unordered
# ownerScope = instance
# initialValue =
=head2 C<isUnordered>
my $val = $obj->isUnordered;
Returns the L<UMMF::UML_1_5::Foundation::Data_Types::Boolean|UMMF::UML_1_5::Foundation::Data_Types::Boolean> value of Attribute C<isUnordered>.
=cut
sub isUnordered ($)
{
my ($self) = @_;
;
my $val = $self->{'isUnordered'};
;
$val;
}
=head2 C<set_isUnordered>
$obj->set_isUnordered($val);
Sets the value of Attribute C<isUnordered>.
C<$val> must be of type L<UMMF::UML_1_5::Foundation::Data_Types::Boolean|UMMF::UML_1_5::Foundation::Data_Types::Boolean> or C<undef>.
Returns C<$obj>.
=cut
sub set_isUnordered ($$)
{
my ($self, $val) = @_;
;
if ( defined $val ) {
;
}
$self->{'isUnordered'} = $val
;
;
$self;
}
=head2 C<count_isUnordered>
$obj->count_isUnordered;
Returns the number of elements (0 or 1) in C<isUnordered>.
=cut
sub count_isUnordered ($)
{
my ($self) = @_;
;
my $val = $self->{'isUnordered'};
;
defined $val ? 1 : 0;
}
#################################################################
# Association
#
=for html <hr/>
=cut
#################################################################
# AssociationEnd <---> loopVariable
# type = UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin
# multiplicity = 0..*
# ordering = ordered
=head2 C<loopVariable>
my @val = $obj->loopVariable;
my $ary_val = $obj->loopVariable;
Returns the AssociationEnd C<loopVariable> values of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
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 loopVariable ($)
{
my ($self) = @_;
my $x = $self->{'loopVariable'} ||= [ ];
wantarray ? @{$x} : $x;
}
=head2 C<index_loopVariable>
my $x = $obj->index_loopVariable($i);
my @x = $obj->index_loopVariable($i, $count);
In scalar context, returns the value of AssociationEnd C<loopVariable> at index C<$i>.
In array context, returns the values between index C<$i> and C<$i + $count - 1>, inclusive.
=cut
sub index_loopVariable ($$@)
{
my ($self, $i, $count) = @_;
;
my $val = $self->{'loopVariable'} ||= [ ];
;
wantarray ? $val->[$i .. (defined $count ? $i + $count - 1 : $i)]
: $val->[$i];
}
=head2 C<index_of_loopVariable>
my $index = $obj->index_of_loopVariable($val);
Returns the index of C<$val> in AssociationEnd C<loopVariable>.
Return C<undef> if C<$val> is not in C<loopVariable>.
=cut
sub index_of_loopVariable ($$)
{
my ($self, $x) = @_;
;
my $val = $self->{'loopVariable'} ||= [ ];
;
__ummf_array_index($val, $x);
}
=head2 C<set_loopVariable>
$obj->set_loopVariable(@val);
Sets the AssociationEnd C<loopVariable> value.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub set_loopVariable ($@)
{
my ($self, @val) = @_;
$self->clear_loopVariable;
$self->add_loopVariable(@val);
}
=head2 C<set_index_loopVariable>
$obj->set_index_loopVariable($i, $val);
Sets the value of AssociationEnd C<loopVariable> at index C<$i>.
Returns self.
=cut
sub set_index_loopVariable ($$$)
{
my ($self, $i, $val) = @_;
;
my $x = $self->{'loopVariable'} ||= [ ];
no warnings;
my $old;
if ( ($old = $x->[$i]) ne $val) {
# Recursion lock
$x->[$i] = $val
;
# Remove and add associations with other ends.
;
}
$self;
}
=head2 C<add_loopVariable>
$obj->add_loopVariable(@val);
Adds AssociationEnd C<loopVariable> values.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub add_loopVariable ($@)
{
my ($self, @val) = @_;
my $x = $self->{'loopVariable'} ||= [ ];
my $old; # Place holder for other MACRO.
for my $val ( @val ) {
# Recursion lock
next if grep($_ eq $val, @$x);
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.loopVariable");
# Recursion lock
push(@{$x}, $val);
# Remove and add associations with other ends.
}
$self;
}
=head2 C<add_index_loopVariable>
$obj->add_index_loopVariable($i, @val);
Adds AssociationEnd C<loopVariable> values at index C<$i>.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub add_index_loopVariable ($$@)
{
my ($self, $i, @val) = @_;
my $x = $self->{'loopVariable'} ||= [ ];
my $old; # Place holder for other MACRO.
for my $val ( @val ) {
# Recursion lock
next if grep($_ eq $val, @$x);
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.loopVariable");
# Recursion lock
splice(@{$x}, $i, 0, $val); # Recursion lock
++ $i;
# Remove and add associations with other ends.
}
$self;
}
=head2 C<remove_loopVariable>
$obj->remove_loopVariable(@val);
Removes the AssociationEnd C<loopVariable> values C<@val>.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub remove_loopVariable ($@)
{
my ($self, @val) = @_;
my $x = $self->{'loopVariable'} ||= [ ];
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::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.loopVariable");
# Recursion lock
splice(@$x, $i, 1);
$val = undef;
# Remove associations with other ends.
;
}
$self;
}
=head2 C<clear_loopVariable>
$obj->clear_loopVariable;
Clears the AssociationEnd C<loopVariable> links to L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub clear_loopVariable ($)
{
my ($self) = @_;
my $x = $self->{'loopVariable'} ||= [ ];
my $val; # Place holder for other MACRO.
$self->{'loopVariable'} = [ ]; # Recursion lock
for my $old ( @$x ) { # Recursion lock
# Remove associations with other ends.
;
}
$self;
}
=head2 C<count_loopVariable>
$obj->count_loopVariable;
Returns the number of elements associated with C<loopVariable>.
=cut
sub count_loopVariable ($)
{
my ($self) = @_;
my $x = $self->{'loopVariable'};
defined $x ? scalar @$x : 0;
}
=for html <hr/>
=cut
#################################################################
# AssociationEnd <---> subinput
# type = UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin
# multiplicity = 1..*
# ordering =
=head2 C<subinput>
my @val = $obj->subinput;
my $ary_val = $obj->subinput;
Returns the AssociationEnd C<subinput> values of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
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 subinput ($)
{
my ($self) = @_;
my $x = $self->{'subinput'};
# confess("Container for subinput $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_subinput>
$obj->set_subinput(@val);
Sets the AssociationEnd C<subinput> value.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub set_subinput ($@)
{
my ($self, @val) = @_;
$self->clear_subinput;
$self->add_subinput(@val);
}
=head2 C<add_subinput>
$obj->add_subinput(@val);
Adds AssociationEnd C<subinput> values.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub add_subinput ($@)
{
my ($self, @val) = @_;
my $x = $self->{'subinput'} ||= 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::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.subinput");
# Recursion lock
$x->insert($val);
# weaken?
# Remove and add associations with other ends.
}
$self;
}
=head2 C<remove_subinput>
$obj->remove_subinput(@val);
Removes the AssociationEnd C<subinput> values C<@val>.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub remove_subinput ($@)
{
my ($self, @val) = @_;
my $x = $self->{'subinput'} ||= Set::Object->new();
for my $old ( @val ) {
# Recursion lock
next unless $x->includes($old);
my $val = $old;
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.subinput");
# Recursion lock
$x->remove($old);
$val = undef;
# Remove associations with other ends.
;
}
$self;
}
=head2 C<clear_subinput>
$obj->clear_subinput;
Clears the AssociationEnd C<subinput> links to L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub clear_subinput ($)
{
my ($self) = @_;
my $x = $self->{'subinput'} ||= Set::Object->new();
my $val; # Place holder for other MACRO.
$self->{'subinput'} = Set::Object->new(); # Recursion lock
for my $old ( $x->members() ) { # Recursion lock
# Remove associations with other ends.
;
}
$self;
}
=head2 C<count_subinput>
$obj->count_subinput;
Returns the number of elements associated with C<subinput>.
=cut
sub count_subinput ($)
{
my ($self) = @_;
my $x = $self->{'subinput'};
defined $x ? $x->size : 0;
}
=for html <hr/>
=cut
#################################################################
# AssociationEnd <---> suboutput
# type = UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin
# multiplicity = 0..*
# ordering = ordered
=head2 C<suboutput>
my @val = $obj->suboutput;
my $ary_val = $obj->suboutput;
Returns the AssociationEnd C<suboutput> values of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
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 suboutput ($)
{
my ($self) = @_;
my $x = $self->{'suboutput'} ||= [ ];
wantarray ? @{$x} : $x;
}
=head2 C<index_suboutput>
my $x = $obj->index_suboutput($i);
my @x = $obj->index_suboutput($i, $count);
In scalar context, returns the value of AssociationEnd C<suboutput> at index C<$i>.
In array context, returns the values between index C<$i> and C<$i + $count - 1>, inclusive.
=cut
sub index_suboutput ($$@)
{
my ($self, $i, $count) = @_;
;
my $val = $self->{'suboutput'} ||= [ ];
;
wantarray ? $val->[$i .. (defined $count ? $i + $count - 1 : $i)]
: $val->[$i];
}
=head2 C<index_of_suboutput>
my $index = $obj->index_of_suboutput($val);
Returns the index of C<$val> in AssociationEnd C<suboutput>.
Return C<undef> if C<$val> is not in C<suboutput>.
=cut
sub index_of_suboutput ($$)
{
my ($self, $x) = @_;
;
my $val = $self->{'suboutput'} ||= [ ];
;
__ummf_array_index($val, $x);
}
=head2 C<set_suboutput>
$obj->set_suboutput(@val);
Sets the AssociationEnd C<suboutput> value.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub set_suboutput ($@)
{
my ($self, @val) = @_;
$self->clear_suboutput;
$self->add_suboutput(@val);
}
=head2 C<set_index_suboutput>
$obj->set_index_suboutput($i, $val);
Sets the value of AssociationEnd C<suboutput> at index C<$i>.
Returns self.
=cut
sub set_index_suboutput ($$$)
{
my ($self, $i, $val) = @_;
;
my $x = $self->{'suboutput'} ||= [ ];
no warnings;
my $old;
if ( ($old = $x->[$i]) ne $val) {
# Recursion lock
$x->[$i] = $val
;
# Remove and add associations with other ends.
;
}
$self;
}
=head2 C<add_suboutput>
$obj->add_suboutput(@val);
Adds AssociationEnd C<suboutput> values.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub add_suboutput ($@)
{
my ($self, @val) = @_;
my $x = $self->{'suboutput'} ||= [ ];
my $old; # Place holder for other MACRO.
for my $val ( @val ) {
# Recursion lock
next if grep($_ eq $val, @$x);
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.suboutput");
# Recursion lock
push(@{$x}, $val);
# Remove and add associations with other ends.
}
$self;
}
=head2 C<add_index_suboutput>
$obj->add_index_suboutput($i, @val);
Adds AssociationEnd C<suboutput> values at index C<$i>.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub add_index_suboutput ($$@)
{
my ($self, $i, @val) = @_;
my $x = $self->{'suboutput'} ||= [ ];
my $old; # Place holder for other MACRO.
for my $val ( @val ) {
# Recursion lock
next if grep($_ eq $val, @$x);
$self->__use('UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.suboutput");
# Recursion lock
splice(@{$x}, $i, 0, $val); # Recursion lock
++ $i;
# Remove and add associations with other ends.
}
$self;
}
=head2 C<remove_suboutput>
$obj->remove_suboutput(@val);
Removes the AssociationEnd C<suboutput> values C<@val>.
Elements of C<@val> must of type L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub remove_suboutput ($@)
{
my ($self, @val) = @_;
my $x = $self->{'suboutput'} ||= [ ];
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::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin')->__typecheck($val, "UMMF::UML_1_5::Behavioral_Elements::Actions::Collection_Actions::Iterate::IterateAction.suboutput");
# Recursion lock
splice(@$x, $i, 1);
$val = undef;
# Remove associations with other ends.
;
}
$self;
}
=head2 C<clear_suboutput>
$obj->clear_suboutput;
Clears the AssociationEnd C<suboutput> links to L<UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin|UMMF::UML_1_5::Behavioral_Elements::Actions::Action_Foundation::OutputPin>.
Returns C<$obj>.
=cut
sub clear_suboutput ($)
{
my ($self) = @_;
my $x = $self->{'suboutput'} ||= [ ];
my $val; # Place holder for other MACRO.
$self->{'suboutput'} = [ ]; # Recursion lock
for my $old ( @$x ) { # Recursion lock
# Remove associations with other ends.
;
}
$self;
}
=head2 C<count_suboutput>
$obj->count_suboutput;
Returns the number of elements associated with C<suboutput>.
=cut
sub count_suboutput ($)
{
my ($self) = @_;
my $x = $self->{'suboutput'};
defined $x ? scalar @$x : 0;
}
# End of Class IterateAction
=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: ###