| Summary | Package variables | Synopsis | Description | General documentation | Methods |
| Summary | Top |
| Clair::ALE::Conn - A connection between two pages, consisting of one or more links, created the the Automatic Link Extrapolator. |
| Package variables | Top |
| No package variables defined. |
| Included modules | Top |
| Carp |
| Clair::ALE::Link |
| Clair::ALE::URL |
| Clair::Utils::ALE |
| Synopsis | Top |
| This object contains one or more Clair::ALE::Link objects which lead from one URL to another. |
| Description | Top |
|
new (link1, link2, link3, ..., linkn) Create a new connection between link1 and linkn, which takes a paththrough link2, link3, etc. $conn->print ([indent_spaces]) Print a brief, human-readable description of a Connection. If theindent_spaces parameter is provided, everything will be indented by indent_spaces characters of $Clair::Utils::ALE::INDENTCHAR; this is useful for printing easy-to-read nested structures. No other guarantees about the format of the output are provided; if you need a specific format, you should just print things out yourself, or else talk to me about adding a specialized printing method. $conn->{links} An array reference to all of the links that make up this connection.$conn->{numlinks} The number of links in this connection.$conn->lastlink The number of the last link in this connection. |
| Methods | Top |
| new | No description | Code |
| No description | Code |
| new | description | prev | next | Top |
sub new
{
my $class = shift;
my $self = {
links => [@_],
numlinks => scalar(@_),
lastlink => scalar(@_)-1,
};
bless $self,$class;} |
| description | prev | next | Top |
sub print
{
my $self = shift;
my($indent_spaces) = @_;
my $indent;
if ($indent_spaces)
{
$indent = $Clair::Utils::ALE::INDENTCHAR x $Clair::Utils::ALE::INDENTS_PER_LEVEL;
}
else
{
$indent = "";
$indent_spaces=0;
}
my $hop=1;
print $indent,"(Connection)\n";
foreach my $l (@{$self->{links}})
{
print $indent,"Hop $hop\n";
$hop++;
$l->print($indent_spaces + $Clair::Utils::ALE::INDENTS_PER_LEVEL);
}} |
| EXAMPLES | Top |
| Mostly, connections will come back from Clair::ALE::Search and other modules; there really isn't a good reason to create one yourself, but if you want to, you can do: my $link1 = Clair::ALE::Link->new(to => Clair::ALE::URL->new(url=>'http://www.test.com/',id=>1), |
| SEE ALSO | Top |
| Clair::ALE, Clair::ALE::Search, Clair::ALE::URL, Clair::ALE::Link. |