/usr/share/perl5/Autodia/Diagram/Superclass.pm is in autodia 2.14-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | ################################################################
# Autodia - Automatic Dia XML.(C)Copyright 2001-2009 A Trevena #
# #
# AutoDia comes with ABSOLUTELY NO WARRANTY; see COPYING file #
# This is free software, and you are welcome to redistribute #
# it under certain conditions; see COPYING file for details #
################################################################
package Autodia::Diagram::Superclass;
use strict;
use Carp qw(cluck);
use base qw(Autodia::Diagram::Object);
#---------------------------------------------------------------------
#####################
# Constructor Methods
sub new
{
my $class = shift;
my $name = shift;
cluck "new method called with no name\n" unless ($name);
my $DiagramSuperclass = {};
bless ($DiagramSuperclass, ref($class) || $class);
$DiagramSuperclass->_initialise($name);
return $DiagramSuperclass;
}
#--------------------------------------------------------------------
# Access Methods
sub Inheritances
{
my $self = shift;
my @inheritances = ();
if (ref $self->{"inheritances"}) {
@inheritances = @{$self->{"inheritances"}};
}
return @inheritances;
}
sub add_inheritance
{
my $self = shift;
my $new_inheritance = shift;
my @inheritances;
$new_inheritance->Parent($self->Id);
if (defined $self->{"inheritances"})
{ @inheritances = @{$self->{"inheritances"}}; }
push(@inheritances, $new_inheritance);
$self->{"inheritances"} = \@inheritances;
return scalar(@inheritances);
}
sub Relations {
my $self = shift;
return (ref $self->{"relations"}) ? @{$self->{"relations"}} : () ;
}
sub add_relation {
my $self = shift;
my $new_relation = shift;
$self->{relations} ||= [];
push(@{$self->{relations}}, $new_relation);
return 1;
}
sub Redundant {
my $self = shift;
my $replacement = shift || 0;
if ($replacement) {
if ($self->{"_redundant"}) {
my $current_replacement = $self->{"_redundant"};
return -1;
}
$self->{"_redundant"} = $replacement;
return 1;
}
$self->{_redundant} = 0;
return 0;
}
sub Name {
my $self = shift;
my $name = shift;
if ($name)
{
$self->{"name"} = $name;
return 1;
}
else
{ return $self->{"name"}; }
}
sub LocalId
{
my $self = shift;
my $return_val = 1;
my $new_id = shift;
if ($new_id)
{ $self->{"local_id"} = $new_id }
else
{ $return_val = $self->{"local_id"}; }
return $return_val;
}
#--------------------------------------------------------------------------
# Internal Methods
sub _initialise # over-rides method in DiagramObject
{
my $self = shift;
my $name = shift;
$self->{"name"} = $name;
$self->{"type"} = "superclass";
return 1;
}
sub _update # over-rides method in DiagramObject
{
my $self = shift;
$self->reposition();
return 1;
}
1;
##########################################################################
|