. */ class Staple_Data_LinkedListNode { /** * The data contained in the node * @var mixed */ public $data; /** * Pointer to the next node * @var Staple_Data_LinkedListNode */ public $next; /** * Constructor to create data and link the node. * @param mixed $data * @param Staple_Data_LinkedListNode $next */ public function __construct($data,$next = null) { //Set the data $this->setData($data); //Set the next node link if(isset($next)) { $this->setNext($next); } } /** * @return the $data */ public function getData() { return $this->data; } /** * @return Staple_Data_LinkedListNode $next */ public function getNext() { return $this->next; } /** * @param mixed $data */ public function setData($data) { $this->data = $data; return $this; } /** * @param Staple_Data_LinkedListNode $next */ public function setNext(Staple_Data_LinkedListNode $next) { $this->next = $next; return $this; } }