Zeta Components Manual :: Docs For Class ezcTreeVisitorPlainText
Tree::ezcTreeVisitorPlainText
Class ezcTreeVisitorPlainText
An implementation of the ezcTreeVisitor interface that generates a plain text representation of a tree structure.
- <?php
- $tree->accept( $visitor );
- echo (string) $visitor; // print the plot
- ?>
Shows (something like):
- Hylobatidae
- ââHylobates
- â ââLar Gibbon
- â ââAgile Gibbon
- â ââMüller's Bornean Gibbon
- â ââSilvery Gibbon
- â ââPileated Gibbon
- â ââKloss's Gibbon
- ââHoolock
- â ââWestern Hoolock Gibbon
- â ââEastern Hoolock Gibbon
- ââSymphalangus
- ââNomascus
- ââBlack Crested Gibbon
- ââEastern Black Crested Gibbon
- ââWhite-cheecked Crested Gibbon
- ââYellow-cheecked Gibbon
Source for this file: /Tree/src/visitors/plain_text.php
Implements interfaces:
Version: | //autogentag// |
Constants
SYMBOL_ASCII
= 1
|
Represents the ASCII symbol set. |
SYMBOL_UTF8
= 2
|
Represents the UTF-8 symbol set. |
Member Variables
protected array(string=>array(string)) |
$edges
= array()
Holds all the edges of the graph. |
protected string |
$root
= null
Holds the root ID |
Method Summary
public ezcTreeVisitorPlainText |
__construct(
[ $symbolCharset
= self::SYMBOL_UTF8] )
Constructs a new ezcTreeVisitorPlainText visualizer using $symbolCharset as character set. |
public bool |
visit(
$visitable
)
Visits the node and sets the the member variables according to the node type and contents. |
Methods
__construct
ezcTreeVisitorPlainText
__construct(
[int
$symbolCharset
= self::SYMBOL_UTF8] )
Constructs a new ezcTreeVisitorPlainText visualizer using $symbolCharset as character set.
This class only supports 'ascii' and 'utf-8' as character sets. Default is 'utf-8'.
Parameters:
Name | Type | Description |
---|---|---|
$symbolCharset |
int |
visit
bool
visit(
ezcTreeVisitable
$visitable
)
Visits the node and sets the the member variables according to the node type and contents.
Parameters:
Name | Type | Description |
---|---|---|
$visitable |
ezcTreeVisitable |
Implementation of:
Method | Description |
---|---|
ezcTreeVisitor::visit() |
Visit the $visitable. |
Documentation generated by phpDocumentor 1.4.3