1 Star 4 Fork 1

DennisRitche/php-tree

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Node.php 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
saberyjs 提交于 2019-12-13 11:16 . bug fixed
<?php
/**
* User:@DennisRitche
*/
class Node
{
/**
* @var $value mixed
* **/
private $value = null;
/**
* @var $left_node Node
* **/
private $left_node = null;
/**
* @var $right_node Node
* **/
private $right_node = null;
/**
* @var $parent_node Node
* **/
private $parent_node = null;
/**
* Node constructor.
* @param $value mixed
*/
public function __construct($value)
{
$this->value = $value;
}
/**
* @param $value mixed
* @return self
*/
public static function create($value)
{
return new static($value);
}
/**
* @return Node
*/
public function getLeftNode()
{
return $this->left_node;
}
/**
* @param Node $left_node
*/
public function setLeftNode($left_node)
{
$this->left_node = $left_node;
}
/**
* @return Node
*/
public function getRightNode()
{
return $this->right_node;
}
/**
* @param Node $right_node
*/
public function setRightNode($right_node)
{
$this->right_node = $right_node;
}
/**
* @return mixed
*/
public function getValue()
{
return $this->value;
}
/**
* @param mixed $value
*/
public function setValue($value)
{
$this->value = $value;
}
/**
* @return Node
*/
public function getParentNode()
{
return $this->parent_node;
}
/**
* @param Node $parent_node
*/
public function setParentNode($parent_node)
{
$this->parent_node = $parent_node;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/obamajs/php-tree.git
git@gitee.com:obamajs/php-tree.git
obamajs
php-tree
php-tree
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385