NAME

Bio::Phylo::Mediators::NodeMediator - Mediator class to manage links between nodes.

SYNOPSIS

# no direct usage

DESCRIPTION

This module manages links between node objects. It is an implementation of the Mediator design pattern (e.g. see Relationship Manager Pattern, Mediator, Mediator Design Pattern).

Methods defined in this module are meant only for internal usage by Bio::Phylo.

METHODS

CONSTRUCTOR

new()
Type    : Constructor
Title   : new
Usage   : my $mediator = Bio::Phylo::Taxa::NodeMediator->new;
Function: Instantiates a Bio::Phylo::Taxa::NodeMediator
          object.
Returns : A Bio::Phylo::Taxa::NodeMediator object (singleton).
Args    : None.

METHODS

register()
Type    : Method
Title   : register
Usage   : $mediator->register( $obj );
Function: Stores an object in mediator's cache
Returns : $self
Args    : An object, $obj
Comments: This method is called every time a node is instantiated.
unregister()
Type    : Method
Title   : unregister
Usage   : $mediator->unregister( $obj );
Function: Cleans up mediator's cache of $obj and $obj's relations
Returns : $self
Args    : An object, $obj
Comments: This method is called every time a node ($obj) is destroyed.
set_link()
Type    : Method
Title   : set_link
Usage   : $mediator->set_link( node => $obj1, $connection => $obj2 );
Function: Creates link between objects
Returns : $self
Args    : node => a $node object
		   $connection => another $node object, where $connection is
		   *	parent
		   *	first_daughter
		   *	last_daughter
		   *	next_sister
		   *	previous_sister
Comments: This method is called from within, for example, set_parent
          method calls. A call like $node1->set_parent( $node2 ),
          is internally rerouted to:

          $mediator->set_link( 
               node   => $node1,
               parent => $node2, 
          );
update_tree()
Type    : Method
Title   : update_tree
Usage   : $mediator->update_tree( 
              keep   => $node1, 
              update => $node2,
          );
Function: updates tree membership
Returns : Linked object
Args    : keep   => $node1 (node whose tree membership to retain)
          update => $node2 (node whose tree membership 
          is moved to that of $node1)

Comments: This method is called so that $node2 and its descendants
		   becomes member of the same tree as $node1
get_link()
Type    : Method
Title   : get_link
Usage   : $mediator->get_link( $connection => $node );
Function: Retrieves relative of $node
Returns : Relative of $node
Args    : $connection => $node, where $connection can be:
		   *	parent_of
		   *	next_sister_of
		   *	previous_sister_of
		   *	first_daughter_of
		   *	last_daughter_of

SEE ALSO

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual.

FORUM

CPAN hosts a discussion forum for Bio::Phylo. If you have trouble using this module the discussion forum is a good place to start posting questions (NOT bug reports, see below): http://www.cpanforum.com/dist/Bio-Phylo

BUGS

Please report any bugs or feature requests to bug-bio-phylo@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-Phylo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. Be sure to include the following in your request or comment, so that I know what version you're using:

$Id: TaxaMediator.pm 3386 2007-03-24 16:22:25Z rvosa $

AUTHOR

Rutger A. Vos,

email: rvosa@sfu.ca
web page: http://www.sfu.ca/~rvosa/

ACKNOWLEDGEMENTS

The author would like to thank Jason Stajich for many ideas borrowed from BioPerl http://www.bioperl.org, and CIPRES http://www.phylo.org and FAB* http://www.sfu.ca/~fabstar for comments and requests.

COPYRIGHT & LICENSE

Copyright 2005 Rutger A. Vos, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.