Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Tree\SimpleNode Class Reference
Inheritance diagram for Hoa\Tree\SimpleNode:

Public Member Functions

 __construct ($id, $value=null)
 
 setValue ($value=null)
 
 getId ()
 
 getValue ()
 
 __toString ()
 

Protected Member Functions

 setId ($id)
 

Protected Attributes

 $_id = null
 
 $_value = null
 

Detailed Description

Class .

It's just a simple node demo (may be used for example and test).

Definition at line 47 of file SimpleNode.php.

Constructor & Destructor Documentation

Hoa\Tree\SimpleNode::__construct (   $id,
  $value = null 
)

Build a node that contains a string.

Parameters
string$idThe node ID.
string$valueThe node value.
Returns
void

Definition at line 72 of file SimpleNode.php.

73  {
74  $this->setId($id);
75  $this->setValue($value);
76  }
setValue($value=null)
Definition: SimpleNode.php:98

Here is the call graph for this function:

Member Function Documentation

Hoa\Tree\SimpleNode::__toString ( )

Get the node string representation.

Returns
string

Implements Hoa\Tree\ITree\Node.

Definition at line 131 of file SimpleNode.php.

132  {
133  return (string) $this->getValue();
134  }

Here is the call graph for this function:

Hoa\Tree\SimpleNode::getId ( )

Get node ID, must be implement because of interface.

Returns
string

Implements Hoa\Tree\ITree\Node.

Definition at line 111 of file SimpleNode.php.

112  {
113  return $this->_id;
114  }
Hoa\Tree\SimpleNode::getValue ( )

Get node value.

Returns
string

Definition at line 121 of file SimpleNode.php.

122  {
123  return $this->_value;
124  }

Here is the caller graph for this function:

Hoa\Tree\SimpleNode::setId (   $id)
protected

Set node ID.

Parameters
string$idThe node ID.
Returns
string

Definition at line 84 of file SimpleNode.php.

85  {
86  $old = $this->_id;
87  $this->_id = $id;
88 
89  return $old;
90  }

Here is the caller graph for this function:

Hoa\Tree\SimpleNode::setValue (   $value = null)

Set node value.

Parameters
string$valueThe node value.
Returns
string

Definition at line 98 of file SimpleNode.php.

99  {
100  $old = $this->_value;
101  $this->_value = $value;
102 
103  return $old;
104  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\Tree\SimpleNode::$_id = null
protected

Definition at line 54 of file SimpleNode.php.

Hoa\Tree\SimpleNode::$_value = null
protected

Definition at line 61 of file SimpleNode.php.


The documentation for this class was generated from the following file: