Type : Mutator
Title : delete
Usage : $obj->delete($other_obj);
Function: Deletes an object from its container.
Returns : A Bio::Phylo::Listable object.
Args : A Bio::Phylo::* object.
Note : Be careful with this method: deleting
a node from a tree like this will
result in undefined references in its
neighbouring nodes. Its children will
have their parent reference become
undef (instead of pointing to their
grandparent, as collapsing a node would
do). The same is true for taxon objects
that reference datum objects: if the
datum object is deleted from a matrix
(say), the taxon will now hold undefined
references.

Many Bio::Phylo objects are segmented, i.e. they contain one or more subparts of the same type. For example, a matrix contains multiple rows; each row contains multiple cells; a tree contains nodes, and so on. (Segmented objects all inherit from Bio::Phylo::Listable, i.e. the class whose documentation you're reading here.) In many cases it is useful to be able to define subsets of the contents of segmented objects, for example sets of taxon objects inside a taxa block. The Bio::Phylo::Listable object allows this through a number of methods (add_set, remove_set, add_to_set, remove_from_set etc.). Those methods delegate the actual management of the set contents to the Bio::Phylo::Set object. Consult the documentation for Bio::Phylo::Set for a code sample.

Type : Test
Title : is_in_set
Usage : @do_something if $listable->is_in_set($obj,$set);
Function: Returns whether or not the first argument is listed in the second argument
Returns : Boolean
Args : $obj - an object that may, or may not be in $set
$set - the Bio::Phylo::Set object to query
Notes : This method makes two assumptions:
i) the $set object is associated with the container,
i.e. add_set($set) has been called previously
ii) the $obj object is part of the container
If either assumption is violated a warning message
is printed.

Type : Mutator
Title : add_to_set
Usage : $listable->add_to_set($obj,$set);
Function: Adds first argument to the second argument
Returns : Invocant
Args : $obj - an object to add to $set
$set - the Bio::Phylo::Set object to add to
Notes : this method assumes that $obj is already
part of the container. If that assumption is
violated a warning message is printed.

Type : Mutator
Title : remove_from_set
Usage : $listable->remove_from_set($obj,$set);
Function: Removes first argument from the second argument
Returns : Invocant
Args : $obj - an object to remove from $set
$set - the Bio::Phylo::Set object to remove from
Notes : this method assumes that $obj is already
part of the container. If that assumption is
violated a warning message is printed.