SVN
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * @package HatenaSyntax |
|---|
| 4 | * @author anatoo<anatoo@nequal.jp> |
|---|
| 5 | * @license http://www.opensource.org/licenses/mit-license.php MIT License |
|---|
| 6 | * @version $Id: Leaf.php 1159 2009-09-06 09:43:29Z anatoo $ |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | include_once dirname(__FILE__) . '/INode.php'; |
|---|
| 10 | |
|---|
| 11 | class HatenaSyntax_Tree_Leaf implements HatenaSyntax_Tree_INode |
|---|
| 12 | { |
|---|
| 13 | protected $value; |
|---|
| 14 | |
|---|
| 15 | function __construct($value) |
|---|
| 16 | { |
|---|
| 17 | $this->value = $value; |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | function hasValue() |
|---|
| 21 | { |
|---|
| 22 | return true; |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | function getValue() |
|---|
| 26 | { |
|---|
| 27 | return $this->value; |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | function hasChildren() |
|---|
| 31 | { |
|---|
| 32 | return false; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | function getChildren() |
|---|
| 36 | { |
|---|
| 37 | return array(); |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | function getType() |
|---|
| 41 | { |
|---|
| 42 | return 'leaf'; |
|---|
| 43 | } |
|---|
| 44 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.