| 1 | package SNA::Network::Edge; | ||||||||||
| 2 | |||||||||||
| 3 | 15 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 15 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 15 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 15 | ▶ | use Object::Tiny::XS qw(source target weight); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | =head1 NAME | ||||||||||
| 10 | |||||||||||
| 11 | SNA::Network::Edge - Edge class for SNA::Network | ||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||
| 15 | |||||||||||
| 16 | Quick summary of what the module does. | ||||||||||
| 17 | |||||||||||
| 18 | Perhaps a little code snippet. | ||||||||||
| 19 | |||||||||||
| 20 | use SNA::Network::Edge; | ||||||||||
| 21 | |||||||||||
| 22 | my $foo = SNA::Network::Edge->new(); | ||||||||||
| 23 | ... | ||||||||||
| 24 | |||||||||||
| 25 | |||||||||||
| 26 | =head1 METHODS | ||||||||||
| 27 | |||||||||||
| 28 | =head2 new | ||||||||||
| 29 | |||||||||||
| 30 | Create a new edge with source, target and weight. | ||||||||||
| 31 | |||||||||||
| 32 | =cut | ||||||||||
| 33 | |||||||||||
| 34 | sub new { | ||||||||||
| 35 | 3951 | ▶ | my ($package, %params) = @_; | ||||||||
|
Subroutine
new: called CC=5 SCAR=16.6
Pod
documented
| |||||||||||
| 36 | 3951 | ▶ | croak unless defined $params{source}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 3951 | ▶ | croak unless defined $params{target}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 3951 | ▶ | croak unless defined $params{index}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 3951 | ▶ | $params{weight} = 1 unless defined $params{weight}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 3951 | return bless { %params }, $package; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | |||||||||||
| 44 | =head2 source | ||||||||||
| 45 | |||||||||||
| 46 | Returns the source node object of the edge. | ||||||||||
| 47 | |||||||||||
| 48 | |||||||||||
| 49 | =head2 target | ||||||||||
| 50 | |||||||||||
| 51 | Returns the target node object of the edge. | ||||||||||
| 52 | |||||||||||
| 53 | =head2 weight | ||||||||||
| 54 | |||||||||||
| 55 | Returns the weight of the edge. | ||||||||||
| 56 | |||||||||||
| 57 | |||||||||||
| 58 | =head1 AUTHOR | ||||||||||
| 59 | |||||||||||
| 60 | Darko Obradovic, C<< <dobradovic at gmx.de> >> | ||||||||||
| 61 | |||||||||||
| 62 | =head1 BUGS | ||||||||||
| 63 | |||||||||||
| 64 | Please report any bugs or feature requests to C<bug-sna-network-edge at rt.cpan.org>, or through | ||||||||||
| 65 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SNA-Network>. I will be notified, and then you'll | ||||||||||
| 66 | automatically be notified of progress on your bug as I make changes. | ||||||||||
| 67 | |||||||||||
| 68 | |||||||||||
| 69 | |||||||||||
| 70 | |||||||||||
| 71 | =head1 SUPPORT | ||||||||||
| 72 | |||||||||||
| 73 | You can find documentation for this module with the perldoc command. | ||||||||||
| 74 | |||||||||||
| 75 | perldoc SNA::Network | ||||||||||
| 76 | |||||||||||
| 77 | |||||||||||
| 78 | You can also look for information at: | ||||||||||
| 79 | |||||||||||
| 80 | =over 4 | ||||||||||
| 81 | |||||||||||
| 82 | =item * RT: CPAN's request tracker | ||||||||||
| 83 | |||||||||||
| 84 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=SNA-Network> | ||||||||||
| 85 | |||||||||||
| 86 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||
| 87 | |||||||||||
| 88 | L<http://annocpan.org/dist/SNA-Network> | ||||||||||
| 89 | |||||||||||
| 90 | =item * CPAN Ratings | ||||||||||
| 91 | |||||||||||
| 92 | L<http://cpanratings.perl.org/d/SNA-Network> | ||||||||||
| 93 | |||||||||||
| 94 | =item * Search CPAN | ||||||||||
| 95 | |||||||||||
| 96 | L<http://search.cpan.org/dist/SNA-Network> | ||||||||||
| 97 | |||||||||||
| 98 | =back | ||||||||||
| 99 | |||||||||||
| 100 | |||||||||||
| 101 | =head1 ACKNOWLEDGEMENTS | ||||||||||
| 102 | |||||||||||
| 103 | |||||||||||
| 104 | =head1 COPYRIGHT & LICENSE | ||||||||||
| 105 | |||||||||||
| 106 | Copyright 2009 Darko Obradovic, all rights reserved. | ||||||||||
| 107 | |||||||||||
| 108 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 109 | under the same terms as Perl itself. | ||||||||||
| 110 | |||||||||||
| 111 | |||||||||||
| 112 | =cut | ||||||||||
| 113 | |||||||||||
| 114 | 15 | 1; # End of SNA::Network::Edge | |||||||||